Penguin
Note: You are viewing an old revision of this page. View the current version.

Linux Infrared HOWTO

Linux Infrared HOWTO

Werner Heuser

Copyright (c) 2000, 2001 by Werner Heuser

v3.3, 2001-04-22

The Infrared-HOWTO (former IR-HOWTO) provides an introduction to Linux and infrared devices and how to use the software provided by the Linux/IrDA project. This package uses IrDA(TM) compliant standards. IrDA(TM) is an industrial standard for infrared wireless communication, and most laptops made after January 1996 are equipped with an IrDA(TM) compliant infrared transceiver. Infrared ports let you communicate with printers, modems, fax machines, LANs, and other laptops. Speed ranges from 2400bps to 4Mbps.

The Linux/IrDA stack supports IrLAP, IrLMP, IrIAS, IrIAP, IrLPT, IrCOMM, IrOBEX, and IrLAN. Several of the protocols are implemented as both clients and servers. There is also support for multiple IrLAP connections, via several IrDA(TM) devices at once. The Linux/IrDA project started at the end of 1997 and its status is still experimental, so please don't expect every feature working straight. AFAIK Linux/IrDA is the only open source IrDA implementation currently available.

Remote Control (RC) via infrared is the aim of the Linux Infrared Remote Control - LIRC project, and also described in this HOWTO.

Copyright (c) 2000 Werner Heuser. For all chapters permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being "Preface" and "Credits", with the Front-Cover Texts being "Linux Infrared HOWTO", and with the Back-Cover Texts being the section "About the Document and the Author". A copy of the license is included in the section entitled "GNU Free Documentation License".

----; Table of Contents; Preface: ; 1. About the Document and the Author; 2. Status of the Document; I. IrDA: ; 1. About the Linux/IrDA Project; 2. Getting Started; 3. Specific Connections and IrDA - Protocols; 4. Hardware Supported by Linux/IrDA; 5. Advanced Topics; II. Infrared Remote Control: ; 6. Introduction; 7. Linux Infrared Remote Control - LIRC; 8. Lego Mindstorm; 9. Serial Infrared Remote Controller; 10. Infrared Tools for the COREL Netwinder PC; 11. ir; 12. irmctl; 13. IRManager; 14. irXxD; 15. gmd; 16. Infrared Remote Control - IrDA; III. Appendix: ; A. Credits; B. Revision History; C. Serial Infrared Port Sniffers; D. Infrared Light and Eye Safety; E. Copyrights, Disclaimer, Trademarks; List of Figures; 5-1. IrDA Stack----

Preface

1. About the Document and the Author

''

Better red, than dead.

Unknown !AuthorEss? ''

This document is based on the

How to use part of the Linux/IrDA project homepage and the Linux/IrDA Tutorial by Jean Tourillhes. I have also included material provided by the Linux/IrDA core team, the Linux/IrDA mailing list and other sources.

The document is included in the LINUX DOCUMENTATION PROJECT - LDP .

The latest version of this document is available at

MobiliX-HOWTOs. You may find my Linux-Mobile-Guide (the former Laptop-HOWTO), the Linux-Ecology-HOWTO and the Linux-Medicine-HOWTO there also.

Mathieu Arnold provides an earlier version of the

IR-HOWTO in French.

Please feel free to contact me for comments or questions about the HOWTO. I know this material is not finished or perfect, but I hope you find it useful anyway. For other questions and current information about Linux/IrDA please ask in the Linux/IrDA mailing list as explained below.

`Werner Heuserb


2. Status of the Document

The latest kernel I used is 2.4.2 and the latest irda-utils version is

0.9.13. I tried to check all information but I don't have all the necessary infrared hardware yet, so if something doesn't work for you, please don't blame me.

Former kernel and irda-utils versions need a completely

different setup. Since I don't recommend to use former versions, all references to these setups are removed from this document. You may find some hints in the chapter Code History.

I have included all the changes to be in sync with the 2.4.x kernel series

and the latest Linux/IrDA development now. Therefore some testing and proof-reading has still to be done. So please don't expect anything working straight out of the box.

I. IrDA; Table of Contents; 1. About the Linux/IrDA Project: ; 1.1. Project History; 1.2. Code History; 2. Getting Started: ; 2.1. Software; 2.2. Kernel; 2.3. Kernel Module Options; 2.4. Configuration; 3. Specific Connections and IrDA - Protocols: ; 3.1. Stating the IrDA Stack; 3.2. Printer Connection - IrLPT, IrTTP, IrCOMM?; 3.3. LAN Connection - IrLAN; 3.4. HP !NetBeamer? Connection; 3.5. Palm III Connection - IrCOMM; 3.6. Linux Terminal on Palm (Handspring Visor) via IR; 3.7. Psion 5 Connection; 3.8. Connecting from Linux to WinCE; 3.9. Cellular Phone Connection; 3.10. Digital Camera Connection; 3.11. Window$9x/NT and Linux/IrDA; 3.12. Linux to Linux Connection; 3.13. Multiple Instances; 3.14. Connection to Docking Station; 3.15. Connection to Keyboard; 3.16. Connection via Serial Cable; 3.17. Null Modem Cable Connection; 3.18. Peer-to-Peer Mode / Direct Mode; 3.19. Linux/IrDA with Toshiba Notebooks; 3.20. IrDA Card in a Desktop Computer; 4. Hardware Supported by Linux/IrDA: ; 4.1. Obtaining Information about the Infrared Port in Laptops; 4.2. Hardware Surveys; 4.3. Big Endian; 4.4. SMP; 4.5. IrDA Hardware; 4.6. IrDA and USB; 4.7. Linux/IrDA on PDAs; 5. Advanced Topics: ; 5.1. Troubleshooting; 5.2. Mailing List; 5.3. How to Make Infrared Light Visible; 5.4. Power Saving; 5.5. Beyond IrDA; 5.6. IrDA Network Neighborhood; 5.7. Linux/IrDA and APM; 5.8. Performance Testing; 5.9. IrDA Protocols; 5.10. Known Bugs; 5.11. FAQ----

Chapter 1. About the Linux/IrDA Project

1.1. Project History

The project started at the end of 1997 with the name Linux/IrDA. Due

to some troubles with the name IrDA, which is trademarked by the Infrared Data Association IrDA , the name was changed to Linux/IR. At the end of 1998 the the relationship between both became better and the name was changed to Linux/IrDA again. Since February 1999 the project is an official member of IrDA .

Companies and developers which are interested in joining these efforts

should contact the at Linux/IrDA Project or me at `wehe@mobilix.orgb.


