Infrared Configuration

Introduction

For a general definition see: http://en.wikipedia.org/wiki/Infrared.

The following guidance might be useful in helping to configure Infrared on an Linux server.

My Infrared Configuration

The IR adapter available for use was a Mobile Action Technology Inc, MA-620 Infrarad Adaptor (driver pl2303). The following commands can be used to display relevant details:

[root@host ~]# lsusb
Bus 002 Device 010: ID 0df7:0620 Mobile Action Technology, Inc. MA-620 Infrared Adapter
Bus 002 Device 009: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 002 Device 005: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 WebCam
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 003: ID 046d:08a2 Logitech, Inc. Labtec WebCam Pro
Bus 001 Device 002: ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 001 Device 001: ID 0000:0000
[root@host ~]#

Expansion on this provides full details for the specific MA-620 device as shown:

[root@host ~]# lsusb -s 002:010 -v

Bus 002 Device 010: ID 0df7:0620 Mobile Action Technology, Inc. MA-620
Infrared Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0df7 Mobile Action Technology, Inc.
  idProduct          0x0620 MA-620 Infrared Adapter
  bcdDevice            0.10
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
          Usage Type               Data
        wMaxPacketSize     0x000a  bytes 10 once
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
          Usage Type               Data
        wMaxPacketSize     0x0040  bytes 64 once
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
          Usage Type               Data
        wMaxPacketSize     0x0040  bytes 64 once
        bInterval               0
[root@host ~]#

Device details are:

[root@host ~]# ls -l /dev/tty*
...
...
crw-rw----  1 root uucp   4, 69 Jan  2 12:54 /dev/ttyS5
crw-rw----  1 root uucp   4, 70 Jan  2 12:54 /dev/ttyS6
crw-rw----  1 root uucp   4, 71 Jan  2 12:54 /dev/ttyS7
crw-rw----  1 root uucp 188,  0 Jan 13 22:49 /dev/ttyUSB0
[root@host etc]#

The dmesg command is be used to show other key details:

[root@host ~]# demsg:
...
drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic
usbcore: registered new driver usbserial_generic
usbcore: registered new driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0
drivers/usb/serial/usb-serial.c: USB Serial support registered for PL-2303
pl2303 2-1:1.0: PL-2303 converter detected
usb 2-1: PL-2303 converter now attached to ttyUSB0
usbcore: registered new driver pl2303
drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver
v0.11
parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE,EPP]
parport0: irq 7 detected
ieee1394: Initialized config rom entry `ip1394'
usb 2-2: USB disconnect, address 3
usb 2-2: new full speed USB device using address 5
/usr/local/src/spca5xx/spca5xx-20060501/drivers/usb/spca5xx.c: USB SPCA5XX camera found. Type Vimicro Zc301P 0x301b
/usr/local/src/spca5xx/spca5xx-20060501/drivers/usb/spca5xx.c:
[spca5xx_probe:5480] Camera type JPEG
/usr/local/src/spca5xx/spca5xx-20060501/drivers/usb/zc3xx.h: [zc3xx_config:527] Find Sensor PB0330
/usr/local/src/spca5xx/spca5xx-20060501/drivers/usb/spca5xx.c:
[spca5xx_getcapability:1765] maxw 640 maxh 480 minw 176 minh 144
usb 2-1: USB disconnect, address 4
PL-2303 ttyUSB0: PL-2303 converter now disconnected from ttyUSB0
pl2303 2-1:1.0: device disconnected
usb 2-1: new full speed USB device using address 6
hub 2-1:1.0: USB hub found
hub 2-1:1.0: 4 ports detected
usb 2-1.1: new full speed USB device using address 7
pl2303 2-1.1:1.0: PL-2303 converter detected
usb 2-1.1: PL-2303 converter now attached to ttyUSB0
usb 2-1.1: USB disconnect, address 7
PL-2303 ttyUSB0: PL-2303 converter now disconnected from ttyUSB0
pl2303 2-1.1:1.0: device disconnected
usb 2-1.4: new full speed USB device using address 8
pl2303 2-1.4:1.0: PL-2303 converter detected
usb 2-1.4: PL-2303 converter now attached to ttyUSB0
[root@host etc]#

The IR Adpator packages currently installed on the server are:

[root@host ~]# yum list all | grep irda
irda-utils.i386                          0.9.16-3               installed
girda_applet.i386                        2.0.3-1.2.el4.rf       dag-extra
girda_applet-debuginfo.i386              2.0.3-1.2.el4.rf       dries-extra
[root@host ~]#

A script such as the example below (/etc/hotplug/usb/start_irda) was used to configure the system:

#!/bin/sh
# This is /etc/hotplug/usb/start_irda file
modprobe uhci_hcd
modprobe pl2303
modprobe irda
echo 9600 > /proc/sys/net/irda/max_baud_rate
modprobe ma600-sir
modprobe ircomm-tty
irattach /dev/ttyUSB0 -d ma600 -s
rm -rf /dev/modem
ln -s /dev/ircomm0 /dev/modem
exit 0  

With the following file, called 025_irda.rules, in /etc/udev/rules.d:

BUS!="usb", ACTION!="add", GOTO="kcontrol_rules_end"
SYSFS{idProduct}=="0620", SYSFS{idVendor}=="0df7", RUN+="/etc/hotplug/usb/start_irda"
LABEL="kcontrol_rules_end"  

However the lines in the first script failed to load the modules ma600-sir and ircomm-tty both failed (the necessary modules were not found).

Conclusion

After considerable struggle it proved impossible to successfully configure the Mobile Action Technology Inc, MA-620 Infrarad Adaptor device. The attempt to use IrDA was therefore abandoned.

General Links

The following general links are useful references when setting up Infrared:


URLSummary/Description
http://www.faqs.org/docs/Linux-HOWTO/Infrared-HOWTO.html Linux Infrared HOWTO (how to use the software provided by the Linux/IrDA project)
http://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/IrDA.html Linux-IrDA quick tutorial
http://www.linuxselfhelp.com/HOWTO/Infrared-HOWTO/infrared-howto-s-low-level-drivers.html#AEN361 Starting the IrDA Stack
http://www.linuxquestions.org/questions/linux-hardware-18/infraredremote-control-question-440840/ Infrared remote control