Infrared

To use the infrared transmitter (it's located at the front, which is a rather unpractical placement IMO) it's necessary to install the irda-utils with

apt-get install irda-utils

The configuration of the irda-utils Debian package takes place in /etc/default/irda-utils and get filled in via questions asked by debconf at installation time. I use the following settings:

ENABLE="true"
DISCOVERY="true"
DEVICE="irda0"
DONGLE="none"
SETSERIAL=""

As stated in /usr/share/doc/irda-utils/README.Debian to use Fast-Infrared (FIR) it's necessary to disable the Serial-Infrared (SIR) part of the system, so I disabled loading the SIR kernel modules by adding them to /etc/hotplug/blacklist:

# ignore serial irda drivers
irtty_sir
sir_dev
irda

After that it's necessary to tell the system which kernel module to load for the irda0 device, that is done by putting the following lines into /etc/modprobe.d/irda-utils:

alias irda0 nsc-ircc
options nsc-ircc dongle_id=0x09 io=0x2f8 irq=3
install nsc-ircc /bin/setserial /dev/ttyS1 uart none port 0 irq 0; /sbin/modprobe --ignore-install nsc-ircc

The nsc-ircc kernel module needs a patch to work, see the kernel configuration page.

Stop the irda-utils with

/etc/init.d/irda-utils stop

and then make sure the SIR modules are not loaded anymore (use lsmod and if they're still loaded use rmmod to remove them). Then start the irda-utils again with

/etc/init.d/irda-utils start

The nsc-ircc module should get loaded automatically and the irattach program should be setting up the infrared device irda0. Check /var/log/syslog, it should look similar to this:

Sep 17 14:43:10 t43p kernel: pnp: Device 00:0a activated.
Sep 17 14:43:10 t43p kernel: nsc-ircc, Found chip at base=0x000
Sep 17 14:43:10 t43p kernel: nsc-ircc, driver loaded (Dag Brattli)
Sep 17 14:43:10 t43p kernel: IrDA: Registered device irda0
Sep 17 14:43:10 t43p kernel: nsc-ircc, Using dongle: IBM31T1100 or Temic TFDS6000/TFDS6500
Sep 17 14:43:10 t43p irattach: executing: 'echo t43p > /proc/sys/net/irda/devname'
Sep 17 14:43:10 t43p irattach: executing: 'echo 1 > /proc/sys/net/irda/discovery'
Sep 17 14:43:10 t43p irattach: Starting device irda0

After that it's possible for example to use infrared communication to sync a Palm PDA or to access a mobile phone via gnokii or gammu. See the Linux Infrared Howto for more information.

I actually don't like the irda-utils to be started automatically at boot time since I very seldomly use infrared communcations, so I removed the symbolic link /etc/rc2.d/S20irda-utils (because I use runlevel 2 as my default runlevel, which is the standard configuration in Debian, use the appropriate rcX.d directory for your runlevel). Instead I'm using the following script (I called it toggle_irda) to toggle the irda-port on and off:

#!/bin/sh
PIDFILE="/var/run/irattach.pid"

if [ -f $PIDFILE ]
then
/etc/init.d/irda-utils stop > /dev/null
else
/etc/init.d/irda-utils start > /dev/null
fi

It checks whether the irda-utils are currently running and either starts or stops them. The scripts gets started when pressing Fn+F8, see the Special Keys page for details.

AttachmentSize
File nsc-ircc-pnp.2.6.12.diff5.03 KB

Sections:

Comments

Anonymous's picture

Hi!,
Is necessary the infrared patch (nsc-ircc-pnp.2.6.12.diff) on kernel 2.6.16

Thanks!

Marc

Anonymous's picture

I am trying to follow your guide, but when trying to load the module i get the following error, it is an IBM T43 so i dont know why the IR chip is not found; is there any way to check for it?

FATAL: Error inserting nsc_ircc (/lib/modules/2.6.17.10/kernel/drivers/net/irda/nsc-ircc.ko): No such device

Anonymous's picture

I have an IBM T43 and i just compiled a brand new 2.6.18 Linux Kernel. Now, even tough the Kernel modules are loaded and irda-utils start correctly i am having trouble accessin my Nokia 6135.

This are the contents of my /etc/modprobe.d/irda-utils:

alias irda0 nsc-ircc
options nsc-ircc dongle_id=0x09 io=0x2f8 irq=3 dma=3
install nsc-ircc /bin/setserial /dev/ttyS1 uart none port 0 irq 0; /sbin/modprobe --ignore-install nsc-ircc

/var/log/syslog:

Sep 28 11:33:00 raziel kernel: pnp: Device 00:0b activated.
Sep 28 11:33:00 raziel kernel: nsc_ircc_pnp_probe() : From PnP, found firbase 0x2F8 ; irq 3 ; dma 3.
Sep 28 11:33:00 raziel kernel: nsc-ircc, chip->init
Sep 28 11:33:00 raziel kernel: nsc-ircc, Found chip at base=0x02e
Sep 28 11:33:00 raziel kernel: nsc-ircc, driver loaded (Dag Brattli)
Sep 28 11:33:00 raziel kernel: IrDA: Registered device irda0
Sep 28 11:33:00 raziel kernel: nsc-ircc, Using dongle: IBM31T1100 or Temic TFDS6000/TFDS6500
Sep 28 11:34:34 raziel irattach: got SIGTERM or SIGINT
Sep 28 11:34:34 raziel irattach: Stopping device irda0
Sep 28 11:34:34 raziel irattach: exiting ...
Sep 28 11:34:35 raziel irattach: executing: '/sbin/modprobe irda0'
Sep 28 11:34:35 raziel irattach: executing: 'echo raziel > /proc/sys/net/irda/devname'
Sep 28 11:34:35 raziel irattach: executing: 'echo 1 > /proc/sys/net/irda/discovery'
Sep 28 11:34:35 raziel irattach: Starting device irda0
Sep 28 11:34:35 raziel kernel: irlap_change_speed(), setting speed to 9600

But when wammu tries to find the phone (which is right in front of the left side of laptop, where the IR port supposedly is AND it has IR reception enabled):

Starting /dev/ttyS0 - ['at19200', 'at115200', 'fbusdlr3', 'fbus', 'mbus', 'fbuspl2303']
Starting /dev/ttyS1 - ['at19200', 'at115200', 'fbusdlr3', 'fbus', 'mbus', 'fbuspl2303']
Starting /dev/ttyS2 - ['at19200', 'at115200', 'fbusdlr3', 'fbus', 'mbus', 'fbuspl2303']
Scanning for bluetooth devices using PyBluez
Could not access Bluetooth subsystem (error accessing bluetooth device)
Finished /dev/ttyS0 - ['at19200', 'at115200', 'fbusdlr3', 'fbus', 'mbus', 'fbuspl2303']
Finished /dev/ttyS1 - ['at19200', 'at115200', 'fbusdlr3', 'fbus', 'mbus', 'fbuspl2303']
Finished /dev/ttyS2 - ['at19200', 'at115200', 'fbusdlr3', 'fbus', 'mbus', 'fbuspl2303']
All finished, found 0 phones

This phone does not have bluetooth so im basically out of options, ideas anyone?