|
Automatic Activation, Hotplug and UDEV, Configuration
-
Facon
- Posts: 4
- Joined: 07 May 2021, 16:22
Post
by Facon » 07 May 2021, 16:35
Dear all,
I'm trying to configure the Huawei E3372h-153 4G stick on a Raspberry PI running Raspbian 10. I saw many people succeeding in this, but I keep having issue. My 'lsusb' output is:
Code: Select all Bus 001 Device 004: ID 046d:c044 Logitech, Inc. LX3 Optical Mouse
Bus 001 Device 009: ID 12d1:15d6 Huawei Technologies Co., Ltd.
Bus 001 Device 005: ID 03f0:0024 HP, Inc KU-0316 Keyboard
Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
What puzzles me is that the Huawei dongle is recognized with productID 15d6. I looked in the data repository and I don't seem to find any device with such product ID. I tried using the configuration for the newer modem versions manually with: 'sudo usb_modeswitch -v 12d1 -p 15d6 -V 12d1 -P 1001 -C 2 -M '55534243123456780000000000000011062000000100000000000000000000' -W' and what I get is:
Code: Select all
* 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= 0x15d6
TargetVendor= 0x12d1
TargetProduct= 0x1001
TargetClass= 0x02
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
Look for target devices ...
found USB ID 046d:c044
found USB ID 12d1:15d6
vendor ID matched
found USB ID 03f0:0024
found USB ID 0424:7800
found USB ID 0424:2514
found USB ID 0424:2514
found USB ID 1d6b:0002
No devices in target mode or class found
Look for default devices ...
found USB ID 046d:c044
found USB ID 12d1:15d6
vendor ID matched
product ID matched
device class 08 not matching target
count device
found USB ID 03f0:0024
found USB ID 0424:7800
found USB ID 0424:2514
found USB ID 0424:2514
found USB ID 1d6b:0002
Found devices in default mode (1)
Access device 009 on bus 001
Get the current device configuration ...
Current configuration number is 2
Use interface number 0
with class 2
Error: can't use storage command in MessageContent with interface 0; interface class is 2, expected 8. Abort
Do you have any suggestions on how to get the modem properly recognized, and use it with wvdial?
I'll be forever thankful to anyone who has suggestions
-
LOM
- Posts: 1404
- Joined: 11 Jul 2012, 15:14
- Location: Koh Samui, TH
Post
by LOM » 08 May 2021, 06:10
12d1:15d6 is a new USB Id which most likely when switched will switch into 12d1:15d7.
It looks like 12d1:15d6 has 2 configurations and will by default enter the second config which is an MBIM configuration.
You can stop it from entering this config by editing /etc/usb_modeswitch.conf and change DisableMBIMGlobal from 0 to 1, this will after you replug the dongle allow you to manually switch it from the cmdline:
sudo usb_modeswitch -v 12d1 -p 15d6 -M "55534243123456780000000000000011062000000101000100000000000000" -W
please show me the output from:
sudo lsusb -vd 12d1:15d6 before the dongle is switched
and from:
sudo lsusb -vd 12d1:15d7 (?) after you have manually switched the dongle
-
Facon
- Posts: 4
- Joined: 07 May 2021, 16:22
Post
by Facon » 08 May 2021, 11:19
Thanks a lot LOM,
I had to leave everything at work yesterday, I'll test it on Monday as soon as possible!
Just out of curiosity, how do you know that the new ID will be 15d7? Is that just because there are 2 configurations and switching to the second gives a +1?
-
LOM
- Posts: 1404
- Joined: 11 Jul 2012, 15:14
- Location: Koh Samui, TH
Post
by LOM » 08 May 2021, 15:05
Facon wrote: ↑08 May 2021, 11:19
Just out of curiosity, how do you know that the new ID will be 15d7? Is that just because there are 2 configurations and switching to the second gives a +1?
I don't know that it will switch to 15d7, it is just an advanced guess but it is not related to the number of configs.
You will see what it becomes, a simple lsusb will tell you and you don't need the switched Id/destination Id on the cmd line, the initial Id is what is needed for usb_modeswitch to switch it.
-
Facon
- Posts: 4
- Joined: 07 May 2021, 16:22
Post
by Facon » 10 May 2021, 09:58
Hi LOM,
I did as you said and here's the 'lsusb -vd 12d1:15d6' before:
Code: Select all Bus 001 Device 010: ID 12d1:15d6 Huawei Technologies Co., Ltd.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.10
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 255
bMaxPacketSize0 64
idVendor 0x12d1 Huawei Technologies Co., Ltd.
idProduct 0x15d6
bcdDevice 1.02
iManufacturer 1 HUAWEI_MOBILE
iProduct 2 HUAWEI_MOBILE
iSerial 3 0123456789ABCDEF
bNumConfigurations 2
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk-Only
iInterface 4 Mass Storage
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 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 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0076
bNumInterfaces 3
bConfigurationValue 2
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 2mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 2 Communications
bFunctionSubClass 14
bFunctionProtocol 0
iFunction 8 Huawei E3372 Mobile Device
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 14
bInterfaceProtocol 0
iInterface 5 NCM Network Control Model
CDC Header:
bcdCDC 1.10
CDC MBIM:
bcdMBIMVersion 1.00
wMaxControlMessage 1024
bNumberFilters 32
bMaxFilterSize 128
wMaxSegmentSize 1500
bmNetworkCapabilities 0x20
8-byte ntb input size
CDC MBIM Extended:
bcdMBIMExtendedVersion 1.00
bMaxOutstandingCommandMessages 16
wMTU 1500
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 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
bInterfaceProtocol 2
iInterface 6 CDC Network Data
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 2
iInterface 6 CDC Network Data
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 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 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk-Only
iInterface 4 Mass Storage
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 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 1
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x0016
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000002
HIRD Link Power Management (LPM) Supported
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
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 1
Lowest fully-functional device speed is Full Speed (12Mbps)
bU1DevExitLat 1 micro seconds
bU2DevExitLat 500 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
Self Powered
After running the command I got:
Code: Select all Take all parameters from the 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= 0x15d6
MessageContent="55534243123456780000000000000011062000000101000100000000000000"
Look for default devices ...
found USB ID 046d:c044
found USB ID 12d1:15d6
vendor ID matched
product ID matched
found USB ID 03f0:0024
found USB ID 0424:7800
found USB ID 0424:2514
found USB ID 0424:2514
found USB ID 1d6b:0002
Found devices in default mode (1)
Access device 011 on bus 001
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
-------------------------
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 successfully read (13 bytes), status 0
Reset response endpoint 0x81
libusb: error [op_clear_halt] clear_halt failed error -1 errno 71
Could not reset endpoint (probably harmless): -99
Reset message endpoint 0x01
libusb: error [op_clear_halt] clear_halt failed error -1 errno 71
Could not reset endpoint (probably harmless): -99
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
Indeed now the dongle appears as 12d1:15d7 and the 'lsusb -vd 12d1:15d7' command gives me:
Code: Select all Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.10
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x12d1 Huawei Technologies Co., Ltd.
idProduct 0x15d7
bcdDevice 1.02
iManufacturer 1 HUAWEI_MOBILE
iProduct 2 HUAWEI_MOBILE
iSerial 3 0123456789ABCDEF
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x00dd
bNumInterfaces 5
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 2
bInterfaceProtocol 18
iInterface 0
** UNRECOGNIZED: 05 24 00 10 01
** UNRECOGNIZED: 04 24 02 02
** UNRECOGNIZED: 05 24 01 00 00
** UNRECOGNIZED: 05 24 06 00 00
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
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 2
bInterfaceProtocol 1
iInterface 0
** UNRECOGNIZED: 05 24 00 10 01
** UNRECOGNIZED: 04 24 02 02
** UNRECOGNIZED: 05 24 01 00 01
** UNRECOGNIZED: 05 24 06 00 00
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x000a 1x 10 bytes
bInterval 9
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 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 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 2
bInterfaceProtocol 22
iInterface 5 NCM Network Control Model
** UNRECOGNIZED: 05 24 00 10 01
** UNRECOGNIZED: 06 24 1a 00 01 1f
** UNRECOGNIZED: 0d 24 0f 07 0f 00 00 00 ea 05 03 00 01
** UNRECOGNIZED: 05 24 06 02 02
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x86 EP 6 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 2
bAlternateSetting 1
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 2
bInterfaceProtocol 22
iInterface 6 CDC Network Data
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x86 EP 6 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 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 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk-Only
iInterface 4 Mass Storage
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x87 EP 7 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 0x05 EP 5 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 4
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk-Only
iInterface 4 Mass Storage
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x88 EP 8 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 0x06 EP 6 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x0016
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000002
HIRD Link Power Management (LPM) Supported
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
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 1
Lowest fully-functional device speed is Full Speed (12Mbps)
bU1DevExitLat 1 micro seconds
bU2DevExitLat 500 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
Self Powered
It seems like the command worked! Thanks! How can I tell if I can properly communicate with the device? I'm looking for something like /dev/gsmmodem, in order to add it to the wvdial configuration, but I'm not seeing anything like that..
-
LOM
- Posts: 1404
- Joined: 11 Jul 2012, 15:14
- Location: Koh Samui, TH
Post
by LOM » 10 May 2021, 12:06
Thanks for the device composition listings, this is the interface usage for 12d1:15d7
MI_00 HUAWEI Mobile Connect - 3G PC UI Interface
MI_01 HUAWEI Mobile Connect - 3G Modem
MI_02 HUAWEI Mobile Connect - 3G Network Card (huawei_cdc_ncm)
MI_03 USB Mass Storage Device
MI_04 USB Mass Storage Device
The link creation for /dev/gsmmodem may be broken or removed, it was never 100% reliable anyway.
ttyUSB0 will be your AT-cmd device and ttyUSB1 your modem data device.
12d1:15d6 has only 1 interface in config#1, the virtual cd-rom drive which we send the switch message to.
The virtual CD-ROM contains MS Windows drivers + connection manager and I would be happy if you could extract the .inf files from the driver pack.
Everything may be packed in a big .exe file but the files within can be extracted with 7-zip for instance.
Your dongle is new and the driver .inf files must be of a version I don't have and they probably cover more new dongles in the 12d1:15cx/15dx/15ex series.
-
Facon
- Posts: 4
- Joined: 07 May 2021, 16:22
Post
by Facon » 10 May 2021, 18:43
Hi LOM,
sorry, I'm very noob with all of this. I've tried setting up the connection with wvdial, which has been kind of a pain to get to work and it's still not always working properly.
I noticed that when wvdial is running I indeed see a ppp0 connection, but even without, I see a wwan0 connection, if I run 'ifconfig', and I see some IP addresses. Is it possible that I should just try to configure wwan0, without dealing with the whole wvdial stuff? Of course the wwan0 network is not working out of the box, and this is reasonable, as I haven't even specified an APN for it, but is there a way to configure it directly?
Also, concerning the MS Windows drivers, I'm not sure how I could extract the .inf files, and, by the way, would that even be legal? These I believe are some proprietary drivers, they will probably have some kind of copyrights attached!
-
LOM
- Posts: 1404
- Joined: 11 Jul 2012, 15:14
- Location: Koh Samui, TH
Post
by LOM » 12 May 2021, 09:31
The wwan0 device is created from interface #2, the network interface driven by the huawei_cdc_ncm driver, it is a high speed direct connection protocol vs the low speed serial modem dialup protocol.
Your system log will show you driver bindings and the result of them.
If you don't want to use direct network connection then rename the driver, thast will stop it from binding.
|
|