I had some time to finish the IR adapter I’ve been working on. A preview release of eiri (extended infrared interface) is available at http://sourceforge.net/project/downloading.php?group_id=261153&filename=eiri-r128-wdtv.zip.
eiri is an improved alternative to irset. It allows you to send IR commands to the WDTV GUI from the command line, thus enabling third party applications like web pages or SSH to control the WDTV GUI. Compared to irset it fixes some bugs, namely the 100% CPU utilization and it supported repeated keys (so you can hold down UP/DOWN and it is executed again without the need to press it again). Furthermore it adds a network mode that can be used to control the WDTV from a remote device over the network. The rest of this article first describes the command line interface and then the network mode.
The command line program is called
eiric and can be used to send an arbitrary sequence of commands where a command can be one of POWER, HOME, UP, LEFT, ENTER, RIGHT, DOWN, BACK, STOP, OPTION, REWIND, PLAY, PAUSE, FORWARD, PREVIOUS, NEXT, SEARCH, EJECT or a number larger than 0 that is interpreted as a wait in milliseconds. For example
# irsend UP 1000 ENTER
will emulate an UP command from the remote, then wait 1000 milliseconds (1 second) and finally send the ENTER command. It is the same as when you press the UP and ENTER keys consecutive on the remote with a delay of one second. More complex combinations are possible but always remember to put a wait between two commands because the WDTV GUI won’t be able to process most commands if they are executed without delay.
A second feature of the preview release of eiri is the network mode. the eiri daemon (eirid) starts a TCP server on port 14247 that listens for connections from clients. When you connect your client two things happen and can be done
You can send command sequences in the same way you can do with the
irsendcommand line program. The communication is done in ascii mode (No UTF-8 or other encoding) and each line must be terminated with a
ncharacter or otherwise no commands are executed. So you would send the string “UP 1000 ENTERn” to achieve the same as the
irsendcall done above.
- You are notified about any commands received from the real remote. For each command a line is send to your program in the form of 4177951108:HOME:0 where the first parameter is the IR code, the second one the alias and the third parameter the repeat count. Repeat count comes into play when the user holds a key pressed. It is increased by one each time a pressed key is resend. If another key is pressed is it reset to zero. Even when you don’t use the notifications you should still read them and flush them into the digital nirvana because otherwise it can happen that some buffer runs full and your process cannot communicate any longer with eiri.
As with all preview releases the target audience are advanced end users and developers that want to test things. The goal is to test if the application works on a broader base of devices. The application image does nothing permanently to your WDTV, so if you experience any problems simply delete the application from your USB stick.