1.2. Code History

The Linux/IrDA project has undertaken some changes in the program

code, which you should know to understand some possible confusions.

For 2.0.x kernels Linux/IrDA support worked in a totally other way

(only user-land programms) and is no longer supported by the Linux/IrDA project. Since 2.1.131 and 2.2.0 it is part of the kernel.

Some caveats are sometimes caused by changes of the following

parameters. I hope I have got them alright now, they confused me sometimes, too. The new style stuff works from 2.2.15 / 2.4.0.



*

the major device number of the irda device changed from 61 to 161

(as far as I remember there was also a major number 60 around, too), see the list of current device numbers below

* *

the irmanager is obsolete now,

its tasks are now achieved by irattach

* *

the device name /dev/ircomm_tty changed to /dev/ircomm-tty

* *

the device names /dev/irnine and /dev/ircomm_new are obsolet

*


Chapter 2. Getting Started

2.1. Software

The commands provided by the irda-utils package are the basic set of

tools to get a working IrDA connection. The other tools (e-Squirt, IrNET, ..) are optional. The programms don't have manpages yet. You may use my man pages instead, see MobiliX - Software.


2.1.1. IrDA-Utils

2.1.1.1. Compilation



*

Use the latest source of irda-utils available at Linux/IrDA

Project. Also recommended is the glibc library. You may find out the current version with ldd --version. The use of the older libc5 library may lead to compile errors.

* *

