2

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.

Simon
  • 3,509
  • 18
  • 21
  • 3
    It is probably a modem port and a diagnostics port, and you need the modem port. This is normal for plug-in modems - some (Qualcomm based) also have a 3rd port for GPS data, for example. Can't help you with how to change to the modem port on linux, sorry :-( . – user1725145 Nov 15 '13 at 10:44
  • Please take a look at [ModemManager](http://www.freedesktop.org/wiki/Software/ModemManager/). This software will take care about modem independent from its manufacturer and port names and give you a standard device to communicate with via [D-Bus](http://www.freedesktop.org/wiki/Software/dbus/). It can also communicate with modems via [QMI](http://cgit.freedesktop.org/libqmi) and [MBIM](http://www.freedesktop.org/wiki/Software/libmbim/). – yegorich Nov 22 '13 at 07:41
  • As for **udev** see this question: http://stackoverflow.com/questions/19273418/udev-how-to-get-value-of-a-child-device-attributes – yegorich Nov 22 '13 at 07:44

0 Answers0