#14 ttyUSB*


hi guys
i'm using only one USB serial converter, and sometimes linux put it as ttyUSB0, or ttyUSB1 or ttyUSB2....
so, could we use a special character? for example
ser2net -C "3333:telnet:0:/dev/ttyUSB0:9600 1STOPBIT 8DATABITS remctl"

could be
ser2net -C "3333:telnet:0:/dev/ttyUSB*:9600 1STOPBIT 8DATABITS remctl"

when i connect to port 3333 it will seek USB0, if not found check USB1 if not found USB2....
there's a funcion in php called glob, i don't know if there's something like it in c
it return all files with a especial expression like old MSDOS or like linux find -iname "/dev/ttyUSB*"



  • Corey Minyard

    Corey Minyard - 2012-12-05

    I deal with this, too, and this is really not the right way to fix the problem for two reasons:

    1) The old devices often don't get deleted. So this would just lead to more frustration.

    2) You can hard-assign serial ports to usb devices in udev. For instance, I have created a file in /etc/udev/rules.d/... that has things like: SUBSYSTEMS=="usb", KERNELS=="1-", NAME="ttyUSB4". That way, a device at that USB address will always be ttyUSB4.

    Hopefully that helps.

  • Corey Minyard

    Corey Minyard - 2012-12-05
    • status: open --> closed