Untar the package with tar xvzf irda-utils`VERSIONb

. I recommend to do this in /usr/src.

* *

Do a make clean (not necessary if you

compile the package for the first time).

* *

Do a make all to build the binaries.

* *

Do a make install, this brings all

commands into the right place and installs some config files in /etc/irda.

* *

Sometimes, when you compile the IrDA stack or some various IrDA package, you may have the compiler complaining the things such as IRLMP_HINT_MASK_SET or IRDAPROTO_ULTRA are not defined. This is because of a mess related to kernel headers and the way most distributions deal with it. If you have the 2.4.X kernel source lying around, the fix is simple. Just copy the header irda.h from the kernel to your include directory cp /usr/src/linux/include/linux/irda.h /usr/include/linux

  • 

2.1.1.2. Precompiled Packages

NOKUBI Takatsugu provides an irda-utils Debian package . This package

is part of the Potato Debian release. Also Mandrake since 6.1, Redhat since 6.1 and SuSE since 6.1 contain RPM packages of the irda-utils. Some caveat with precompiled packages might be some incompatibilities between kernel version and appropriate package version.


2.1.1.3. Contents of Linux/IrDA-Utils2.1.1.3.1. irattach

irattach uses the module set as

parameter; it can be a specific FIR driver: irattach toshoboe or ircomm (and then it loads the module aliased as "irda0" in /etc/modules.conf)

If you are one of the lucky people which have a FIR chipset that is

supported, then you don't need to use irattach anymore. Now you just have to modprobe the driver.

----2.1.1.3.2. irdadump

A program that displays all the frames sent, and received on the

infrared link.

One advantage of implementing IrDA device drivers as network device

drivers is that you should be able to attach sniffers to the device (or actually the packet type). That way, it is possible to use a really handy utility called irdadump (instead of tcpdump). This will make debugging MUCH easier. Linux-2.2 implements the BPF (Berkeley Packet Filter), so its possible to filter out exactly the frames you want to see.

Note: You probably have to be root for using irdadump . CONFIG_PACKET

has to be enabled in the kernel. If compiled as a module you might load the module manually. irdadump has been converted into a library, so it can be used from GUI applications as well.

Here is a sample output of a small session between Linux and a Palm

III. This log shows that the local irobex layer is not responding, so the Palm III sends a disc frame.

dagbnb /home/dagb/linux/irda-utils/irdadump/ # ./irdadump 20:18:15.305711 xid:cmd:saddr=0x05c589 b daddr=0xffffffff,S=6,s=0 20:18:15.385597 xid:cmd:saddr=0x05c589 b daddr=0xffffffff,S=6,s=1 20:18:15.465568 xid:cmd:saddr=0x05c589 b daddr=0xffffffff,S=6,s=2 20:18:15.545953 xid:cmd:saddr=0x05c589 b daddr=0xffffffff,S=6,s=3 20:18:15.625574 xid:cmd:saddr=0x05c589 b daddr=0xffffffff,S=6,s=4 20:18:15.705575 xid:cmd:saddr=0x05c589 b daddr=0xffffffff,S=6,s=5 20:18:15.785601 xid:cmd:saddr=0x05c589 b daddr=0xffffffff,S=6,s=255,info=Linux 20:18:18.075526 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=0 20:18:18.225498 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=1 20:18:18.375495 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=2 20:18:18.526355 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=3 20:18:18.675614 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=4 20:18:18.676364 xid:rsp:saddr=0x05c589 b daddr=0xb50c14b,S=6,s=4 20:18:18.765506 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=5 20:18:18.927221 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=255,info=Palm III 20:18:18.975796 snrm:cmd,ca=0xfe,pf=1 20:18:18.976534 ua:rsp,ca=0x58,pf=1 20:18:18.977145 ua:rsp,ca=0x58,pf=1 20:18:19.585627 rr:rsp,ca=0x58,nr=0,pf=1 20:18:19.585810 rr:rsp,ca=0x58,nr=0,pf=1 20:18:19.606413 i:cmd,ca=0x58,nr=0,ns=0,pf=1 20:18:19.606582 rr:rsp,ca=0x58,nr=1,pf=1 20:18:19.627708 rr:cmd,ca=0x58,nr=0,pf=1 20:18:19.627871 i:rsp,ca=0x58,nr=1,ns=0,pf=1 20:18:19.650571 disc:cmd,ca=0x58,pf=1 20:18:19.650736 ua:rsp,ca=0x58,pf=1 20:18:21.165524 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=0 20:18:21.315608 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=1 20:18:21.315793 xid:rsp:saddr=0x05c589 b daddr=0xb50c14b,S=6,s=1 20:18:21.395499 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=2 20:18:21.545516 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=3 20:18:21.695500 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=4 20:18:21.845840 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=5 20:18:22.007222 xid:cmd:saddr=0xb50c14b b daddr=0xffffffff,S=6,s=255,info=Palm III 20:18:22.056143 snrm:cmd,ca=0xfe,pf=1 20:18:22.056310 ua:rsp,ca=0xc8,pf=1 20:18:22.056381 ua:rsp,ca=0xc8,pf=1 37 pacckets received by filter

----2.1.1.3.3. irdaping

Makes it possible to try and ping a remote device using IrDA test

frames. Not all devices implements support for test frames. This is a program similar to ping(8). It sends IrDA test frames (added some userdata which contains the frame number and the time the frame was sent). You can also change the size of the frame by using the -s option. You must supply an IrDA device address, and not an IP address. You have to be able to get that device address by using irdadump.

Here is one output sample (pinging an ACTiSYS IR-100M):

dagbnb /home/dagb/linux/irda-utils/irdaping/ # ./irdaping 0xf7be8388 IrDA ping (0xf7be8388): 32 bytes 32 bytes from 0xf7be8388: irda_seq=0 time=102.466003 ms. 32 bytes from 0xf7be8388: irda_seq=1 time=102.202003 ms. 32 bytes from 0xf7be8388: irda_seq=2 time=102.170998 ms. 32 bytes from 0xf7be8388: irda_seq=3 time=101.633003 ms. 4 packets received by filter

From : Christian Gennerat I use an alias which does not use any parameter (in $HOME/.bashrc): alias irping="irdaping \`grep daddr /proc/net/irda/discovery|sed s/.*daddr://\`" It works fine when there is only one discovered client.

----2.1.1.3.4. irkbd

Implements support for the mouse and keyboard protocol as used by the

Tekram IR-660 infrared docking station.

----2.1.1.3.5. findchip

Tries to find out which FIR IrDA chipset your machine is using. Try

out findchip -v to check it out. For other methods to detect the chipset see below.

----2.1.1.3.6. irsockets

A collection of programs which uses IrDA sockets.

----2.1.1.3.7. irpsion5

File transfer program for exchanging files with your Psion PDA.

----2.1.1.3.8. /etc/irda

Configuration files, e.g. contain the serial port of the SIR driver.

For first testing you should configure the SIR IrDA driver.


2.1.2. openobex

The overall goal of the

OpenOBEX project is to make an open source implementation of the Object Exchange (OBEX) protocol. OBEX is a session protocol and can best be described as a binary HTTP protocol. A typical application is the "beam" function of PalmOS.


2.1.3. e-squirt

e-Squirt is a simple protocol for sending URLs over the IrDA medium.

This allows for interaction with !CoolTown? enabled devices.


2.1.4. IrNET for Linux-IrDA

IrNET

is a protocol allowing to carry TCP/IP traffic between two IrDA peers in an efficient fashion. It is a thin layer, passing PPP packets in a IrTTP socket. It uses PPP in synchronous mode for efficiency, and offers lots of flexibility and various features. The main part of IrNET in included in kernel 2.4.x, and a user-space daemon (to automate connections) is available on the web page.


2.1.5. Java - IrDA Interface

This

Java Infrared Socket API provides a way of communicating through infrared medium on a linux machine using Java. Thus, Java application developers can develop applications involving infrared access much easily. The API is very similar to java.net.Socket API and has been implemented using the Linux infrared stack. Both connection oriented streams (!IrSocket? and !IrServerSocket?) and connectionless Ultra (!UltraSocket?, !UltraPacket?) interfaces are available.


2.2. Kernel

2.2.1. Preface

Please read the Kernel-HOWTO to get more information about the

compilation process. Get the latest patches from http://irda.sourceforge.net or the Linux/IrDA mailing list archiv.

You'll find the Linux/IrDA code in:

/usr/src/linux/net/irda (protocol stuff)

/usr/src/linux/drivers/net/irda (device drivers)

/usr/src/linux/include/net/irda (header files)

General Parameters Make sure you use kernel 2.4.x sources. If unsure about your kernel version try uname -r.

Get the latest kernel patch from the Linux/IrDA project . Or from the

Alan Cox kernel series . Put it into /usr/src or where else your kernel sources live and apply something like (replace patch-2_2.0-irdaXXX with the actual file name):

cd /usr/src tar xvzf patch-2_2.0-irdaXXX.tar.gz cd linux patch -p1 -l ` ../patch-2_2.0-irdaXXX For latest drivers maybe experimental support has to be enabled CONFIG_EXPERIMENTAL.

Enable sysctl in "General Setup" CONFIG_SYSCTL.

You should have proc file system support CONFIG_PROC_FS.

Also serial support for the SIR features CONFIG_SERIAL.

I am not sure whether there has to be printer support for using a

