PDA

View Full Version : Jive Infrared Programming



zigsterz
2007-11-18, 13:03
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,

fcm4711
2007-11-19, 15:36
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

david.kuller
2007-12-11, 06:36
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!

mherger
2007-12-11, 06:48
> I have been trying to "find my way" to developing a simple LUA IR

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

david.kuller
2007-12-12, 16:27
I want the jive handset to send the IR to my controls - not introduce another box to the equation.

fcm4711
2007-12-13, 02:20
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

rtitmuss
2007-12-13, 03:52
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

fcm4711
2007-12-29, 14:07
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)