How to start irda & check it works


Forum: DSL Tips and Tricks
Topic: How to start irda & check it works
started by: Juanito

Posted by Juanito on Feb. 03 2007,15:19
I guess there are several types of serial irda (SIR) and fast irda (FIR) devices, but I believe the way to get them working under DSL will be roughly similar.

My machine has an SMC FIR chip integrated on the motherboard, but in this example it will be used in the SIR mode which emulates a serial device.

First we need to install the linux irda utilities from Debian stable (it would also be useful to install setserial but this is not strictly neccessary):

~$ sudo apt-get install irda-utils

Next load the irda modules included with DSL - note do not load a FIR chip driver (in my case smc-ircc) as it will emulate a SIR device using the standard serial driver:

~$ sudo modprobe irda
~$ sudo modprobe irport
~$ sudo modprobe irtty
~$ sudo modprobe ircomm
~$ sudo modprobe irlan
~$ sudo modprobe irnet

Check that the serial port is set to the correct settings for the your irda chip - in my case /dev/ttyS1, IRQ3 and port address 0x02f8, but yours may be on ttyS0, S2 or S3

~$ setserial /dev/ttyS1
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3

Now all that remains is to bring up the irda interface:

~$ sudo irattach /dev/ttyS1 -s

If this worked, you will see something like the following in /var/log/messages and IRQ 3 will now be present in /proc/interrupts:
~$ sudo cat /var/log/messages
...
irattach: executing: 'echo box > /proc/sys/net/irda/devname'
irattach: executing: 'echo 1 > /proc/sys/net/irda/discovery'
irattach: Starting device irda0

~$ cat /proc/interrupts
          CPU0      
...
 3:       1296          XT-PIC  serial
...

To check if everything is working, you can bring an irda device in range of your machine's irda port (in this case a P900 mobile phone) and verify you can "see" it:

dsl@box:~$ sudo irdadump
23:26:58.576826 xid:cmd c7a15201 > ffffffff S=6 s=0 (14)
23:26:58.666822 xid:cmd c7a15201 > ffffffff S=6 s=1 (14)
23:27:04.656819 xid:rsp c7a15201 < 7fab5bf6 S=6 s=0 P900 hint=9325 [ PnP PDA/Palmtop Modem Telephony IrCOMM IrOBEX ] (21)
23:27:04.666820 xid:cmd c7a15201 > ffffffff S=6 s=1 (14)
23:27:04.756819 xid:cmd c7a15201 > ffffffff S=6 s=2 (14)
<ctrl-c>

That's it - irda is up and running - now to work on using it for dial-up

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.