Thursday 19 March 2015

udev rules - bInterfaceNumber

as owner of flyswatter2 (further fs2) i need very often use serial console of fs2, which is second ttyUSB interface.
problem is, that fs2 doesn't have always the same order.
i had already udev rules for ftdi devices to assign permissions to those ttyUSBn, but it was not enough.

as you can use SYMLINK="something", i wanted to have symlink /dev/ttyFlyswatter2 to be able simply attach to console using screen.
first what comes to mind is following:

ATTRS{idVendor}=="0403",ATTRS{idProduct}=="6010",ATTRS{serial}=="FS20000",ATTRS{bInterfaceNumber}=="01",MODE="0664",GROUP="dialout",SYMLINK+="ttyFlyswatter2"

but it doesn't worked. i found similar problem solution which i adopted to my needs:

ATTRS{../idVendor}=="0403",ATTRS{../idProduct}=="6010",ATTRS{../serial}=="FS20000",ATTRS{bInterfaceNumber}=="01",MODE="0664",GROUP="dialout",SYMLINK+="ttyFlyswatter2"