printer with Linux/IrDA CONFIG_PRINTER. But I assume this feature is not necessary.

Networking support must be enabled CONFIG_NET.

Make sure you have module support CONFIG_MODULES in your kernel! Test

it e.g. with lsmod.

Also kerneld support CONFIG_KERNELD. But kmod (CONFIG_KMOD) also

works. A monolithic kernel seems to work, too. But modules are highly recommended!

To use irdadump you probably have to set CONFIG_PACKET.

If you only apply the Linux/IrDA patch, you should not have to do a

make clean, so that should save you some time. I suggest you do

something like this
__make dep 88 make all 88 make modules

88 make install 88 make modules_install__ If you get really strange errors, then try to rebuild from scratch after a make clean.


2.2.2. IrDA Specific Parameters

The following is from ../linux-2.4.3/Documentation/Configure.help

Please consult the latest available kernel documentation for current information and new drivers.


2.2.2.1. IrDA subsystem support

CONFIG_IRDA Say Y here if you want to build support for the IrDA (TM) protocols. The Infrared Data Associations (tm) specifies standards for wireless infrared communication and is supported by most laptops and PDA's.

To use Linux support for the IrDA (tm) protocols, you will also need

some user-space utilities like the irmanager and probably irattach as well. For more information, see the file Documentation/networking/irda.txt. You also want to read the IR-HOWTO, available at http://www.linuxdoc.org/docs.html#howto .

This support is also available as a module called irda.o. If you

want to compile it as a module, say M here and read Documentation/modules.txt.

IrDA Cache last LSAP

CONFIG_IRDA_CACHE_LAST_LSAP Say Y here if you want IrLMP to cache the last LSAP used. This makes sense since most frames will be sent/received on the same connection. Enabling this option will save a hash-lookup per frame.

If unsure, say Y.

IrDA Fast RR's

CONFIG_IRDA_FAST_RR Say Y here is you want IrLAP to send fast RR (Receive Ready) frames when acting as a primary station. This will make IrLAP send out a RR frame immediately when receiving a frame if its own transmit queue is currently empty. This will give a lot of speed improvement when receiving much data since the secondary station will not have to wait the max. turn around time before it is allowed to transmit the next time. If the transmit queue of the secondary is also empty the primary will back off waiting longer for sending out the RR frame until the timeout reaches the normal value. Enabling this option will make the IR-diode burn more power and thus reduce your battery life.

If unsure, say N.

IrDA Debug

CONFIG_IRDA_DEBUG Say Y here if you want the IrDA subsystem to write debug information to your syslog. You can change the debug level in /proc/sys/net/irda/debug

If unsure, say Y (since it makes it easier to find the bugs).

IrLAP Compression support

CONFIG_IRDA_COMPRESSION Compression is not part of the IrDA(tm) protocol specification, but it's working great! Linux is the first to try out compression support at the IrLAP layer. This means that you will only benefit from compression if you are running a Linux `-b Linux configuration.

If you say Y here, you also need to say Y or M to a compression

protocol below.

IrLAP Deflate Compression Protocol (EXPERIMENTAL)

CONFIG_IRDA_DEFLATE Say Y here if you want to build support for the Deflate compression protocol. The deflate compression (GZIP) is exactly the same as the one used by the PPP protocol.

If you want to compile this compression support as a module, say M

here and read Documentation/modules.txt. The module will be called irda_deflate.o.

IrLAN Protocol

CONFIG_IRLAN Say Y here if you want to build support for the IrLAN protocol. If you want to compile it as a module (irlan.o), say M here and read Documentation/modules.txt. IrLAN emulates an Ethernet and makes it possible to put up a wireless LAN using infrared beams.

The IrLAN protocol can be used to talk with infrared access points

like the HP NetbeamIR, or the ESI !JetEye? NET. You can also connect to another Linux machine running the IrLAN protocol for ad-hoc networking!

IrCOMM Protocol

CONFIG_IRCOMM Say Y here if you want to build support for the IrCOMM protocol. If you want to compile it as a module (you will get ircomm.o and ircomm-tty.o), say M here and read Documentation/modules.txt. IrCOMM implements serial port emulation, and makes it possible to use all existing applications that understands TTY's with an infrared link. Thus you should be able to use application like PPP, minicom and others. Enabling this option will create two modules called ircomm and ircomm-tty.


2.2.2.2. Device Drivers

IrTTY IrDA Device Driver

CONFIG_IRTTY_SIR Say Y here if you want to build support for the IrTTY line discipline. If you want to compile it as a module (irtty.o), say M here and read Documentation/modules.txt. IrTTY makes it possible to use Linux's own serial driver for all IrDA ports that are 16550 compatible. Most IrDA chips are 16550 compatible so you should probably say Y to this option. Using IrTTY will however limit the speed of the connection to 115200 bps (IrDA SIR mode)

If unsure, say Y.

IrPORT IrDA Device Driver

CONFIG_IRPORT_SIR Say Y here if you want to build support for the IrPORT IrDA device driver. If you want to compile it as a module (irport.o), say M here and read Documentation/modules.txt. IrPORT can be used instead of IrTTY and sometimes this can be better. One example is if your IrDA port does not have echo-canceling, which will work OK with IrPORT since this driver is working in half-duplex mode only. You don't need to use irattach with IrPORT, but you just insert it the same way as FIR drivers (insmod irport io=0x3e8 irq=11). Notice that IrPORT is a SIR device driver which means that speed is limited to 115200 bps.

If unsure, say Y.

Winbond W83977AF IrDA Device Driver

CONFIG_WINBOND_FIR Say Y here if you want to build IrDA support for the Winbond W83977AF super-io chipset. This driver should be used for the IrDA chipset in the Corel !NetWinder?. The driver supports SIR, MIR and FIR (4Mbps) speeds.

If you want to compile it as a module, say M here and read

