Linux - 4 - IR remote control

i have a serial port infra red reciever that recieves codes from standard consumer electronics remote controls. i had this running under Windows using the girder software. i aim to achieve the same functionality that i had previously under windows, this included full control of winTV, winAmp, shutdown, monitor standby, task switching, window closing etc.

The serial device i have is not a IRMAN reciever, but it is compatable with one, i know this because it functioned fine under girder using the UIR/irman plugin.

Hardware details

My device is a homemade device bought from the internet, it runs on a RS232 port. The port settings are 9600, 1 stop bit, no parity, no flow control. It is initiated by sending the characters 'I' then 'R', it responds by sending 'OK'. This is the same protocol as the UIR/irman recievers.

Linux software

It seems that the de factor IR control software for linux is LIRC.

Problems

The LIRC website says that you should firstly install the libirman software to interface to irman hardware. I did this, and the test utilities that come with libirman work absolutely fine.

i then tried to use the lirc program irrecord but this failed to respond at all to remote control presses.

It later emerges that the hardware i have does not support auto-repeating, that is holding a button down for a longer time, e.g. when you turn the volume up. The LIRC software expects auto-repeating hardware, so i had to modify it slightly, then recompile it. It now works fine.

Using LIRC to do stuff

There are a number of programs to actually make use of LIRC to do remote control stuff, e.g. skipping tracks in xmms

So far i have only used irxevent, this simulates X events, and can be used to simulate key presses. The following configuration file allows me to stop, skip, back, play, shuffle tracks in xmms. To start irxevent you need to tell it where the your config file is, i used the following in my .xsession file: irxevent /etc/irxevent.conf &

Note: irxevent cannot be loaded at start up time because it needs X windows to be running.

begin
        prog   = irxevent
        remote = rxut100
        button = back
        repeat = 0
        config = Key z xmms
end

begin
        prog   = irxevent
        remote = rxut100
        button = forward
        repeat = 0
        config = Key b xmms
end

begin
        prog   = irxevent
        remote = rxut100
        button = stop
        repeat = 0
        config = Key c xmms
end

begin
        prog   = irxevent
        remote = rxut100
        button = reverse
        repeat = 0
        config = Key x xmms
end

begin
        prog   = irxevent
        remote = rxut100
        button = random
        repeat = 0
        config = Key s xmms
end

There is another program irexec which allows you to execute commands upon specific button presses. This works in much the same way as irxevent.