Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Jul 2006
    Posts
    6

    Jive Infrared Programming

    Hi,

    I'm having a bit of a trouble accessing the Jive's IR port.
    I'm doing the following from lua to test:

    require "io"
    inp=io.open("/etc/remotecode.bin", "rb+")
    data = inp:read("*all")
    ir=io.open("/dev/misc/irtx", "rb+")
    ir:write(data)
    ir:close()

    Now, this causes some IR stuff to be transitted (I've got a sensor lighting up). BUT -- I'm not sure what is sent (I don't think it's whatever I'm trying to send), and after I do ir:close, the remote is just stuck.
    I've tried to encode the remote codes as shown in testir.c (tho I'm not sure whether an int is 16- or 32-bit, and whether stuff is little or big endian; quick info here will be helpful).

    Any help will be most welcome.

    Thanks,

  2. #2
    Slim Devices Developer fcm4711's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    886

    Not possible from lua at the moment

    Hello zigsterz

    Currently it is not possible to talk directly to the ir driver from lua. Some c glue layer needs to be in place first.

    At the moment only NEC type ir commands can be sent and only via the testir c program.

    You'll find a sample script (TestIRApplet.lua) in the Factory Test menu. It can control a SB or Transporter via ir.

    Cheers
    Felix
    Programming is the art of cleverly arranging bits and bytes. - (c) Felix Mueller

  3. #3
    Junior Member
    Join Date
    Nov 2007
    Posts
    12

    Jive IR control of other devices

    I have been trying to "find my way" to developing a simple LUA IR control so I can use the Jive to regulate the volume and bass level on my next gen Aux Out speakers which will use Philips AV type IR. So far, looking around this development forum, it would seem that that is not yet a possibility. Could I do it if I moved to C? is it worth waiting for the C glue for LUA - anyone have a timeline?

    Thanks in advance!

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,475

    [SlimDevices: Jive] Jive Infrared Programming

    > I have been trying to "find my way" to developing a simple LUA IR

    Search around for IRBlaster - it should do that for you.

  5. #5
    Junior Member
    Join Date
    Nov 2007
    Posts
    12

    i meant for the jive

    I want the jive handset to send the IR to my controls - not introduce another box to the equation.

  6. #6
    Slim Devices Developer fcm4711's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    886
    Hello David

    Philips type ir commands (i.e. RC5 and RC6) are not yet possible as the driver does not support it yet. So even reverting to programming your app in C would not help - the ir driver needs to be 'enhanced' first. Unfortunately I cannot give you a timeline as I don't know what the plan for ir on Jive is. All I know is that it is not a 'core' feature and therefore low on priority.

    Cheers
    Felix
    Programming is the art of cleverly arranging bits and bytes. - (c) Felix Mueller

  7. #7
    Senior Software Engineer - Logitech/Slim Devices
    Join Date
    Apr 2005
    Location
    Ipswich, UK
    Posts
    1,394
    Quote Originally Posted by fcm4711 View Post
    All I know is that it is not a 'core' feature and therefore low on priority.
    But as always patches are welcome. You'll find the ir linux driver in the jive svn repository. I am not sure what changes are needed, but I am sure Felix could give some advice if you need it.

    Richard

  8. #8
    Slim Devices Developer fcm4711's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    886
    Hello all

    I've put in the C glue to use ir on Jive from Lua.

    To use it, call /usr/bin/testir from lua with command line arguments. All arguments are four bytes and in hex notation.

    The first argument is the carrier frequency to be used, followed by the ir command bits. If the carrier should be turned on, set the highest bit (i.e. 0x80000000).

    So for instance 0x80002260 means send a mark (on with carrier) for 8800ms and 0x00001130 means send a space (off) for 4400ms.

    Here is a sample lua script that send the arrow down command for a Squeezebox or Transporter.

    Cheers
    Felix

    -- Carrier frequency - 40000Hz
    cmd = "0x00009C40 "
    -- Lead bit
    cmd = cmd .. "0x80002260 0x00001130 "
    -- Command - Squeezebox arrow down
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000226 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000659 "
    cmd = cmd .. "0x80000226 0x00000226 "
    os.execute("/usr/bin/testir " .. cmd)
    Programming is the art of cleverly arranging bits and bytes. - (c) Felix Mueller

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •