I'm working on a mobile application that uses dedicated netbooks as hardware platform, the software runs on arch linux. In order to enable mobile internet access, I want to integrate a gsm modem in the setup, the modem is connected via usb. As my software expects a fixed device name of the modem, I'm trying to use a custom udev-rule to create a symlink to the modem device as it's plugged in. My current udev rules looks like this:
SUBSYSTEM=="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="140c", MODE="0666", SYMLINK+="gsm"
The problem is, that when I plug in the modem, two devices seem to be created, as can be seen using dmesg
:
[ 3955.586471] option 1-1:1.2: GSM modem (1-port) converter detected
[ 3955.587286] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 3955.587946] option 1-1:1.3: GSM modem (1-port) converter detected
[ 3955.588637] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
Talking to the modem only seems to work on the ttyUSB2
. However, the symlink created by udev always seems to point to ttyUSB1
, thus, it cannot be used to communicate with the modem. Can anyone explain this behaviour and tell my how I can change it?
I already tried to use udevadm info to find distinguishable attributes, in order to make the rule more spedific. The devices only seem to differ in their bInterfaceNumber
, but I could not successfully include that attribut in the udev rule.