Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
Emannuel
Posts: 1
Joined: 10 Jun 2012, 11:26

Using multi modens - Gateway SMS with gammu, mysql and ubunt

Post by Emannuel » 10 Jun 2012, 12:05

Hello. I created a solution that is working very well.
This solution uses many 3G modems to send textmessagens (SMS) simultaneously.
Currently I have to connect a modem at a time to be able to mount the modems in a logic sequence ttsyusb * doors.
My problem is that, after a while of everything working these ports are frequently changing and ruins everything.
Is there any way to be able to create persistent links using multiples identical (same ATTRS {idVendor} and ATTRS {idProduct}) modems?
How can I plug the modens in a random way and get persistents(same) doors to each modem?
I'm dreaming in just boot the machine with all modems already plugged and all ports configured automatically.
Today I am using 8 modems, but I want to achieve at least 20.... Thanks...

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Post by Josh » 11 Jun 2012, 01:03

As with many other challenges, the solution may be the "udev" system.

The kernel name, default "ttyUSBx", can be changed to anything else by udev rules, depending on, say, the device bus (physical port).

An udev rule does something (set a name, run a program, create a link) if one or several conditions are met. You can check for any attribute in the "/sys/bus/usb" tree.

In your case, that would probably mean to name every interface explicitly (usually 3 per modem). A little effort, but once completed will eliminate the need for replugging.

Example (untested):

Code: Select all

BUS=="usb", ID=="1", ATTRS{bInterfaceNumber}=="3", NAME="ttyUSB2"
You get the "ID" and the interface value from looking at the entries in "/sys/bus/usb/devices". There you find names like "1-1:1.3". The digit after the dash is the devices' port, the last digit is its third interface.


Post Reply