Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
grawsom
Posts: 1
Joined: 29 Dec 2020, 16:35

E3372h-320 - switching works sometimes

Post by grawsom » 29 Dec 2020, 17:13

This is driving me crasy - just as I think it works - it just starts new errors.

Have been using E3372h-153, but now I can't get does anymore, so using -so must use 320 now, and when it switches correct the dongle works for my apps.

I have set the parameter HuaweiAltModeGlobal=1, and logfile=1, and if I connect the remove device after errors it switces ok - used dmesg --follow - see later in post
When starting up it sometimes don't do the switch to 155e but to 14db

2 things I are wondering about is in follow around 20 sec. it seems like the device resets
and in log file i get "libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/007: No such device"

I'm running on RPI - buster - modeswitch 2.5.2 - using modemmanager gui to easily see when it works.

Sorry - edit the post - later here logs from when it works

This is from dmesg --follow

Code: Select all

[   19.346127] usb 1-1.1.3: new high-speed USB device number 7 using dwc_otg
[   19.485048] usb 1-1.1.3: New USB device found, idVendor=12d1, idProduct=1f01, bcdDevice= 1.02
[   19.485061] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   19.485067] usb 1-1.1.3: Product: HUAWEI_MOBILE
[   19.485074] usb 1-1.1.3: Manufacturer: HUAWEI_MOBILE
[   19.485080] usb 1-1.1.3: SerialNumber: 0123456789ABCDEF
[   19.490702] usb-storage 1-1.1.3:1.0: USB Mass Storage device detected
[   19.496528] scsi host0: usb-storage 1-1.1.3:1.0
[   19.855543] usbcore: registered new interface driver uas
[   20.983448] Bluetooth: RFCOMM TTY layer initialized
[   20.983478] Bluetooth: RFCOMM socket layer initialized
[   20.983510] Bluetooth: RFCOMM ver 1.11
[   21.376455] usb 1-1.1.3: reset high-speed USB device number 7 using dwc_otg
[   21.506316] usb 1-1.1.3: device firmware changed
[   21.506572] usb 1-1.1.3: USB disconnect, device number 7
[   21.716175] usb 1-1.1.3: new high-speed USB device number 8 using dwc_otg
[   21.846878] usb 1-1.1.3: New USB device found, idVendor=12d1, idProduct=14db, bcdDevice= 1.02
[   21.846891] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   21.846898] usb 1-1.1.3: Product: HUAWEI_MOBILE
[   21.846904] usb 1-1.1.3: Manufacturer: HUAWEI_MOBILE
[   21.981320] cdc_ether 1-1.1.3:1.0 eth1: register 'cdc_ether' at usb-3f980000.usb-1.1.3, CDC Ethernet Device, 00:1e:10:1f:00:00
[   21.982818] usbcore: registered new interface driver cdc_ether
[   30.892864] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.eth1.retrans_time - use net.ipv6.neigh.eth1.retrans_time_ms instead
[   51.807941] usb 1-1.1.3: USB disconnect, device number 8
[   51.808247] cdc_ether 1-1.1.3:1.0 eth1: unregister 'cdc_ether' usb-3f980000.usb-1.1.3, CDC Ethernet Device
[   65.805811] logitech-hidpp-device 0003:046D:4061.0006: HID++ 4.5 device connected.
[   72.456180] usb 1-1.3.1: new full-speed USB device number 9 using dwc_otg
[   72.589327] usb 1-1.3.1: not running at top speed; connect to a high speed hub
[   72.599081] usb 1-1.3.1: New USB device found, idVendor=12d1, idProduct=1f01, bcdDevice= 1.02
[   72.599089] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   72.599096] usb 1-1.3.1: Product: HUAWEI_MOBILE
[   72.599102] usb 1-1.3.1: Manufacturer: HUAWEI_MOBILE
[   72.599107] usb 1-1.3.1: SerialNumber: 0123456789ABCDEF
[   72.605023] usb-storage 1-1.3.1:1.0: USB Mass Storage device detected
[   72.605416] scsi host0: usb-storage 1-1.3.1:1.0
[   73.512489] usb 1-1.3.1: USB disconnect, device number 9
[   74.256354] usb 1-1.3.1: new full-speed USB device number 10 using dwc_otg
[   74.390591] usb 1-1.3.1: not running at top speed; connect to a high speed hub
[   74.402836] usb 1-1.3.1: New USB device found, idVendor=12d1, idProduct=155e, bcdDevice= 1.02
[   74.402848] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   74.402855] usb 1-1.3.1: Product: HUAWEI_MOBILE
[   74.402861] usb 1-1.3.1: Manufacturer: HUAWEI_MOBILE
[   74.497220] usbcore: registered new interface driver usbserial_generic
[   74.497277] usbserial: USB Serial support registered for generic
[   74.521260] usbcore: registered new interface driver option
[   74.521307] usbserial: USB Serial support registered for GSM modem (1-port)
[   74.539600] cdc_ncm 1-1.3.1:1.3: MAC-Address: 00:1e:10:1f:00:00
[   74.539616] cdc_ncm 1-1.3.1:1.3: setting rx_max = 16384
[   74.542911] cdc_ncm 1-1.3.1:1.3 wwan0: register 'cdc_ncm' at usb-3f980000.usb-1.3.1, Mobile Broadband Network Device, 00:1e:10:1f:00:00
[   74.543971] usbcore: registered new interface driver cdc_ncm
[   74.544197] option 1-1.3.1:1.0: GSM modem (1-port) converter detected
[   74.544536] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB0
[   74.544716] option 1-1.3.1:1.1: GSM modem (1-port) converter detected
[   74.544962] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB1
[   74.545104] option 1-1.3.1:1.2: GSM modem (1-port) converter detected
[   74.545275] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB2
[   74.560316] usbcore: registered new interface driver cdc_wdm
[   74.563169] usbcore: registered new interface driver cdc_mbim
[  104.621704] cdc_ncm 1-1.3.1:1.3 wwan0: 150 mbit/s downlink 50 mbit/s uplink
[  104.687706] cdc_ncm 1-1.3.1:1.3 wwan0: network connection: connected
[  104.687781] IPv6: ADDRCONF(NETDEV_CHANGE): wwan0: link becomes ready
[ 1659.569203] usb 1-1.3.1: USB disconnect, device number 10
[ 1659.570126] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[ 1659.570235] option 1-1.3.1:1.0: device disconnected
[ 1659.573814] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[ 1659.573931] option 1-1.3.1:1.1: device disconnected
[ 1659.575247] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[ 1659.575415] option 1-1.3.1:1.2: device disconnected
[ 1659.575879] cdc_ncm 1-1.3.1:1.3 wwan0: unregister 'cdc_ncm' usb-3f980000.usb-1.3.1, Mobile Broadband Network Device
[ 1708.305112] usb 1-1.3.1: new full-speed USB device number 11 using dwc_otg
[ 1708.438344] usb 1-1.3.1: not running at top speed; connect to a high speed hub
[ 1708.449350] usb 1-1.3.1: New USB device found, idVendor=12d1, idProduct=1f01, bcdDevice= 1.02
[ 1708.449363] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1708.449372] usb 1-1.3.1: Product: HUAWEI_MOBILE
[ 1708.449381] usb 1-1.3.1: Manufacturer: HUAWEI_MOBILE
[ 1708.449391] usb 1-1.3.1: SerialNumber: 0123456789ABCDEF
[ 1708.455421] usb-storage 1-1.3.1:1.0: USB Mass Storage device detected
[ 1708.456403] scsi host0: usb-storage 1-1.3.1:1.0
[ 1709.361488] usb 1-1.3.1: USB disconnect, device number 11
[ 1710.095050] usb 1-1.3.1: new full-speed USB device number 12 using dwc_otg
[ 1710.229480] usb 1-1.3.1: not running at top speed; connect to a high speed hub
[ 1710.239105] usb 1-1.3.1: New USB device found, idVendor=12d1, idProduct=155e, bcdDevice= 1.02
[ 1710.239124] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1710.239135] usb 1-1.3.1: Product: HUAWEI_MOBILE
[ 1710.239145] usb 1-1.3.1: Manufacturer: HUAWEI_MOBILE
[ 1710.241616] option 1-1.3.1:1.0: GSM modem (1-port) converter detected
[ 1710.242135] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB0
[ 1710.242617] option 1-1.3.1:1.1: GSM modem (1-port) converter detected
[ 1710.242928] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB1
[ 1710.243348] option 1-1.3.1:1.2: GSM modem (1-port) converter detected
[ 1710.243645] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB2
[ 1710.268226] cdc_ncm 1-1.3.1:1.3: MAC-Address: 00:1e:10:1f:00:00
[ 1710.268245] cdc_ncm 1-1.3.1:1.3: setting rx_max = 16384
[ 1710.271596] cdc_ncm 1-1.3.1:1.3 wwan0: register 'cdc_ncm' at usb-3f980000.usb-1.3.1, Mobile Broadband Network Device, 00:1e:10:1f:00:00
[ 1739.476717] cdc_ncm 1-1.3.1:1.3 wwan0: 150 mbit/s downlink 50 mbit/s uplink
[ 1739.542770] cdc_ncm 1-1.3.1:1.3 wwan0: network connection: connected
[ 1739.542966] IPv6: ADDRCONF(NETDEV_CHANGE): wwan0: link becomes ready