Documentation/modules.txt. The module will be called w83977af_ir.o.

NSC PC87108 IrDA Device Driver

CONFIG_NSC_FIR Say Y here if you want to build support for the NSC PC87108 and PC87338 IrDA chipsets. This driver supports SIR, MIR and FIR (4Mbps) speeds.

If you want to compile it as a module, say M here and read

Documentation/modules.txt. The module will be called nsc-ircc.o.

Toshiba Type-O IR Port Device Driver

CONFIG_TOSHIBA_FIR Say Y here if you want to build support for the Toshiba Type-O IR chipset. This chipset is used by the Toshiba Libretto 100CT, and many more laptops. If you want to compile it as a module, say M here and read Documentation/modules.txt. The module will be called toshoboe.o.

SMC IrCC (Experimental)

CONFIG_SMC_IRCC_FIR Say Y here if you want to build support for the SMC Infrared Communications Controller. It is used in the Fujitsu Lifebook 635t and Sony PCG-505TX. If you want to compile it as a module, say M here and read Documentation/modules.txt. The module will be called smc-ircc.o.

ALi M5123 FIR Controller Driver (Experimental)

CONFIG_ALI_FIR Say Y here if you want to build support for the ALi M5123 FIR Controller. The ALi M5123 FIR Controller is embedded in ALi M1543C, M1535, M1535D, M1535+, M1535D Sourth Bridge. This driver supports SIR, MIR and FIR (4Mbps) speeds.

If you want to compile it as a module, say M here and read

Documentation/modules.txt. The module will be called ali-ircc.o.

Serial dongle support

CONFIG_DONGLE Say Y here if you have an infrared device that connects to your computer's serial port. These devices are called dongles. Then say Y or M to the driver for your particular dongle below.

Note that the answer to this question won't directly affect the

kernel: saying N will just cause this configure script to skip all

ESI !JetEye? PC Dongle

CONFIG_ESI_DONGLE Say Y here if you want to build support for the Extended Systems

JetEye? PC dongle. If you want to compile it as a module, say M here

and read Documentation/modules.txt. The ESI dongle attaches to the normal 9-pin serial port connector, and can currently only be used by IrTTY. To activate support for ESI dongles you will have to start irattach like this: irattach -d esi.

ACTiSYS IR-220L and IR220L+ dongle

CONFIG_ACTISYS_DONGLE Say Y here if you want to build support for the ACTiSYS IR-220L and IR220L+ dongles. If you want to compile it as a module, say M here and read Documentation/modules.txt. The ACTiSYS dongles attaches to the normal 9-pin serial port connector, and can currently only be used by IrTTY. To activate support for ACTiSYS dongles you will have to start irattach like this: irattach -d actisys or irattach -d actisys+.

Tekram !IrMate? 210B dongle

CONFIG_TEKRAM_DONGLE Say Y here if you want to build support for the Tekram !IrMate? 210B dongle. If you want to compile it as a module, say M here and read Documentation/modules.txt. The Tekram dongle attaches to the normal 9-pin serial port connector, and can currently only be used by IrTTY. To activate support for Tekram dongles you will have to start irattach like this: irattach -d tekram.

Greenwich GIrBIL dongle

CONFIG_GIRBIL_DONGLE Say Y here if you want to build support for the Greenwich GIrBIL dongle. If you want to compile it as a module, say M here and read Documentation/modules.txt. The Greenwich dongle attaches to the normal 9-pin serial port connector, and can currently only be used by IrTTY. To activate support for Greenwich dongles you will have to insert irattach -d girbil in the /etc/irda/drivers script.

Parallax Litelink dongle

CONFIG_LITELINK_DONGLE Say Y here if you want to build support for the Parallax Litelink dongle. If you want to compile it as a module, say M here and read Documentation/modules.txt. The Parallax dongle attaches to the normal 9-pin serial port connector, and can currently only be used by IrTTY. To activate support for Parallax dongles you will have to start irattach like this irattach -d litelink.

Old Belkin dongle

CONFIG_OLD_BELKIN_DONGLE Say Y here if you want to build support for the Adaptec Airport 1000 and 2000 dongles. If you want to compile it as a module, say M here and read Documentation/modules.txt. The module will be called old_belkin.o. Some information is contained in the comments at the top of drivers/net/irda/old_belkin.c.


2.2.3. Current Kernel Patches

Note: donauboe is a new version of

toshoboe better FIR support and compatibility with Donauoboe chip http://libxg.free.fr/lib-irda.html

For USB dongle patch see Linux/IrDA mailing list archiv.


2.3. Kernel Module Options

This survey of module options was generated with

the modinfo command.

 actisys.o Dag Brattli `dagb@cs.uit.nob - Jean Tourrilhes `jt@hpl.hp.comb ACTiSYS IR-220L and IR-220L+ dongle driver ali-ircc.o Benjamin Kong `benjamin_kong@ali.com.twb ALi FIR Controller Driver io int array (min = 1, max = 4), description "Base I/O addresses" irq int array (min = 1, max = 4), description "IRQ lines" dma int array (min = 1, max = 4), description "DMA channels" esi.o Dag Brattli `dagb@cs.uit.nob Extended Systems !JetEye? PC dongle driver girbil.o Dag Brattli `dagb@cs.uit.nob Greenwich GIrBIL dongle driver irport.o Dag Brattli `dagb@cs.uit.nob Half duplex serial driver for IrDA SIR mode io int array (min = 1, max = 4), description "Base I/O adresses" irq int array (min = 1, max = 4), description "IRQ lines" irtty.o Dag Brattli `dagb@cs.uit.nob IrDA TTY device driver qos_mtt_bits int, description "Minimum Turn Time" litelink.o Dag Brattli `dagb@cs.uit.nob Parallax Litelink dongle driver nsc-ircc.o Dag Brattli `dagb@cs.uit.nob NSC IrDA Device Driver qos_mtt_bits int, description "Minimum Turn Time" io int array (min = 1, max = 4), description "Base I/O addresses" irq int array (min = 1, max = 4), description "IRQ lines" dma int array (min = 1, max = 4), description "DMA channels" dongle_id int, description "Type-id of used dongle" old_belkin.o Jean Tourrilhes `jt@hpl.hp.comb Belkin (old) !SmartBeam? dongle driver smc-ircc.o Thomas Davis `tadavis@jps.netb SMC IrCC controller driver ircc_dma int, description "DMA channel" ircc_irq int, description "IRQ line" tekram.o Dag Brattli `dagb@cs.uit.nob Tekram !IrMate? IR-210B dongle driver toshoboe.o James !McKenzie? `james@fishsoup.dhs.orgb Toshiba OBOE IrDA Device Driver max_baud int w83977af_ir.o Dag Brattli `dagb@cs.uit.nob Winbond W83977AF IrDA Device Driver qos_mtt_bits int, description "Mimimum Turn Time" io int array (min = 1, max = 4), description "Base I/O addresses" irq int array (min = 1, max = 4), description "IRQ lines" irda.o Dag Brattli `dagb@cs.uit.nob The Linux IrDA Protocol Subsystem irda_debug_R07c03e02 long irlan.o Dag Brattli `dagb@cs.uit.nob The Linux IrDA LAN protocol eth int, description "Name devices ethX (0) or irlanX (1)" access int, description "Access type DIRECT=1, PEER=2, HOSTED=3" ircomm-tty.o Dag Brattli `dagb@cs.uit.nob IrCOMM serial TTY driver ircomm.o Dag Brattli `dag@brattli.netb IrCOMM protocol irnet.o `noneb `noneb


2.4. Configuration

2.4.1. Device Numbers

 mknod /dev/ircomm0 c 161 0 mknod /dev/ircomm1 c 161 1 mknod /dev/irlpt0 c 161 16 mknod /dev/irlpt1 c 161 17 mknod /dev/irnet c 10 187 chmod 666 /dev/ir* There might be some other device number necessary if you want to use the irkbd features. You may find the latest device numbers in ../src/linux/Documentation/devices.txt.


2.4.2. Device Arrangement

First you should put your IrDA devices in range. Though it might be

possible that the Linux/IrDA service detects every new device automagically I only have good experience with the devices in range during the configuration process.

Keep your infrared devices together in a range below one meter and an

angle of 30 degree. There has to be a direct line of sight between them. If this is not possible, you may use a mirror (an unused M$ CD should work quite good).


2.4.3. /etc/modules.conf

Add the following lines to your /etc/conf.modules file:

  1. IrDA over a normal serial port, or a serial port compatible IrDA port

alias tty-ldisc-11 irtty

  1. IrCOMM (for printing, PPP, Minicom etc)

alias char-major-161 ircomm-tty # if you want IrCOMM support

  1. IRLAN

alias irlan0 irlan

  1. To be able to attach some serial dongles
  2. These values are hard-coded in irattach (not instance order)

alias irda-dongle-0 tekram # Tekram !IrMate? IR-210B alias irda-dongle-1 esi # ESI !JetEye? alias irda-dongle-2 actisys # Actisys IR-220L alias irda-dongle-3 actisys # Actisys IR-220L+ alias irda-dongle-4 girbil # Greenwich GIrBIL alias irda-dongle-5 litelink # Parallax !LiteLink? alias irda-dongle-6 airport # Adaptec Airport 1000 and 2000

  1. To use the FIR driver. This applies only to the specific device!!!
  2. options nsc-ircc dongle_id=0x09 # NSC driver on a IBM Thinkpad laptop
  3. options nsc-ircc dongle_id=0x08 # HP Omnibook 6000
  4. alias irda0 nsc-ircc
  5. alias irda0 smc-ircc
  6. IrNET module...

alias char-major-10-187 irnet # Official allocation of IrNET Then do a depmod -a to update, and then all IrDA modules should be automagically loaded when you need them. Note for testing reasons you may load them manually, but please make sure not to load them twice. There might be some other entries necessary, if you want to use the irkbd features or an USB dongle. A template file is included into the irda-utils package.


2.4.4. /etc/irda

Have a look into the files in /etc/irda.

Edit them to reflect your setup.


2.4.5. BIOS Configuration

Make sure your infrared port is enabled in the BIOS and check what

interrupt and port address it uses. With some laptops it seems necessary to have Window$x installed to be able to set BIOS parameters.

I have got reports, that connected to a docking station the infrared

port was disabled.


2.4.6. Serial Port (setserial)

To avoid some conflicts with serial devices you should do

setserial /dev/ttyS1 uart none. Choose the ttySx according to your SIR port. Hint: dmesg | grep tty.

From Florian Lohoff You should also set "port 0x0 irq 0" otherwise you will see interesting effects if there is suddenly a different S1 e.g. by inserting a modem PCMCIA card. The serial driver will then touch the OLD ports without having acquired those which will cause the irda stuff to die/hang. This is a bug i havent been able to find in the serial driver but it definitly exists (Put a printk into the serial_out serial_in stuff).


2.4.7. Starting IrDA

Most important, you must sync your disks!!! Maybe you have to reboot

your machine. Have you read the disclaimer?

There are three sorts of low level drivers: SIR, dongle and FIR. To

start with Linux/IrDA I recommend to use the SIR method.

Load the modules modprobe irda irtty.

irattach /dev/ttyS1 -s 1 to attach the IrDA device to the IrDA services. Check lsmod and dmesg.

irdadump should show all available

IrDA devices in range now. Hint: If you are connecting different Linux boxes, you may use hostname YOUR_HOSTNAME to set a unique hostname for each computer.

On the "server" side do pppd /dev/ircomm0 LOCAL_IP:REMOTE_IP On the

