LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-25-2018, 06:03 AM   #1
72rcfj789w93
LQ Newbie
 
Registered: Jan 2018
Posts: 7

Rep: Reputation: Disabled
usb broadband modem has to be re-plug in order to be recognized as /dev/ttyUSBx


OS: slackware 14.2

I am using kppp to connect to internet via usb mobile broadband modem. On kppp I set /dev/ttyUSB1 as modem device. The problem is that slackware seems unable to detect the device automatically during boot up.

if I do
Code:
ls /dev
ttyUSBx is not in the list. It will be in the list either after:
1. I re-plug the device (once I arrived in Desktop Environment), or
2. I re-boot into slackware after running windows first (dual boot)

some outputs from lsusb and dmesg:
lsusb (when the device is undetected):
Code:
Bus 001 Device 005: ID 1c9e:98ff OMEGA TECHNOLOGY 
Bus 001 Device 002: ID 1f71:3301  
..........
lsusb (when the device is detected):

Code:
Bus 001 Device 005: ID 1c9e:9801 OMEGA TECHNOLOGY                                     
Bus 001 Device 002: ID 1f71:3301                                                      
........
OMEGA TECHNOLOGY is the device.

dmesg (when undetected):
Code:
...
[    8.047037] usb 1-6: new high-speed USB device number 5 using ehci-pci
[    8.163989] usb 1-6: New USB device found, idVendor=1c9e, idProduct=98ff
[    8.164071] usb 1-6: New USB device strings: Mfr=3, Product=2, SerialNumber=4
[    8.164145] usb 1-6: Product: USB Modem
[    8.164187] usb 1-6: Manufacturer: USB Modem
[    8.164232] usb 1-6: SerialNumber: 1234567890ABCDEF
...
dmesg (when detected after I unplug and then re-plug the device):
Code:
...
[  877.365666] usb 1-6: USB disconnect, device number 5
[  883.475037] usb 1-6: new high-speed USB device number 6 using ehci-pci
[  883.591993] usb 1-6: New USB device found, idVendor=1c9e, idProduct=98ff
[  883.591998] usb 1-6: New USB device strings: Mfr=3, Product=2, SerialNumber=4
[  883.592011] usb 1-6: Product: USB Modem
[  883.592021] usb 1-6: Manufacturer: USB Modem
[  883.592024] usb 1-6: SerialNumber: 1234567890ABCDEF
[  883.645083] usb-storage 1-6:1.0: USB Mass Storage device detected
[  883.645202] scsi host7: usb-storage 1-6:1.0
[  884.608919] usb 1-6: USB disconnect, device number 6
[  884.919099] usb 1-6: new high-speed USB device number 7 using ehci-pci
[  885.035994] usb 1-6: New USB device found, idVendor=1c9e, idProduct=9801
[  885.036000] usb 1-6: New USB device strings: Mfr=3, Product=2, SerialNumber=4
[  885.036016] usb 1-6: Product: USB Modem
[  885.036024] usb 1-6: Manufacturer: USB Modem
[  885.036027] usb 1-6: SerialNumber: 1234567890ABCDEF
[  885.087316] usbserial_generic 1-6:1.0: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  885.087322] usbserial_generic 1-6:1.0: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  885.087325] usbserial_generic 1-6:1.0: generic converter detected
[  885.087433] usb 1-6: generic converter now attached to ttyUSB0
[  885.087552] usbserial_generic 1-6:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  885.087556] usbserial_generic 1-6:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  885.087558] usbserial_generic 1-6:1.1: generic converter detected
[  885.087647] usb 1-6: generic converter now attached to ttyUSB1
...
as you can see after I re-plug the device new idProduct 9801 has been detected and generic converter now attached to ttyUSB1.

what should I do so that slackware will automatically detect ttyUSBx?

thanks
 
Old 01-26-2018, 12:27 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,802

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
I'm not a Slackware user, but I'm going to speculate a bit that usb_modeswitch (which is called by a matching udev rule) works when the kernel uevent is detected, but when the device is present at boot no such event takes place, and so the device remain on storage device mode. It might work if udev is retriggered (not sure if reloading rules is necessary)....
Code:
udevadm control --reload-rules && udevadm trigger
If this works to get the mode-switching working for a device plugged in at boot, then it could be added to to a suitable init script perhaps.

Another possible workaround involves some code to reset the USB bus (or a particular ) device, which will cause it to be re-initialised and the kernel uevent generated which will result in the udev rule being matched and usb_modeswitch being triggered
 
Old 01-26-2018, 06:11 AM   #3
72rcfj789w93
LQ Newbie
 
Registered: Jan 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
I'm not a Slackware user, but I'm going to speculate a bit that usb_modeswitch (which is called by a matching udev rule) works when the kernel uevent is detected, but when the device is present at boot no such event takes place, and so the device remain on storage device mode. It might work if udev is retriggered (not sure if reloading rules is necessary)....
Code:
udevadm control --reload-rules && udevadm trigger
If this works to get the mode-switching working for a device plugged in at boot, then it could be added to to a suitable init script perhaps.

Another possible workaround involves some code to reset the USB bus (or a particular ) device, which will cause it to be re-initialised and the kernel uevent generated which will result in the udev rule being matched and usb_modeswitch being triggered
I am playing around with usb_modeswitch until I found this command
Code:
usb_modeswitch -v 0x1c9e -p 0x98ff -V 0x1c9e -P 0x9801 -S
I put it into rc.local file. and It seems OK now.

Thanks for your information anyway I'll take a look into that later.
 
Old 01-26-2018, 02:34 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,802

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Glad to have been of guidance. Udev calls usb_modeswitch in essentially the same way, and has a directory (/usr/share/usb_modeswitch/) containing various chipsets and switching details which it uses to implement the switching. Calling it manually like this does the same, so another means to the same end.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between writing to /dev/ttyACMx and /dev/ttyUSBx mlalitha Linux - Newbie 6 01-19-2016 12:25 PM
[SOLVED] Trouble getting all data out of usbserial (/dev/ttyUSBx) rtmistler Linux - Software 3 10-09-2012 12:26 PM
[SOLVED] 3G modem not visible as /dev/ttyUSBX Aldebaran Slackware 4 01-27-2011 10:18 PM
Force a USB device to use a specific /dev/ttyUSBX garnser Linux - Software 4 02-10-2006 06:28 AM
USB pilot-link under Fedora Core 3: /dev/ttyUSBx there but not there reeder.29 Linux - Laptop and Netbook 2 10-17-2005 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration