Hardware Reference
In-Depth Information
This software is available from the Keene web site 16 and has been thoughtfully written in Java, making it
Linux-friendly. After attaching KIRA to your network and after it's used your DHCP server to provide it with an IP
address, you can add new commands. First you request that all the IR messages are sent to this machine, and then you
press Learn before hitting the first key on your remote. This should present the code, such as the following, which can
then be copied and pasted into a text file for later use:
K 240C 037F 0369 03AC 034D 0624 035A 0378 0382 0378 0381 0396 0366 0377
0382 0396 0365 0396 06E0 03AF 034C 072C 0353 0378 2000
I have used a directory hierarchy for each device so that the on/off button for my TV is in the directory ir/tv/codes/on .
Since the same button performs both functions, I created a symlink between off and on . Those with bigger houses
and more TVs might like to use a more descriptive name than TV.
Although KIRA has a web page, it isn't very configurable and limits you to four prestored IR codes. Fortunately, it
also listens for commands sent on UDP ports 30303 and 65432. The former is for device discovery and configuration,
so consequently the port cannot be changed. The latter is the IR control port, which processes all the basic commands
to control the various IR devices within range. All responses to these commands are returned by UDP also, so you
need to run two instances of the Swiss Army knife of network utility, netcat , to handle it.
Begin by creating two terminal windows, and start a UDP server in one of them by typing the following:
nc -u -l -p 30303
This will now listen on port 30303 for any UDP messages sent to it. Now, in the other window, send a message to
KIRA (whose IP has been determined as 192.168.1.111 by the DHCP server) on the same port:
echo disD | nc -q 0 -u 192.168.1.111 30303
You should see the other window spring to life and report various stats about the device. If not, check that the
ports are open and working with (that other Swiss Army knife of networking) netstat :
netstat -ntpl
With some averagely clever bash coding, you can achieve the same result with a script such as the following:
#!/bin/bash
TEMPFILE=`mktemp`
nc -u -l -p 30303 >$TEMPFILE &
PROCESS=$!
echo disD | nc -q 0 -u 192.168.1.111 30303
# Wait for a second so the output has finished writing
sleep 1
kill $PROCESS
cat $TEMPFILE
rm $TEMPFILE
3EE www.keene.co.uk/electronics/multi.php?mycode=KIRA
Search WWH ::




Custom Search