LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   udev + usb gprs modems (https://www.linuxquestions.org/questions/linux-software-2/udev-usb-gprs-modems-722231/)

mrate 04-28-2009 07:45 AM

udev + usb gprs modems
 
Hi,
am experiencing some troubles with udev on embedded linux (running on kernel 2.6.19.2). The embedded system has 2 USB ports width 2 identical USB GPRS modems. But each modem has different SIM and is supposed to comunicate with different peers. What I need is to distinguish these two modems not by name (kernel assign names like ttyACM0 and ttyACM1 in order in witch the modems were plugged in) but by the topology position, for example:

/dev/modem1 for device plugged in usb port 1
/dev/modem2 for device plugged in usb port 2

I tried to run udev on system with these rules:

KERNELS=="1-1:1.0", SUBSYSTEM=="tty", SYMLINK+="modem1"

KERNELS=="1-2:1.0", SUBSYSTEM=="tty", SYMLINK+="modem2"

but the symlinks are not created when pluging the devices. Even udevtest for /class/tty/ttyACM0 doesn't seem to find any suitable rules to add. But if I add a rule for network, like:

KERNEL=="eth0", SYMLINK+="test_net"

the udevtest /class/net/eth0 prints a message that a symlink called test_net would by created, so udev is probably working. I tried to modify rules such as SUBSYSTEM=="usb" (just for test) and still nothing happened. Am I missing something?

Thanks

datopdog 04-30-2009 02:30 AM

Try this.
Code:

KERNEL=="ttyACM*",                    SYMLINK+="modem"


All times are GMT -5. The time now is 10:36 PM.