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