2010-05-10

How to get a Digi Edgeport/8 working with RHEL/CentOS 5 - part 2

It turns out this wasn't the entire story. The device filenames that are created when the device is plugged-in (or at boot-up) depend on what other usb-serial devices are also connected, and which USB ports they are plugged into.

The standard advice is to use 'udev' to cause symlinks to be created that refer to the adapter ports independently of the kernel-assigned /dev/ttyUSBn names.

Unfortunately, in kernel 2.6.18, as shipped, this port information is not in the 'sysfs' database.

Fortunately, I found this patch, which enabled me to build an updated usb-serial.ko (using the procedure in the previous post).

Once installed, the following udev rules file /etc/udev/rules.d/11-edgeport.rules :

BUS=="usb",SYSFS{idVendor}=="1608",SYSFS{idProduct}=="0244",SYSFS{serial}=="*-0",NAME="%k",SYMLINK="ttyEDGE8_0_$sysfs{port_number}"`
BUS=="usb",SYSFS{idVendor}=="1608",SYSFS{idProduct}=="0244",SYSFS{serial}=="*-1",NAME="%k",SYMLINK="ttyEDGE8_1_$sysfs{port_number}"`
BUS=="usb",SYSFS{idVendor}=="1608",SYSFS{idProduct}=="0244",SYSFS{serial}=="*-2",NAME="%k",SYMLINK="ttyEDGE8_2_$sysfs{port_number}"`
BUS=="usb",SYSFS{idVendor}=="1608",SYSFS{idProduct}=="0244",SYSFS{serial}=="*-3",NAME="%k",SYMLINK="ttyEDGE8_3_$sysfs{port_number}"`

causes symlinks to be created like this:

lrwxrwxrwx 1 root root 7 May 10 14:53 /dev/ttyEDGE8_0_0 -> ttyUSB1
lrwxrwxrwx 1 root root 7 May 10 14:53 /dev/ttyEDGE8_0_1 -> ttyUSB2
lrwxrwxrwx 1 root root 7 May 10 14:53 /dev/ttyEDGE8_1_0 -> ttyUSB3
lrwxrwxrwx 1 root root 7 May 10 14:53 /dev/ttyEDGE8_1_1 -> ttyUSB4
lrwxrwxrwx 1 root root 7 May 10 14:53 /dev/ttyEDGE8_2_0 -> ttyUSB5
lrwxrwxrwx 1 root root 7 May 10 14:53 /dev/ttyEDGE8_2_1 -> ttyUSB6
lrwxrwxrwx 1 root root 7 May 10 14:53 /dev/ttyEDGE8_3_0 -> ttyUSB7
lrwxrwxrwx 1 root root 7 May 10 14:53 /dev/ttyEDGE8_3_1 -> ttyUSB8

2 comments:

pjwelsh said...

Great bit of info. Many Google searches for my issue brought me to your blog. There is now a much easier way to get the edgeport 8 or 416 to work - just use the "kernel-ml" mainline kernel from elrepo (http://elrepo.org/tiki/tiki-index.php?page=kernel-ml)

Philip said...

Good info, thanks, I wasn't aware of this site.