E3372h-320 (update 2020 version of E3372) automatically switches itself into ethernet mode
Posted: 23 Sep 2020, 13:02
Hi,
I had some problems with getting an E3372h-320 into serial (or "option") mode and wanted to share my findings.
We have a setup which switches our E3372 modems into serial mode. This has been working perfectly well with older modems for around 6 months now, but recently we got a new batch of modems which mysteriously switched into ethernet mode instead. Here's what happens:
* The new modems initially appear with the same vendor and product id as the old ones: 12d1:1f01 (as seen in journalctl).
* Our setup correctly identifies our custom rule to switch them into serial mode (product 155e) and runs usb_modeswitch with the appropriate arguments.
* But usb_modeswitch always crashes with the error "Error opening the device. Abort" just after it finds the device (I set EnableLogging=1 to see this, full logs below).
* Then the modem disappears, and reappears in ethernet mode (product 14db)!
The exact same thing happens even if I set `DisableSwitching=1` (and the logs confirm that usb modeswitch didn't attempt to do any switching)!
Eventually I tried disabling the USB storage kernel module (by putting "install usb-storage /bin/true" into a file in /etc/modprobe.d/, just blacklisting the module didn't work) and after a reboot the modem switched properly.
I guess what is happening is the modem is somehow detecting that it is being mounted as usb storage on a Linux system, and switches itself into ethernet mode.
Anyway, all of this turned out to be a waste of time because the E3372h-320 barely supports any AT commands (only the version information ones as far as I can tell) so it's completely useless as a serial modem. If anyone knows how to get it to support AT commands I'd love to know.
I hope this helps to save other people from going through the same painful debugging experience as me.
Here is the full usb modeswitch log:
and the output of journalctl -b 0 | grep usb
I had some problems with getting an E3372h-320 into serial (or "option") mode and wanted to share my findings.
We have a setup which switches our E3372 modems into serial mode. This has been working perfectly well with older modems for around 6 months now, but recently we got a new batch of modems which mysteriously switched into ethernet mode instead. Here's what happens:
* The new modems initially appear with the same vendor and product id as the old ones: 12d1:1f01 (as seen in journalctl).
* Our setup correctly identifies our custom rule to switch them into serial mode (product 155e) and runs usb_modeswitch with the appropriate arguments.
* But usb_modeswitch always crashes with the error "Error opening the device. Abort" just after it finds the device (I set EnableLogging=1 to see this, full logs below).
* Then the modem disappears, and reappears in ethernet mode (product 14db)!
The exact same thing happens even if I set `DisableSwitching=1` (and the logs confirm that usb modeswitch didn't attempt to do any switching)!
Eventually I tried disabling the USB storage kernel module (by putting "install usb-storage /bin/true" into a file in /etc/modprobe.d/, just blacklisting the module didn't work) and after a reboot the modem switched properly.
I guess what is happening is the modem is somehow detecting that it is being mounted as usb storage on a Linux system, and switches itself into ethernet mode.
Anyway, all of this turned out to be a waste of time because the E3372h-320 barely supports any AT commands (only the version information ones as far as I can tell) so it's completely useless as a serial modem. If anyone knows how to get it to support AT commands I'd love to know.
I hope this helps to save other people from going through the same painful debugging experience as me.
Here is the full usb modeswitch log:
Code: Select all
USB_ModeSwitch log from Wed Sep 23 10:51:28 2020
Use global config file: /etc/usb_modeswitch.conf
Raw args from udev: 1-1.4.4.2:1.0
Bus ID for device not given by udev.
Trying to determine it from kernel name (1-1.4.4.2:1.0) ...
Use top device dir /sys/bus/usb/devices/1-1.4.4.2
USB dir exists: /sys/bus/usb/devices/1-1.4.4.2
SCSI dir exists: /sys/bus/usb/devices/1-1.4.4.2
Warning: SCSI attribute "vendor" not readable.
Warning: SCSI attribute "model" not readable.
Warning: SCSI attribute "rev" not readable.
Use interface /sys/bus/usb/devices/1-1.4.4.2/1-1.4.4.2:1.0
----------------
USB values from sysfs:
idVendor 12d1
idProduct 1f01
manufacturer HUAWEI_MOBILE
product HUAWEI_MOBILE
serial 0123456789ABCDEF
bNumConfigurations 1
bConfigurationValue 1
devnum 6
busnum 1
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
Searching entries named: /usr/share/usb_modeswitch/12d1:1f01*
Searching overriding entries named: /etc/usb_modeswitch.d/12d1:1f01*
SCSI attributes not needed, move on.
Use overriden config 12d1:1f01 from collection /etc/usb_modeswitch.d
config: TargetVendor set to 12d1
config: TargetProduct set to 155f
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1
! matched, now switching
Unbinding driver
Command to be run:
/usr/sbin/usb_modeswitch -W -D -s 20 -c /etc/usb_modeswitch.d/12d1:1f01 -u -1 -b 1 -g 6 -v 12d1 -p 1f01 2>&1
Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are expected in the process)
--------------------------------
Read config file: /etc/usb_modeswitch.d/12d1:1f01
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.5.2 (C) Josua Dietze 2017
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x12d1
DefaultProduct= 0x1f01
TargetVendor= 0x12d1
TargetProduct= 0x155f
MessageContent="55534243123456780000000000000011063000000100010000000000000000"
Success check enabled, max. wait time 20 seconds
System integration mode enabled
Use given bus/device number: 001/006 ...
Look for default devices ...
bus/device number matched
found USB ID 12d1:1f01
vendor ID matched
product ID matched
Found devices in default mode (1)
Error opening the device. Abort
--------------------------------
(end of usb_modeswitch output)
USB dir exists: /sys/bus/usb/devices/1-1.4.4.2
Warning: USB attribute "product" not readable.
Warning: USB attribute "serial" not readable.
Warning: USB attribute "bNumConfigurations" not readable.
Warning: USB attribute "bConfigurationValue" not readable.
Warning: USB attribute "devnum" not readable.
Warning: USB attribute "busnum" not readable.
All done, exit
Code: Select all
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usbcore: registered new interface driver usbfs
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usbcore: registered new interface driver hub
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usbcore: registered new device driver usb
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usbcore: registered new interface driver lan78xx
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usbcore: registered new interface driver smsc95xx
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb1: Product: xHCI Host Controller
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb1: Manufacturer: Linux 5.4.0-1018-raspi xhci-hcd
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb1: SerialNumber: 0000:01:00.0
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.04
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb2: Product: xHCI Host Controller
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb2: Manufacturer: Linux 5.4.0-1018-raspi xhci-hcd
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb usb2: SerialNumber: 0000:01:00.0
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1: new high-speed USB device number 2 using xhci_hcd
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.20
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1: Product: USB2.0 Hub
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4: new high-speed USB device number 3 using xhci_hcd
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4: New USB device found, idVendor=2109, idProduct=2817, bcdDevice= 3.64
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4: Product: USB2.0 Hub
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4: Manufacturer: VIA Labs, Inc.
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4: new high-speed USB device number 4 using xhci_hcd
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4: New USB device found, idVendor=2109, idProduct=2817, bcdDevice=90.23
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4: Product: USB2.0 Hub
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4: Manufacturer: VIA Labs, Inc.
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb_phy_generic phy: phy supply vcc not found, using dummy regulator
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4.4: new high-speed USB device number 5 using xhci_hcd
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4.4: New USB device found, idVendor=2109, idProduct=2817, bcdDevice=90.23
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4.4: Product: USB2.0 Hub
Aug 06 23:14:47 sim-robot-office-pi-1 kernel: usb 1-1.4.4.4: Manufacturer: VIA Labs, Inc.
Aug 06 23:14:49 sim-robot-office-pi-1 kernel: usbcore: registered new interface driver brcmfmac
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: new high-speed USB device number 6 using xhci_hcd
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: New USB device found, idVendor=12d1, idProduct=1f01, bcdDevice= 1.02
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: Product: HUAWEI_MOBILE
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: Manufacturer: HUAWEI_MOBILE
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: SerialNumber: 0123456789ABCDEF
Sep 23 10:51:28 sim-robot-office-pi-1 systemd[1]: Created slice system-usb_modeswitch.slice.
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usb-storage 1-1.4.4.2:1.0: USB Mass Storage device detected
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: scsi host0: usb-storage 1-1.4.4.2:1.0
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usbcore: registered new interface driver usb-storage
Sep 23 10:51:28 sim-robot-office-pi-1 kernel: usbcore: registered new interface driver uas
Sep 23 10:51:28 sim-robot-office-pi-1 usb_modeswitch_dispatcher[1440]: Could not read attribute: No such file or directory
Sep 23 10:51:28 sim-robot-office-pi-1 usb_modeswitch_dispatcher[1440]: Could not read attribute: No such file or directory
Sep 23 10:51:29 sim-robot-office-pi-1 usb_modeswitch[1440]: usb_modeswitch: use overriden config 12d1:1f01 from collection /etc/usb_modeswitch.d; make sure this is intended
Sep 23 10:51:29 sim-robot-office-pi-1 usb_modeswitch[1440]: usb_modeswitch: please report any new or corrected settings; otherwise, check for outdated files
Sep 23 10:51:30 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: reset high-speed USB device number 6 using xhci_hcd
Sep 23 10:51:30 sim-robot-office-pi-1 usb_modeswitch_dispatcher[1440]: libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/006: No such device
Sep 23 10:51:30 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: device firmware changed
Sep 23 10:51:30 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: USB disconnect, device number 6
Sep 23 10:51:30 sim-robot-office-pi-1 usb_modeswitch_dispatcher[1440]: Could not read attribute: No such file or directory
Sep 23 10:51:30 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: new high-speed USB device number 7 using xhci_hcd
Sep 23 10:51:30 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: New USB device found, idVendor=12d1, idProduct=14db, bcdDevice= 1.02
Sep 23 10:51:30 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Sep 23 10:51:30 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: Product: HUAWEI_MOBILE
Sep 23 10:51:30 sim-robot-office-pi-1 kernel: usb 1-1.4.4.2: Manufacturer: HUAWEI_MOBILE
Sep 23 10:51:31 sim-robot-office-pi-1 kernel: cdc_ether 1-1.4.4.2:1.0 eth1: register 'cdc_ether' at usb-0000:01:00.0-1.4.4.2, CDC Ethernet Device, 00:1e:10:1f:00:00
Sep 23 10:51:31 sim-robot-office-pi-1 kernel: usbcore: registered new interface driver cdc_ether