adulogo.jpg (1752 bytes) LINUX SDK  

Multiple ADU Devices With udev

This page shows the results of plugging in multiple
ADU devices when the 10-adu.rules file is active
in udev.
`
` (Easy-Use Home)
`
`

The example uses 3 ADU devices: an ADU208 with serial number C00119 an ADU100 with serial number B00019 an ADU200 with serial number B00099

Console Log

After plugging in the devices the dmesg command shows:

    adutux 2-1:1.0: ADU208 C00119 now attached to /dev/usb/adutux0
    ...
    adutux 2-2:1.0: ADU100 B00019 now attached to /dev/usb/adutux1
    ...
    adutux 1-2:1.0: ADU200 B00099 now attached to /dev/usb/adutux2


Notice that the device names assigned by the kernel are
ascending in the order that the devices were plugged in:
adutux0, adutux1, adutux2

If the devices were connected in a different order then
different kernel names would identify each device.
ie. If the ADU100 were plugged in first then it would
be attached to adutux0 instead of adutux1.

/dev Directory

The ls command shows:

    [fedora@localhost ~]$ ls -l /dev/adu*
    crw-rw-rw- 1 root root 180, 67 2008-03-02 07:49 /dev/adutux0
    crw-rw---- 1 root root 180, 68 2008-03-02 07:50 /dev/adutux1
    crw-rw-rw- 1 root root 180, 69 2008-03-02 07:50 /dev/adutux2
    lrwxrwxrwx 1 root root       7 2008-03-02 07:50 /dev/adutux4 -> adutux2
    lrwxrwxrwx 1 root root       7 2008-03-02 07:49 /dev/adutux5 -> adutux0

The kernel assigned names appear as the first 3 entries.
The last 2 entries were created by the udev daemon.
The 10-adu.rules file specifies that serial number
B00099 should be symbolicly linked with the device
name /dev/adutux4. Checking the console log against
the ls output confirms this.

Similarly serial number C00119 is symbolicly linked
with the device name /dev/adutux5.
We can issue commands to the device names
/dev/adutux4 and /dev/adutux5 and be assured that
the commands are received by the devices numbered
B00099 and C00119 respectively.

The serial number B00019 does not appear in
the 10-adu.rules file. Thus the udev daemon did not
create a symbolic link to the ADU100. The only
name that can be used to access the ADU100 is
the kernel name /dev/adutux1. This name changes
depending on the connection order of ADU devices.

Even worse, note the permissions.
The /dev/adutux1 entry can only be accessed by the
root group. Normal users have no access.
The udev daemon has applied the MODE value of 0666 in
the 10-adu.rules file to grant global read-write to
/dev/adutux4 and /dev/adutux5.
Notice that the associated kernel names adutux0 and
adutux2 also acquire global read-write permission.
as a consequence of the udev actions.