I'm trying to get an e8372h-320 into mode 0x14db, but every time it immediately switches BACK to 0x1f01
Here are the changes I've made from default:
usb_modeswitch.conf
Code: Select all
[21.05-RELEASE][admin@xxxxx]/usr/local/etc: cat usb_modeswitch.conf
# Configuration for the usb_modeswitch package, a mode switching tool for
# USB devices providing multiple states or modes
#
# Evaluated by the wrapper script /usr/sbin/usb_modeswitch_dispatcher
#
# To enable an option, set it to "1", "yes" or "true" (case doesn't matter)
# Everything else counts as "disable"
# Disable automatic mode switching globally (e.g. to access the original
# install storage)
DisableSwitching=1
# Disable check for MBIM module presence and configuration globally (to aid
# special embedded environments). Available as per-device parameter
# 'NoMBIMCheck'
DisableMBIMGlobal=0
# Enable logging (results in a extensive report file in /var/log, named
# "usb_modeswitch_<interface-name>" and probably others
EnableLogging=1
# Optional increase of "delay_use" for the usb-storage driver; there are hints
# that a recent kernel default change to 1 sec. may lead to problems, particu-
# larly with USB 3.0 ports. Set this to at least 3 (seconds) in that case.
# Does nothing if the current system value is same or higher
#SetStorageDelay=4
# If the configuration for your Huawei modem uses the standard switching method,
# you can globally set an alternative method here which provides a different mode:
# either plain serial PPP (for older modems) or NCM which integrates nicely
# with recent Linux distributions, possibly avoiding configuration through a
# modem built-in web page. All other modems are not affected.
# Available as per-device parameter 'AltHuaweiMode'
HuaweiAltModeGlobal=0
Code: Select all
[21.05-RELEASE][admin@xxxxx]/usr/local/etc/usb_modeswitch.d: cat 12d1:1f01
# Huawei E353 (3.se) and others
DefaultVendor= 0x12d1
DefaultProduct= 0x1f01
TargetVendor=0x12d1
TargetProductList="14db,14dc"
HuaweiNewMode=1
Code: Select all
[21.05-RELEASE][admin@xxxxx]/usr/local/sbin: ./lsusb -d 0x12d1:
Bus /dev/usb Device /dev/ugen0.2: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)
Here's what happens when I attempt to switch modes:
command
Code: Select all
[21.05-RELEASE][admin@xxxxx]/usr/local/sbin: usb_modeswitch -W -D -c /usr/local/etc/usb_modeswitch.d/12d1:1f01
Read config file: /usr/local/etc/usb_modeswitch.d/12d1:1f01
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.6.0 (C) Josua Dietze 2017
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x12d1
DefaultProduct= 0x1f01
TargetVendor= 0x12d1
TargetProductList="14db,14dc"
HuaweiNewMode=1
System integration mode enabled
Look for target devices ...
found USB ID 0000:0000
found USB ID 0000:0000
found USB ID 12d1:1f01
vendor ID matched
No devices in target mode or class found
Look for default devices ...
found USB ID 0000:0000
found USB ID 0000:0000
found USB ID 12d1:1f01
vendor ID matched
product ID matched
Found devices in default mode (1)
Access device 002 on bus 000
Get the current device configuration ...
Current configuration number is 1
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 standard 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 ...
LIBUSB_FUNCTION: libusb_bulk_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer leave 0
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter
LIBUSB_FUNCTION: libusb10_handle_events_sub enter
LIBUSB_TRANSFER: sync I/O done
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit
LIBUSB_FUNCTION: libusb_bulk_transfer leave
OK, message successfully sent
Read the response to message 1 (CSW) ...
LIBUSB_FUNCTION: libusb_bulk_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer leave 0
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter
LIBUSB_FUNCTION: libusb10_handle_events_sub enter
LIBUSB_TRANSFER: sync I/O done
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit
LIBUSB_FUNCTION: libusb_bulk_transfer leave
Response reading failed (error -99)
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
Code: Select all
[21.05-RELEASE][admin@xxxxx]/usr/local/sbin: ./lsusb -d 0x12d1:
Bus /dev/usb Device /dev/ugen0.2: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)
Code: Select all
[21.05-RELEASE][admin@xxxxx]/usr/local/sbin: dmesg | tail -n 150
(blah blah blah, here's the important bit...)
umass0: at uhub0, port 2, addr 1 (disconnected)
cd0 at umass-sim0 bus 0 scbus1 target 0 lun 0
cd0: <HUAWEI Mass Storage 2.31> s/n 0123456789ABCDEF detached
(cd0:umass-sim0:0:0:0): Periph destroyed
umass0: detached
ugen0.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus0 (disconnected)
ugen0.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus0
cdce0 on uhub0
cdce0: <CDC Ethernet Control Model (ECM)> on usbus0
ue0: <USB Ethernet> on cdce0
ue0: Ethernet address: 00:1e:10:1f:00:00
ugen0.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus0 (disconnected)
cdce0: at uhub0, port 2, addr 1 (disconnected)
cdce0: detached
ugen0.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus0
umass0 on uhub0
umass0: <Mass Storage> on usbus0
cd0 at umass-sim0 bus 0 scbus1 target 0 lun 0
cd0: <HUAWEI Mass Storage 2.31> Removable CD-ROM SCSI-2 device
cd0: Serial Number 0123456789ABCDEF
cd0: 40.000MB/s transfers
cd0: 7MB (3584 2048 byte sectors)
cd0: quirks=0x10<10_BYTE_ONLY>
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d c1 00 00 04 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdc1
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d fe 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdfe
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d fe 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdfe
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d c1 00 00 04 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdc1
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d fe 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdfe
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d fe 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdfe
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
Code: Select all
[21.05-RELEASE][admin@xxxxx]/usr/local/sbin: ./lsusb -v -d 0x12d1:
Bus /dev/usb Device /dev/ugen0.2: ID 12d1:14db Huawei Technologies Co., Ltd. E353/E3131
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x12d1 Huawei Technologies Co., Ltd.
idProduct 0x14db E353/E3131
bcdDevice 1.02
iManufacturer 1 HUAWEI_MOBILE
iProduct 2 HUAWEI_MOBILE
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 88
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 2mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 2 Communications
bFunctionSubClass 6 Ethernet Networking
bFunctionProtocol 0
iFunction 8 CDC ECM
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 6 Ethernet Networking
bInterfaceProtocol 0
iInterface 5 CDC Ethernet Control Model (ECM)
CDC Header:
bcdCDC 1.10
CDC Union:
bMasterInterface 0
bSlaveInterface 1
CDC Ethernet:
iMacAddress 7 001E101F0000
bmEthernetStatistics 0x00000000
wMaxSegmentSize 1514
wNumberMCFilters 0x0000
bNumberPowerFilters 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 5
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 6 CDC Ethernet Data
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
can't get debug descriptor: Input/output error
Device Status: 0x0001
Self Powered
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 22
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000002
Link Power Management (LPM) Supported
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
Latency Tolerance Messages (LTM) Supported
wSpeedsSupported 0x000f
Device can operate at Low Speed (1Mbps)
Device can operate at Full Speed (12Mbps)
Device can operate at High Speed (480Mbps)
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 0
Lowest fully-functional device speed is Low Speed (1Mbps)
bU1DevExitLat 1 micro seconds
bU2DevExitLat 500 micro seconds
One thing I did see in another post was the following comment:
Someone please correct me if I'm wrong with this, but I believe the equivalent in FreeBSD is the following:ValdikSS wrote: ↑12 Apr 2021, 23:05
Do you have a modem of a newer modification, like E8372h-320 or -820 with firmware 10.x.x.x?
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
Code: Select all
[21.05-RELEASE][admin@xxxxx]/boot: cat loader.conf.local
hw.usb.quirk.0="0x12d1 0x1f01 0 0xffff UQ_MSC_NO_GETMAXLUN"
I would like to post logs from usb_modeswitch itself, but for some reason it's not producing logfiles at all. As you can see from the config above, logging is enabled, but...
Code: Select all
[21.05-RELEASE][admin@xxxxx]/: find . | grep "usb_modeswitch_"
[21.05-RELEASE][admin@xxxxx]/:
So, that's all I got. Am I missing anything simple that I'll kick myself for, or is there any additional info I can provide that might help?
Any ideas or assistance would be hugely appreciated.