TCP/IP over Infra-red on the Empeg© Amit Singh. All Rights Reserved. Written in 2001
When you think about it, there are so many strings attached to infra-red data transfer. It must be short range, must be line-of-sight, and so on. However, there are numerous benefits as well: it is reasonably high speed (up to 4 Mbps for what is called fast infra-red), it is cordless, it is not exactly limited to line of sight, there is a plethora of devices that support IR out there, and so on. Oh, and it is cool in general. With an increasing number of computers (particularly laptops) including infra-red ports today, support for IrDA has been gaining momentum. In particular, open source IrDA support for Linux is eminently usable already. Following is a diagram (click here for a bigger picture) displaying the IrDA stack.
Making two Linuces talk TCP/IP over IR
Linux 1: Sony VAIO
I have a Sony VAIO PCG-Z505 JE laptop, on which IrDA works well. The IrDA specific contents of my
/etc/modules.conf are given below.
# Sony VAIO PCG-Z505 JE (Linux 2.4.9, irda-utils-0.9.14)
pre-install nsc-ircc setserial /dev/ttyS2 port 0 irq0
alias irda0 nsc-ircc
options nsc-ircc io=0x3e8 dma=0 irq=10 dongle_id=0x09
alias tty-ldisc-11 irtty
alias char-major-161 ircomm-tty
alias char-major-10-187 irnet
Linux 2: The Empeg
I am running the Debian potato distribution on the Empeg, as described in this HOWTO. In order to use IrDA as we are going to, the following are required on the Empeg:
- A development kernel with IrDA and PPP support. I compiled my own kernel (unchanged 2.2.14 sources as provided by Rio), but I believe any appropriate kernel will do.
- The PPP package (ppp_2.3.11-1.4.deb currently for Debian-potato).
- The irda-tools package (irda-tools_0.9.5-2.deb currently).
- The irda-common package (irda-common_0.9.5-2.deb currently).
It is easiest to use SIR to get started with IrDA (which I reckon is the only way that will work on the Empeg because of its IR hardware). We shall use PPP over SIR to get TCP/IP working. Communication speed will be limited to 115200 bps. The following steps should allow you to get a minimal connection working, which you can tailor to suit your needs thereafter:
- Let us treat the "other" (Linux 1) machine as a PPP server. It
is assumed that your IR hardware is identified by the kernel and is working.
The system service "irda" must also be started (in other words, an
irattach" must be performed, like "
irattach /dev/ttyS2 -s 1" - please refer to IR documentation). Moreover, the relevant devices must exist (
- Start up
irdaon Linux 1, if it is not already started.
- Execute "
echo 1 > /proc/sys/net/irda/discovery" on Linux 1.
- Execute "
pppd /dev/ircomm0 115200 noauth x.x.x.x:y.y.y.y" on Linux 1, where
y.y.y.yare two appropriate IP addresses to be used for the Point-to-Point link that would be established (hopefully!)
- Make sure that a ppp device comes up. It is useful to have a "
tail -f" running on
/var/log/messagesall this while as a debugging aid.
- Drop to the shell on the Empeg (either through a serial connection, or by logging in if your Empeg is configured for remote logins).
- Make sure the appropriate ir devices (
/dev/ircomm0, ...) exist in
/dev. If they don't, you need to create them. One way is to do a "
tar -cpf" on Linux 1 and "
tar -xpf" it on the Empeg.
- Run "
irattach /dev/ttyS2 -s 1" on the Empeg. If things are fine, the
irda0device should come up.
- Execute "
pppd /dev/ircomm0" on the Empeg.
- Count from 1 to 5. Do an "
ifconfig -a" on the Empeg. If all went well, you should see the Point-to-Point link established and the IP addresses assigned.
- If everything is working, you can disconnect the Ethernet cable (if connected) and enjoy talking to the Empeg only over IR.
- Note that if the player software is restarted at this point, it should (can be made to) bind to the appropriate port (I think it is 8300) and listen on the newly found address. In other words, emplode/emptool should work over IR. [NB: I have yet to verify this.]
Please note that IrComm is not the only way to connect the Empeg to an IR-enabled computer, but it is the simplest. IrLAN in ad-hoc mode might be another option.