This is from usb_modeswitch log file

Code: Select all

USB_ModeSwitch log from Tue Dec 29 14:13:00 CET 2020

Use global config file: /etc/usb_modeswitch.conf
Adjust delay for USB storage devices ...
 Delay set to 4 seconds

Raw parameters: {--switch-mode} {1-1.3.1:1.0} 
Use top device dir /sys/bus/usb/devices/1-1.3.1
Check class of first interface ...
 Interface 0 class is 08.

----------------
USB values from sysfs:
  manufacturer	HUAWEI_MOBILE
  product	HUAWEI_MOBILE
  serial	0123456789ABCDEF
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
ConfigList: pack/12d1:1f01 pack/
SCSI attributes not needed, move on
Check config: pack/12d1:1f01
! matched. Read config data
Extract config 12d1:1f01 from collection /usr/share/usb_modeswitch/configPack.tar.gz
Alternative Huawei mode set globally, modify config
Command line:
usb_modeswitch -W -D -u -1 -b 1 -g 7 -v 12d1 -p 1f01 -f $flags(config)

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/007: No such device

Read long config from command line

 * 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
TargetProductList="14db,14dc"
HuaweiAltMode=1
System integration mode enabled

Use given bus/device number: 001/007 ...
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)

Device directory in sysfs is gone! Something went wrong, abort

