3

I would like the 4 UARTS that show to be on a name other than /ttyUSB0 because i have many devices that end up on /ttyUSB*.

I have written a rule which can create a symlink or new name based on the attributes, but I am unable to get the symlink/names to start at 0 if another device is already plugged in, thus stopping my scripts from working

eg FTDI Quad UART chip is plugged in

/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB2
/dev/ttyUSB3

When plugged in after another device

/dev/ttyUSB1
/dev/ttyUSB2
/dev/ttyUSB3
/dev/ttyUSB4

When rule applied, it only mimics the numbering of the original instead of starting back at 0

Here is the basic rule:

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", SYMLINK:="ttyUART$number", GROUP:="users", MODE:="0666"

I have tried a few different variables in the naming, but have not been successful. My goal is to have the FTDI UARTS show as

/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB2
/dev/ttyUSB3

No matter the order of the USB devices

1 Answer 1

0

This is single USB device that has multiple interfaces:

  • You can use ATTRS{bInterfaceNumber} in rule much and create 4 rules (one for each interface)

    So you have full control to name/number it as you want

  • Otherwise, use interface number %E{ID_USB_INTERFACE_NUM} instead of kernel number.

    SUBSYSTEM=="tty", ATTRS{idVendor}==0403"", ATTRS{idProduct}=="6011", SYMLINK:="ttyUART%E{ID_USB_INTERFACE_NUM}", GROUP:="users", MODE:="0666"
    

    But you don't have full control on numbering (but they are fixed).

    It should not be a problem in your case, you have only serial ports. Example, in my case I have 3G key 12d1:1c1e Huawei Technologies Co., Ltd. with 2 serial interfaces (00, 02), it has another interface (01 usb-storage, An emulated CD drive contains Windows driver). So I got these:

    lrwxrwxrwx  1 root root          7 Jun  4 19:36 /dev/ttyUART00 -> ttyUSB0
    lrwxrwxrwx  1 root root          7 Jun  4 19:36 /dev/ttyUART02 -> ttyUSB1
    crw-rw-rw-  1 root users   188,  0 Jun  4 19:36 /dev/ttyUSB0
    crw-rw-rw-  1 root users   188,  1 Jun  4 19:36 /dev/ttyUSB1
    
2
  • 1
    well that seems promising, i think my post was miss typed where i meant to say i want the device with 4 interfaces to show up seperate from the ttyUSB*-* and also or instead show UART0-3. one thing i ran into is that the number they show from the drivers seems to get attributed to anything that has to do with the numbering, therefor if this device is second, the rule will create ttyUART1-3 instead of starting at 0 Jun 5, 2015 at 20:12
  • @JamesTroutman, could you unplug the device, run udevadm monitor, plug device again, then post its output.
    – user.dz
    Jun 5, 2015 at 21:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .