Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: bonbob on August 12, 2017, 03:22:09 PM

Title: Random ttyUSB modem name by usb-modeswitch
Post by: bonbob on August 12, 2017, 03: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?
Title: Re: Random ttyUSB modem name by usb-modeswitch
Post by: Juanito on August 12, 2017, 11:53:31 PM
You could write a udev rule for this?
Title: Re: Random ttyUSB modem name by usb-modeswitch
Post by: bonbob on August 15, 2017, 08:43:53 AM
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.
Title: Re: Random ttyUSB modem name by usb-modeswitch
Post by: bonbob on October 09, 2017, 12: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.  :)