usb_modeswitch - that works

Code: Select all

USB_ModeSwitch log from Mon Dec 28 22:36:37 CET 2020

Use global config file: /etc/usb_modeswitch.conf
Raw parameters: {--switch-mode} {1-1.3.1:1.0} 
Use top device dir /sys/bus/usb/devices/1-1.3.1
Check class of first interface ...
 Interface 0 class is 08.

----------------
USB values from sysfs:
  manufacturer	HUAWEI_MOBILE
  product	HUAWEI_MOBILE
  serial	0123456789ABCDEF
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
ConfigList: pack/12d1:1f01 pack/
SCSI attributes not needed, move on
Check config: pack/12d1:1f01
! matched. Read config data
Extract config 12d1:1f01 from collection /usr/share/usb_modeswitch/configPack.tar.gz
Alternative Huawei mode set globally, modify config
Command line:
usb_modeswitch -W -D -u -1 -b 1 -g 7 -v 12d1 -p 1f01 -f $flags(config)

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------

Read long config from command line

 * 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
TargetProductList="14db,14dc"
HuaweiAltMode=1
System integration mode enabled

Use given bus/device number: 001/007 ...
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)
Get the current device configuration ...
Use interface number 0
 with class 8
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI_MOBILE
     Product: HUAWEI_MOBILE
  Serial No.: 0123456789ABCDEF
-------------------------
Using alternative Huawei switching message
Looking for active drivers ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Read the response to message 1 (CSW) ...
 Response reading failed (error -9)
 Device is gone, skip any further commands
ok:busdev
--------------------------------
(end of usb_modeswitch output)

Check success of mode switch for max. 20 seconds ...
 Read attributes ...
 Alternative target attributes found, assume success
Mode switching was successful, found 12d1:155e (HUAWEI_MOBILE: HUAWEI_MOBILE)
Logger is /usr/bin/logger
Serial USB driver bound to interface 0
 will try to guess and symlink modem port on next connect
Check for AVOID_RESET_QUIRK kernel attribute
 AVOID_RESET_QUIRK activated

All done, exit




Regards
- Ivan

ValdikSS
Posts: 4
Joined: 12 Apr 2021, 22:53

Re: E3372h-320 - switching works sometimes

Post by ValdikSS » 12 Apr 2021, 23:17

E3372-320, E8372-320 and other newer modems with firmware version 10.x.x.x try to automatically detect PC operating system (Linux/macOS or Windows) and switch the mode accordingly. This is done by detecting USB Get Max LUN request from the operating system to device's CD-ROM.

Automatic switching creates race condition, complicating operating system-driven switching to other modes (NCM, for example).

To prevent this behaviour on Linux (for example, on the router running OpenWRT), one should set SINGLE_LUN quirk for usb-storage module.

Code: Select all

# cat /etc/modprobe.d/huawei-noprobe.conf

options usb-storage quirks=12d1:1f01:s

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: E3372h-320 - switching works sometimes

Post by Josh » 18 Apr 2021, 09:55

Hmm, this suggestion should probably go to distribution maintainers.

What do you think? Should I add this modconf file to the usb_modeswitch distribution and explain the issue in the Changelog?

adamusa
Posts: 3
Joined: 13 Nov 2023, 05:20

Re: E3372h-320 - switching works sometimes

Post by adamusa » 13 Nov 2023, 05:23

The E3372h-320 is a 4G LTE cellular modem that supports 2G, 3G and 4G bands. Sometimes, this modem can switch operations mapquest directions from 4G to 3G or 2G.

Kesanti88
Posts: 2
Joined: 11 Mar 2024, 21:03

Re: E3372h-320 - switching works sometimes

Post by Kesanti88 » 11 Mar 2024, 21:13

ValdikSS wrote: 12 Apr 2021, 23:17 E3372-320, E8372-320 and other newer modems with firmware version 10.x.x.x try to automatically detect PC operating system (Linux/macOS or Windows) and switch the mode accordingly. This is done by detecting USB Get Max LUN request from the operating dreadhead parkour system to device's CD-ROM.

Automatic switching creates race condition, complicating operating system-driven switching to other modes (NCM, for example).

To prevent this behaviour on Linux (for example, on the router running OpenWRT), one should set SINGLE_LUN quirk for usb-storage module.

Code: Select all

# cat /etc/modprobe.d/huawei-noprobe.conf

options usb-storage quirks=12d1:1f01:s
Looks like those modems are trying to outsmart the system! Setting the SINGLE_LUN quirk sounds like a clever way to keep them in line. Who knew modems could be so cheeky?

Post Reply