WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Random ttyUSB modem name by usb-modeswitch  (Read 2083 times)

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Random ttyUSB modem name by usb-modeswitch
« on: August 12, 2017, 07:22:09 PM »
I have two modems plugged in my PC. One SIERRA named ttyUSB9 and another - ZTE named ttyUSB2. Usually i used only ZTE. And it is used in my ppp option script to connect via 3G-modem. But sometimes, after reboot TCL this ttyUSB's randomly change each other. So SIERRA became ttyUSB2 and ZTE became ttyUSB9. PPP option script not working till i am not change ttyUSB2 to ttyUSB9. How can i to attach ttyUSB-number to a specific modem. Or how can i recognize each ttyUSB if it impossible to attach number?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14785
Re: Random ttyUSB modem name by usb-modeswitch
« Reply #1 on: August 13, 2017, 03:53:31 AM »
You could write a udev rule for this?

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Re: Random ttyUSB modem name by usb-modeswitch
« Reply #2 on: August 15, 2017, 12:43:53 PM »
I have tried use a couple of rules, by they are not working. Anyway USBtty's appeares after usb-modeswitch aggregate modem plugging in act. So maybe i need to look at the usb-modeswitch configs.

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Re: Random ttyUSB modem name by usb-modeswitch
« Reply #3 on: October 09, 2017, 04:44:47 AM »
I have Solved this problem by adding udev rule

Code: [Select]
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v19D2p0016*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="00", SYMLINK="ZTE_MF180_diag"
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v19D2p0016*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="01", SYMLINK="ZTE_MF180_phone"
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v19D2p0016*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="02", SYMLINK="ZTE_MF180_modem"

I used this rules earlier with ACTION=="add" option, but it has no effect.

After adding rules all i have to do is just add file with udev-rules to filetool.lst
and command
Code: [Select]
udevadm control --reload-rules && udevadm triggerto bootlocal.sh

Thanks for Help.  :)