I use a USB Huawei ME906s-158 device as described in Huawei ME906s-158 not working with Ubuntu 16.04. If the module loses the connection it seems to have problems reconnecting to the network. So my idea is to write some script, running in the background checking if the LTE connection is up, and if not release the USB device and reconnect it, using terminal commands. I found helpful information in How to enable/disable mobile broadband from terminal? and on this forum thread, but the code is not running on my Ubuntu 16.04, which may be the problem.
Taking this line for example:
modprobe -r -f uhci_hcd
results in modprobe: FATAL: Module uhci_hcd is builtin. error. The same is true if I use xhci_hcd, which is used for my device.
So my question is how to change the modprobe commands to remove/connect my device?
Using dmesg the device is connected as
usb 3-13.1: new high-speed USB device number 117 using xhci_hcd
usb 3-13.1: New USB device found, idVendor=12d1, idProduct=15c1
usb 3-13.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-13.1: Product: HUAWEI Mobile
usb 3-13.1: Manufacturer: Huawei Technologies Co., Ltd.
usb 3-13.1: SerialNumber: 0123456789ABCDEF
cdc_ether 3-13.1:2.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-13.1, CDC Ethernet Device, 02:1e:10:1f:00:00
where the device number varies and the usb port depends on the used hardware port. I think I simply don't understand how the device is named or mounted to be addressed with modprobe.
The relevant information of lsusb is Bus 003 Device 028: ID 12d1:15c1 Huawei Technologies Co., Ltd. and lsusb -t delivers
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 480M
|__ Port 12: Dev 11, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 14, If 1, Class=Human Interface Device, Driver=, 1.5M
|__ Port 3: Dev 14, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 1: Dev 64, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 2: Dev 13, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 2: Dev 13, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 13: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 14: Dev 29, If 0, Class=Communications, Driver=cdc_ether, 480M
|__ Port 14: Dev 29, If 1, Class=CDC Data, Driver=cdc_ether, 480M
|__ Port 14: Dev 29, If 2, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 14: Dev 29, If 3, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 14: Dev 29, If 4, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 14: Dev 29, If 5, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 14: Dev 29, If 6, Class=Vendor Specific Class, Driver=option, 480M
Thank you very much for your help.
Here is the full dmesg output:
[748010.825136] usb 3-13.1: new high-speed USB device number 79 using xhci_hcd
[748010.926143] usb 3-13.1: New USB device found, idVendor=12d1, idProduct=15c1
[748010.926146] usb 3-13.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[748010.926147] usb 3-13.1: Product: HUAWEI Mobile
[748010.926148] usb 3-13.1: Manufacturer: Huawei Technologies Co., Ltd.
[748010.926149] usb 3-13.1: SerialNumber: 0123456789ABCDEF
[748010.929581] cdc_ether 3-13.1:2.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-13.1, CDC Ethernet Device, 02:1e:10:1f:00:00
[748010.930008] option 3-13.1:2.2: GSM modem (1-port) converter detected
[748010.930178] usb 3-13.1: GSM modem (1-port) converter now attached to ttyUSB0
[748010.930451] option 3-13.1:2.3: GSM modem (1-port) converter detected
[748010.930588] usb 3-13.1: GSM modem (1-port) converter now attached to ttyUSB1
[748010.930829] option 3-13.1:2.4: GSM modem (1-port) converter detected
[748010.930929] usb 3-13.1: GSM modem (1-port) converter now attached to ttyUSB2
[748010.931153] option 3-13.1:2.5: GSM modem (1-port) converter detected
[748010.931254] usb 3-13.1: GSM modem (1-port) converter now attached to ttyUSB3
[748010.931474] option 3-13.1:2.6: GSM modem (1-port) converter detected
[748010.931580] usb 3-13.1: GSM modem (1-port) converter now attached to ttyUSB4
[748010.959172] cdc_ether 3-13.1:2.0 enp0s20u13u1c2: renamed from usb0
[748010.986087] IPv6: ADDRCONF(NETDEV_UP): enp0s20u13u1c2: link is not ready
[748010.986238] cdc_ether 3-13.1:2.0 enp0s20u13u1c2: kevent 12 may have been dropped
[748010.990538] IPv6: ADDRCONF(NETDEV_UP): enp0s20u13u1c2: link is not ready
The full output of tree /sys/devices/pci0000:00/0000:00:14.0/usb3/3-13/ | grep driver is:
│ │ ├── driver -> ../../../../../../../bus/usb/drivers/cdc_ether
│ │ ├── driver -> ../../../../../../../bus/usb/drivers/cdc_ether
│ │ ├── driver -> ../../../../../../../bus/usb/drivers/option
│ │ │ ├── driver -> ../../../../../../../../bus/usb-serial/drivers/option1
│ │ ├── driver -> ../../../../../../../bus/usb/drivers/option
│ │ │ ├── driver -> ../../../../../../../../bus/usb-serial/drivers/option1
│ │ ├── driver -> ../../../../../../../bus/usb/drivers/option
│ │ │ ├── driver -> ../../../../../../../../bus/usb-serial/drivers/option1
│ │ ├── driver -> ../../../../../../../bus/usb/drivers/option
│ │ │ ├── driver -> ../../../../../../../../bus/usb-serial/drivers/option1
│ │ ├── driver -> ../../../../../../../bus/usb/drivers/option
│ │ │ ├── driver -> ../../../../../../../../bus/usb-serial/drivers/option1
│ ├── driver -> ../../../../../../bus/usb/drivers/usb
│ ├── driver -> ../../../../../../bus/usb/drivers/hub
├── driver -> ../../../../../bus/usb/drivers/usb
sudo -iand then typed the commands, think that should do the job, right? – Martin Herrmann Jan 11 '18 at 07:42write error: No such device. My problem is, I can't find the correct name of the device. I triedusb 3-13.1,3-13.1,usb-0000:00:14.0-13.1,cdc_ether 3-13.1:2.0, and others. Nothing works. Third looking for the used driver results in a tree showing several links to a driver atbus/usb/drivers/cdc_etherand several tobus/usb-serial/drivers/option1. – Martin Herrmann Jan 11 '18 at 07:50cdc_etheris going to be the driver of your usb device with the identifier3-13.1:2.0. So try the following:tree /sys/ | grep 3-13.1:2.0ortree /sys/ | grep cdc_ether. And yes, i mentsudo -i. And when you have found the position of theunbindcommand in thecdc_etherdirectory type somethinkg likeecho -n "3-13.1:2.0" > /sys/bus/drivers/cdc_ether/unbind– AlexOnLinux Jan 11 '18 at 08:26ls /sys/bus/drivers/cdc_ether/? The Output should containbind,unbindand the identifier that you have to put inside the bracketsecho -n "identifier" > /sys/bus/drivers/cdc_ether/unbind– AlexOnLinux Jan 11 '18 at 08:41tree /sys/ | grep 3-13.1:2.0results in a list with several lines on different stages. In principle all point to3-13.1:2.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb3/3-13/3-13.1/and then some subdirectories, as3-13.1:2.0or3-13.1:2.0/net/enp0s20u13u1c2. If I grep for3-13.1:2.2e.g. it points to the appropriate subdirectories of this name and it shows me names as ttyUSB0, ttyUSB1 or enp0s20u13u1c2. These names relate to the output ofdmesg. – Martin Herrmann Jan 12 '18 at 07:24-bash: /sys/bus/drivers/cdc_ether/unbind: No such file or directoryerror, no matter which identifier I try, and I tested all I can think of now: ttyUSB1 to ttyUSB4, 3-13.1:2.0 to 3-13.1:2.6, all combinations with cdc_ether and option1 and enp0s20u13u1c2. Always the same result :-( – Martin Herrmann Jan 12 '18 at 07:27ls /sys/bus/usb/drivers/cdc_ether/results in3-13.1:2.0@ 3-13.1:2.1@ bind module@ new_id remove_id uevent unbind. Here the 3-13.1:2.1@ are symbolic links pointing to../../../../devices/pci0000:00/0000:00:14.0/usb3/3-13/3-13.1/3-13.1:2.0/and..../3-13.1:2.0/respectively. – Martin Herrmann Jan 12 '18 at 07:29dmesgoutput that you did post in your question, is this the whole output of the plug in and plug out procedure? If not, please unplug your device, typedmesg -wand plug your device in, wait a few seconds and plug it out again and edit your question. The output oflstells that you have two devices binded to the same driver3-.1:2.0and3-13.1.2that and the@symbol are confusing me. What is the output of:tree /sys/devices/pci0000:00/0000:00:14.0/usb3/3-13/ | grep driver? – AlexOnLinux Jan 12 '18 at 07:54