"client" side do pppd /dev/ircomm0 .

You may now test the connection with ping. And use

all sorts of networking connections (ssh, NFS, ...) now.


Chapter 3. Specific Connections and IrDA - Protocols

3.1. Stating the IrDA Stack

There are three sorts of low level drivers: SIR, dongle and FIR. If

the right driver is detected by the kernel you get a message like:


3.1.1. SIR



*

Try to find out which serial port is used by the IR device. You

may do so by watching the output of dmesg. If serial support is modularized do an modprobe serial first. Look for an entry like:

Serial driver version 4.25 with no serial options enabled ttyS00 at 0x03f8 (irq = 4) is a 16550A #first serial port /dev/ttyS0 ttyS01 at 0x3000 (irq = 10) is a 16550A #e.g. infrared port ttyS02 at 0x0300 (irq = 3) is a 16550A #e.g. PCMCIA modem port If this is not the case, you either don't have infrared support enabled in the BIOS or the SIR mode of your infrared device is not detected by the kernel. Currently I know only two laptop models with this effect, the HP !OmniBook? 800 and the Toshiba Libretto models. I am not sure whether PnP support effects the detection of the IR port. If you are unsure try it out and let me know the results. Maybe you can use FIR mode if SIR doesn't work.

* *

In some situations you may have to use

setserial /dev/ttyS`0-2b port 0xNNNN irq M to set the values for your infrared serial port, especially if the infrared port is a separate serial line. You usually don't need to change the values! For further information look into the FAQ section below.

* *

If you don't use kerneld or

kmod insert the irda module with modprobe irda.

* *

Do lsmod. It should show the modules irda and irtty now.

* *

A look into /var/log/messages should show the entry "Serial

connection established" now.

* *

Give irattach some time, e.g.

seven seconds, to detect other IR devices. Then watch the output from the kernel that you will hopefully get in /var/log/messages. It should look like the following (I removed some lines, which were not related to Linux/IrDA):

Jan 2 12:57:26 japh kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A Jan 2 12:57:26 japh kernel: ttyS02 at 0x03e8 (irq = 4) is a 16550A Jan 2 12:57:26 japh kernel: Linux Support for the IrDA (tm) protocols (Dag Bra ttli) Jan 2 12:59:09 japh syslog: executing: 'echo 1 b /proc/sys/net/irda/discovery' Jan 2 12:59:09 japh syslog: Setting discovery to 1 exited with status 1 Jan 2 12:59:09 japh syslog: + 0.1 Fri Jul 25 11:45:26 1997 Dag Brattli Jan 2 12:59:09 japh syslog: + 0.1 Fri Jul 25 11:45:26 1997 Dag Brattli Jan 2 12:59:09 japh syslog: Serial connection established. Jan 2 12:59:09 japh kernel: IrDA irda_device irda0 registered. Jan 2 13:01:22 japh syslog: executing: './drivers start ' Jan 2 13:01:22 japh syslog: Serial connection established. Jan 2 13:01:42 japh syslogd: Printing partial message Jan 2 13:01:42 japh 0.1 Fri Jul 25 11:45:26 1997 Dag Brattli Jan 2 13:02:49 japh kernel: IrDA Discovered: japh Jan 2 13:02:49 japh kernel: Services: Computer

* *

Even more information you can get with

cat /proc/net/irda/discovery .

  • 

3.1.2. Dongle Connection - Infrared Adapters for the Serial Port

The currently supported dongles are the Extended Systems Inc. ESI-9680

JetEye?, the Tekram IRmate 210B, the ACTiSYS IR220L and 220L+, the

Greenwich GIrBIL. dongle.

Dag Brattli wrote (modified by wh): "To use dongles you have to do

something like this:

modprobe tekram # or esi or actisys irattach -d tekram # or -d esi or -d actisys modprobe is not necessary, if /etc/modules.conf is correct. As you can see, you must still use the -d option with irattach since it is possible to have two serial ports using different dongles at the same time (so the tty you are binding must know which dongle it is supposed to use). So if you have two dongles and two serial ports, you could do something like this:

modprobe tekram modprobe esi irattach /dev/ttyS0 -d esi 8 irattach /dev/ttyS1 -d tekram 8 PS: I would not try to turn the two dongles against each other, since I really don't know how the stack would react :-) ... Since I don't have any of these new ACTiSYS 220L+ dongles, I'm not able to test it. Since the new dongle has support for one extra speed (38400bps), you must specify the dongles differently with irattach so that the kernel knows which dongle you are using (and what QoS can be used):

irattach /dev/ttyS0 -d actisys # for the 220L dongle irattach /dev/ttyS0 -d actisys+ # for the 220L+ dongle The current implementation of dongle support does not have any state associated with it, so its not possible to use both ACTiSYS dongles (220L and 220L+) at the same time (connected to two serial ports) for now. If someone needs to be able to do so, please mail me (Dag Brattli) and I will think about it!"

Note: When I tried to use an infrared modem (Swissmod 56Ki,

manufactured by Telelink AG) connected to my laptop (IrDA works with Window$95 only, due to non standard hardware) I had to remove the infrared support in the BIOS to get it working!

Dag Brattli: "It is now possible to use

irport instead of irtty! I have moved all the dongle stuff out of irtty and into irda_device, so it will also be possible to attach dongles to irport. Need however to make a small user-space utility dongle_attach that can be used to attach dongles to a specific driver instance. BTW: irattach is still working as before, and you will not notice the difference even when attaching dongles to irtty (I've just redirected the dongle ioctl to irda_device). Irport may be interesting since you avoid one software interrupt (bh) level, and it's also forced to work in half duplex mode so you don't get any echo if the irda port itself don't have echo-cancellation (girbil dongle and HP-4000 etc) ... To use it, you must supply the parameters to modprobe like this: modprobe irport io=0x3f8 irq=4, or whichever values you use. You can also add these parameters to /etc/conf.modules like this: options irport io=0x3f8 irq=4, but then you must remember to do a depmod -a and use modprobe irport instead of modprobe."

Alvin Loh: "Anyone with a ESI 9680C can use both parallax's and ESI's

signalling scheme, meaning they can use Parallax's driver with ESI9680C to work. "


3.1.3. Dongle Connection - Infrared Motherboard Adapter

Support for the ACTiSYS IR2000 dongle has been implemented in a file

called pc87108 which you can either compile into the kernel or modprobe pc87108 to insert the module or insert modprobe pc87108 into the /etc/irda/drivers file (I think).

From James I have this description about setting

up the hardware: There are two configurations, a five pin in line connector and a 6 pin DIL (at the end of a 18 pin DIL header). Basically any IrDA conpatible transceiver will work (I have a stack of old IRM3001 these are now obselete) you need to hook a capacitor (use a tantalum about 1uF) between 5V and 0V near the transceiver and then connect everthing else up (RX-bRX, TX-bTX, 5V-b5V, and 0V-0V). If you don't like soldering irons, lots of companies do sell IR modules for the 5 pin connectors that fit into a hole in your case.


3.1.4. Fast !InfraRed? (FIR)

The IrDA(TM) standard knows three kinds of speeds:

*

SIR = Standard IrDA, up to 115kbps IrDA,

* *

MIR = Medium Speed IrDA,

* *

FIR = Fast IrDA (4Mbps),

* *

VFIR = Very Fast IrDA(16Mbps), seems to become a future standard

  • 

    Up to 115.200bps (SIR) many (probably all) infrared controllers work

like a serial port and use a RZI (return to zero, inverted) modulation. Not every infrared controller supports 4Mps (FIR), up to 4Mbps they have to use 4PPM (4 pulse position) modulation technique. Currently there are two FIR chips supported: !NationalSemiConductor? NSC PC87108 e.g. used in IBM Thinkpad 560X and Winbond W83977AF (IR) FIR chip e.g. used in the Corel Netwinder PC. You may start the FIR service by loading the according module. Linux/IrDA will probe your hardware then. More drivers are under development.

So what speeds can you expect? Using SIR, you should be able to get

about 10 Kbytes/s. Using FIR (4Mbps) you can get over 300 Kbytes/s (if you are lucky).


3.2. Printer Connection - IrLPT, IrTTP, IrCOMM?

IrLPT seems to be replaced by IrCOMM. Sorry I don't have

tested this yet. So this is only the remaining part from former IrLPT support. Please see mailing list archive for further information.



*

Edit /etc/conf.modules, as described above.

* *

Remove any current print jobs with lprm "*".

* *

Run depmod -a .

* *

(If you don't use kerneld do a modprobe irtty. Probably obsolet.)

* *

su to root, and do mknod /dev/irlpt0 c 161 10.

Note: Something like ./MAKEDEV irlpt0 is not possible yet.

* *

Try to write a small file to /dev/irlpt0 by cat FILE b/dev/irlpt0

(do not wonder about a bad format this is just a first check). For me this didn't always work, but I couldn't find out why not.

* *

The better way is to change your /etc/printcap to use /dev/irlpt0

in addition or instead of /dev/lp1. See Printing-HOWTO for detailed information.

* *

For easy printer setup you may use a printing software like

APSFILTER, !MagicFilter? EZ-Magic (with !RedHat there should also be a GUI for this purpose). Make a copy of /etc/printcap before.

* *

Example for APSFILTER with a HP 6P (non-postscript, HP 6MP is with

postscript). The two relevant questions are: "Do you have a (s)serial or a (p)arallel printer interface?" Answer "p" "What's the device name for your parallel printer interface?" Answer "/dev/irlpt0"

* *

Restart the print daemon with kill -HUP `PID of lpdb. If you use

another print daemon choose the according command.

* *

Watch whether the connection indicator of your printer shows

activity, e.g. the green light above the IR port of a HP 6P/MP comes on (lower left hand corner, near the paper tray).

* *

I couldn't get to manage printjobs larger than approximately 10

pages yet. But maybe this depends on the memory size of my hardware, which is 16MB. There seems to be a problem with the software too, Thomas Davis wrote: "I will ... limit the irlpt, so it won't eat memory when you send a large print file.".

  • 

    Takahide Higuchi reported: " I have been debugging IrCOMM with a

printer ( Canon BJC-80v ) with IrDA port and IrCOMM protocol (not IrLPT). I can print a short e-mail text though, it easily causes dead lock when I try to print a postscript with gs."

From the page of Thomas Davis http://www.jps.net/tadavis/irda : To use

the IrLPT server, you need to perform the following steps:

/sbin/modprobe irlpt_server /sbin/mknod /dev/irlptd c 10 `grep irlptd /proc/misc|cut -f 1` At this point, the IrLPT server is ready to recieve print jobs; now; all you need is this simple shell script

  1. /bin/sh

# while (true) do cat /dev/irlptd | lpr done Dag Brattli: I hope that this will make it easier for all you that prefer to live in user-space, to make your own IrDA applications and try it out. Some printers actually use IrTTP (because of the limitations of IrLPT), so now you can write your own small user-space printer client so you can talk to it:

int discover_devices(int fd) { struct irda_device_list *list; unsigned char buf

Fatal Error:

lib/CachedMarkup.php (In template 'browse' < 'body' < 'html'):257: Error: Pure virtual

lib/InlineParser.php:336: Warning: Invalid [] syntax ignored: [[sizeof(struct irda_device_list) +

  • sizeof(struct irda_device_info) * MAX_DEVICES]


Fatal PhpWiki Error

lib/CachedMarkup.php (In template 'browse' < 'body' < 'html'):257: Error: Pure virtual