irattach man page

irattach — binds the Linux-IrDA stack to a IrDA port


irattach [ <dev> ] [ -s ] [ -d dongle ] [ -v ] [ -h ]


irattach binds the Linux-IrDA stack to an IrDA port. It configures the low level of the Linux-IrDA stack in the kernel. This step is usually necessary before you (or applications) can use the higher layer of the IrDA stack.

The irattach command loads the necessary Linux-IrDA driver, which configures the IrDA hardware, and configures the IrDA stack to operate on the new IrDA port. Multiple IrDA ports can be activated through multiple irattach commands.

irattach by default uses the irtty driver which connects to the Linux TTY subsystem and use the standard Linux serial driver. This works well for most machines and configurations, but limits the baud rate to 115200bps (IrDA SIR mode). The mode of operation will work with most FIR hardware (as found in laptops - they provide serial emulation) and most serial dongles (provided the proper dongle type is specified), making it a safe choice. However, USB dongles and a few FIR hardware don't support serial emulation and can't be used with the irtty driver.

irattach can also use one of the Linux FIR drivers (including USB dongle drivers) instead of the irtty driver. Most FIR drivers require proper configuration of module parameters (this is documented below). FIR drivers allow you to use higher baud rates (generally up to 4Mbps). In general, Linux FIR support is not as stable and mature, due to lack of time and documentation.

irattach must be run as root or installed setuid root, as it requires root privileges. If you have compiled the IrDA stack as modules (recommended), then you will need to edit the /etc/modules.conf file.  See the Infrared-HOWTO for details.


<dev> : this is the name of a TTY, an IrDA interface or IrDA driver. irattach decides to use the irtty driver or one of the FIR drivers based on this argument.

: starts discovery of remote IrDA devices (note that the form "-s 1" is no longer supported)
: shows version information (this happens, when no option  is given, too)
: shows help information.
-d dongle
: attaches an additional dongle driver to the IrDA port.

You need a dongle driver if you have an infrared device that connects to your computer's serial port (normal 9-pin serial port connector). These devices are called dongles, and can currently be used by any SIR driver (IrTTY or irport).  This option is not compatible with FIR drivers, and only works with the irtty and irport drivers.

The currently known (serial) dongles are:

Fir Driver Modules

If you are one of the lucky people which have a FIR chipset or USB dongle that is supported by one of the Linux-IrDA drivers, you can use irattach with the interface name of the IrDA port to configure. You will need to configure /etc/conf.modules appropriately, with at least an alias of irda0 to the driver name, or load the driver manually beforehand.

You don't strictly need to use irattach with FIR drivers, you can use modprobe to load the driver, ifconfig to bring up the interface and set the various sysctl by hand, but irattach offer a convenient way to do it.

Of course, you need to know which FIR driver applies to your hardware. You may use findchip to get information about the FIR chip. If this doesn't help, the Infrared-HOWTO shows other means to retrieve these data.

Also, you often need to configure the Linux-serial driver to ignore the IrDA port, otherwise both drivers will conflict. This can usually be done with setserial /dev/ttySx uart none.

The currently known FIR drivers are:


Attach the IrDA stack to the second serial port (integrated IrDA port using serial emulation) and start discovery:

Attach the IrDA stack to the first serial port where you have an external ACTiSYS serial dongle and start discovery:

Attach the IrDA stack to the first IrDA-USB dongle and start discovery:

Attach the IrDA stack to the NSC FIR (4Mbps) device driver on a Thinkpad laptop:

Attach the IrDA stack to the NSC FIR (4Mbps) device driver on a Thinkpad laptop:


The following hints are a very short introduction into the configuration of Linux/IrDA. If this doesn't help read the Linux/IrDA-Tutorial and/or the Infrared-HOWTO . Before configuring Linux/IrDA make sure whether you want to configure SIR or FIR. It's recommended to try SIR first, unless your device is not compatible with SIR (for example USB dongles).

To get the SIR "serial" device have a look into the BIOS. Then run dmesg | grep tty to get a survey of tty devices supported by your machine. Now try to  choose the one, which is probably the IrDA device and use irattach /dev/ttySx -s.

If you don't succeed with SIR (which seems a rare case) you may try FIR. First look up the BIOS. Then run findchip to get information about the IrDA controller chip. Use  setserial /dev/ttySx uart none to avoid conflicts with the serial driver. Note: don't use setserial if you configure SIR. Now you may use irattach.

Finally irdadump should show at least your computer itself. If it doesn't start at the beginning.

This man page deal only with the low level of the IrDA stack (IrDA ports and IrDA drivers). After this step is done, you usually need to setup your favorite application to access the high level IrDA stack (via IrCOMM, IrLPT, IrNET, IrLAN or IrSOCK), which is documented elsewhere.

This man page doesn't document the usage of the irport driver. The irport driver support the same hardware as the irtty driver, but is configured like a FIR driver.


This section currently contains the raw error messages from source code only.

"ioctl(TIOCGETD): %m"

"irattach: tty: set_disc(%d): %s"

"tcsetattr: %m"

"Failed to open %s: %m"

"Couldn't get device fd flags: %m"

"Couldn't set device to non-blocking mode: %m"



See Also

irattach(8), irdaping(8), irdadump(8), findchip(8),  irpsion5(8), modprobe(8)

Linux/IrDA Project -*- Linux/IrDA-Tutorial -*- Infrared-HOWTO -*- Infrared-Hardware-Survey


This manual page is written by Werner Heuser <>. It is based on the READMEs from irda-utils by the Linux/IrDA Project and the Linux/IrDA-Tutorial. It was subsequently updated and modified by Jean Tourrilhes <>.

Referenced By

findchip(8), irda(7), irdadump(8), irdaping(8), irnet(4), irnetd(8), irpsion5(8).

03 July 2006