OpenWrt Forum Archive

Topic: Static USB Names

The content of this topic has been archived on 12 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hey,

I would like to use two or more ttyUSB devices. Each device has a special function (one for 3g, one for USB <> 3G), so I need to assign a static name to each device.

Example:
The 3g dongle should always be /dev/ttyUSB0
The USB RS232 Adapter is always /dev/ttyUSB1

Im using the latest stable version on a TP-Link TL-WR1043ND.

Thanks for your help!

Christopher

You can write a hotplug script.

Hey,

I just tried that, and it worked fine at first. But the symlink seems to alter the data format.

If I use

read LINE < /dev/ttyUSB0

model=`expr substr $LINE 11 11` # Model

everything works fine.


If I use

read LINE < /dev/CCD

model=`expr substr $LINE 11 11` # Model

which seems totally equal viewed with cat, the expr substr fails.

What do I have to change to make it work both ways?

The discussion might have continued from here.