Author Message

<  Setup Discussion  ~  Raspian Jessie and Huawei E3533

PostPosted: Wed Aug 09, 2017 9:27 pm Reply with quote
Posts: 6 Joined: Wed Aug 09, 2017 8:50 pm
Hi,

I'm trying to get usb_modeswitch to work with my E3533.

I started out with a clean Raspberry PI 3B with the freshest image, and then updated and upgraded. That left me with usb_modeswitch version 2.2.0:

Code:
pi@raspberrypi:~$ lsusb
Bus 001 Device 019: ID 12d1:157d Huawei Technologies Co., Ltd.
Bus 001 Device 017: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Code:
pi@raspberrypi:~$ dmesg
...
[  115.466625] usb 1-1.5: new high-speed USB device number 4 using dwc_otg
[  115.598073] usb 1-1.5: New USB device found, idVendor=12d1, idProduct=157d
[  115.598086] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  115.598094] usb 1-1.5: Product: HUAWEI Mobile
[  115.598102] usb 1-1.5: Manufacturer: HUAWEI
[  115.598110] usb 1-1.5: SerialNumber: FFFFFFFFFFFFFFFF
[  115.705873] usb-storage 1-1.5:1.0: USB Mass Storage device detected
[  115.706750] scsi host0: usb-storage 1-1.5:1.0
[  116.448193] usb 1-1.5: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[  116.652670] usbcore: registered new interface driver cdc_ncm
[  116.656984] usbcore: registered new interface driver cdc_wdm
[  116.806715] usb usb1-port1: disabled by hub (EMI?), re-enabling...
[  116.806741] usb 1-1: USB disconnect, device number 2
[  116.806752] usb 1-1.1: USB disconnect, device number 3
[  116.807063] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet
[  116.807113] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[  116.867417] usb 1-1.5: USB disconnect, device number 4
[  121.686666] cdc_mbim 1-1.5:2.0: SET_NTB_FORMAT failed
[  121.706761] cdc_mbim 1-1.5:2.0: bind() failure
[  121.706950] usbcore: registered new interface driver cdc_mbim
[  121.906676] Indeed it is in host mode hprt0 = 00001501
[  122.106619] usb 1-1: new high-speed USB device number 5 using dwc_otg
[  122.106745] Indeed it is in host mode hprt0 = 00001101
[  122.336870] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[  122.336882] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  122.337724] hub 1-1:1.0: USB hub found
[  122.337818] hub 1-1:1.0: 5 ports detected
[  122.656628] usb 1-1.1: new high-speed USB device number 6 using dwc_otg
[  122.786878] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[  122.786889] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  122.789762] smsc95xx v1.0.5
[  122.880515] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:bd:84:da
[  124.058777] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[  124.059173] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  127.206625] usb 1-1.5: new high-speed USB device number 7 using dwc_otg
[  127.338186] usb 1-1.5: New USB device found, idVendor=12d1, idProduct=157d
[  127.338199] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  127.338207] usb 1-1.5: Product: HUAWEI Mobile
[  127.338215] usb 1-1.5: Manufacturer: HUAWEI
[  127.338222] usb 1-1.5: SerialNumber: FFFFFFFFFFFFFFFF
[  127.419543] usb-storage 1-1.5:1.0: USB Mass Storage device detected
[  127.419887] scsi host0: usb-storage 1-1.5:1.0
[  128.179440] usb 1-1.5: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[  128.556743] usb usb1-port1: disabled by hub (EMI?), re-enabling...
[  128.556765] usb 1-1: USB disconnect, device number 5
[  128.556777] usb 1-1.1: USB disconnect, device number 6
[  128.557094] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet
[  128.557146] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[  128.607691] usb 1-1.5: USB disconnect, device number 7
[  133.446679] cdc_mbim 1-1.5:2.0: SET_NTB_FORMAT failed
[  133.466671] cdc_mbim 1-1.5:2.0: bind() failure
...repeating SET_NTB_FOMRAT_FAILED and so on...


and
Code:
pi@raspberrypi:~$ cat /var/log/usb_modeswitch_1-1.5\:1.0

USB_ModeSwitch log from Wed Aug 09 20:32:40 CEST 2017

Use global config file: /etc/usb_modeswitch.conf

Started via systemd
Raw args from udev: /1/1.5:1.0

Use top device dir /sys/bus/usb/devices/1-1.5

----------------
USB values from sysfs:
  manufacturer  HUAWEI
  product       HUAWEI Mobile
  serial        FFFFFFFFFFFFFFFF
----------------
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
ConfigList: pack/12d1:157d pack/12d1:#linux
SCSI attributes not needed, move on
Check config: pack/12d1:157d
! matched. Read config data
Extract config 12d1:157d from collection /usr/share/usb_modeswitch/configPack.tar.gz
config: TargetVendor set to 12d1
config: TargetProduct set to 14db
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Device may have an MBIM configuration, check driver ...
 driver for MBIM devices is available
Find MBIM configuration number ...
Command to be run:
usb_modeswitch -W -D -s 20  -b 1 -g 36 -v 12d1 -p 157d -f $configBuffer
pi@raspberrypi:~$


It didn't appear anything else in that log file.

No success, grabbed the freshest usb_modeswitch + data, version 2.5.1 and re-enabled logging in /etc/usb_modeswitch.conf:

Code:
pi@raspberrypi:~$ lsusb
Bus 001 Device 004: ID 12d1:157d Huawei Technologies Co., Ltd.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~$


Code:
pi@raspberrypi:~$ dmesg
[   40.546262] usb 1-1.5: new high-speed USB device number 4 using dwc_otg
[   40.677693] usb 1-1.5: New USB device found, idVendor=12d1, idProduct=157d
[   40.677705] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   40.677713] usb 1-1.5: Product: HUAWEI Mobile
[   40.677721] usb 1-1.5: Manufacturer: HUAWEI
[   40.677729] usb 1-1.5: SerialNumber: FFFFFFFFFFFFFFFF
[   40.724403] usb-storage 1-1.5:1.0: USB Mass Storage device detected
[   40.725361] scsi host0: usb-storage 1-1.5:1.0
[   41.795042] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[   41.848982] sr 0:0:0:0: [sr0] scsi-1 drive
[   41.848993] cdrom: Uniform CD-ROM driver Revision: 3.20
[   41.849959] sr 0:0:0:0: Attached scsi CD-ROM sr0
[   41.858354] sr 0:0:0:0: Attached scsi generic sg0 type 5
[   44.539092] sr 0:0:0:0: [sr0] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[   44.539110] sr 0:0:0:0: [sr0] tag#0 Sense Key : 0x3 [current]
[   44.539121] sr 0:0:0:0: [sr0] tag#0 ASC=0x11 ASCQ=0x0
[   44.539135] sr 0:0:0:0: [sr0] tag#0 CDB: opcode=0x28 28 00 00 00 ff fe 00 00 02 00
[   44.539145] blk_update_request: critical medium error, dev sr0, sector 262136
[   44.544953] sr 0:0:0:0: [sr0] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[   44.544964] sr 0:0:0:0: [sr0] tag#0 Sense Key : 0x3 [current]
[   44.544986] sr 0:0:0:0: [sr0] tag#0 ASC=0x11 ASCQ=0x0
[   44.545005] sr 0:0:0:0: [sr0] tag#0 CDB: opcode=0x28 28 00 00 00 ff fe 00 00 02 00
[   44.545029] blk_update_request: critical medium error, dev sr0, sector 262136
[   44.545050] Buffer I/O error on dev sr0, logical block 32767, async page read


There was nothing related to usb_modeswitch in /var/log (I double-checked that logging was enabled).

So my guess is that it didn't trigger.

There is a config that matches the USB id in /usr/share/usb_modeswitch:
Code:
pi@raspberrypi:/usr/share/usb_modeswitch$ cat 12d1\:157d
# Huawei E3331, E3372
TargetVendor=0x12d1
TargetProductList="14db,14dc"
HuaweiNewMode=1


And a rule that I think might apply in usb_modeswitch.rules:

Code:
# Generic entry for most Huawei devices, excluding Android phones
ATTRS{idVendor}=="12d1", ATTRS{manufacturer}!="Android", ATTR{bInterfaceNumber}=="00", ATTR{bInterfaceClass}=="08", RUN+="usb_modeswitch '%b/%k'"


I also tried adding a dedicated rule:
Code:
# Huawei E3533
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="157d", RUN+="usb_modeswitch '%b/%k'"


However, to no avail.

I found a switch message somewhere else on the forum, and running usb_modeswitch manually seems to bring some action about:

Code:
pi@raspberrypi:~$ lsusb
Bus 001 Device 004: ID 12d1:157d Huawei Technologies Co., Ltd.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~$ sudo usb_modeswitch -v 0x12d1 -p 0x157d -V 0x12d1 -P 0x14db -M "55534243123456780000000000000011062000000101000100000000000000"
Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
 Found devices in default mode (1)
Access device 007 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)
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
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!

pi@raspberrypi:~$ lsusb
Bus 001 Device 008: ID 12d1:14db Huawei Technologies Co., Ltd.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~$


Code:
pi@raspberrypi:~$ dmesg
...
[  147.016402] usb 1-1.5: USB disconnect, device number 4
[  148.586656] usb 1-1.5: new high-speed USB device number 5 using dwc_otg
[  148.717561] usb 1-1.5: New USB device found, idVendor=12d1, idProduct=14db
[  148.717573] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  148.717581] usb 1-1.5: Product: HUAWEI Mobile
[  148.717588] usb 1-1.5: Manufacturer: HUAWEI
[  149.018164] cdc_ether 1-1.5:1.0 eth1: register 'cdc_ether' at usb-3f980000.usb-1.5, CDC Ethernet Device, 00:1e:10:1f:00:00
[  149.018614] usbcore: registered new interface driver cdc_ether


Not sure if this is the interface I need (I'm totally fresh at using such modesm), but at least it changed to something.

Any tips on how to get this running automatically?


Offline
PostPosted: Thu Aug 10, 2017 8:45 am Reply with quote
Site Admin Posts: 6420 Joined: Sat Nov 03, 2007 12:30 am
It looks like you have a general problem with your USB host system.
Are you using an external USB hub with power supply?


Offline
PostPosted: Mon Aug 14, 2017 12:09 am Reply with quote
Posts: 6 Joined: Wed Aug 09, 2017 8:50 pm
Josh wrote:
It looks like you have a general problem with your USB host system.
Are you using an external USB hub with power supply?


No, I didn't originally (assumed that the RPi3 had enough juice), but I retried today using a powered USB hub and got similar results.

Clean Raspian Jessie (usb_modeswitch) 2.2.0:
Code:
pi@raspberrypi:~$ dmesg
...
[   40.366581] usb 1-1.5.1: new high-speed USB device number 5 using dwc_otg
[   40.498091] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=157d
[   40.498106] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   40.498114] usb 1-1.5.1: Product: HUAWEI Mobile
[   40.498122] usb 1-1.5.1: Manufacturer: HUAWEI
[   40.498129] usb 1-1.5.1: SerialNumber: FFFFFFFFFFFFFFFF
[   40.553559] usb-storage 1-1.5.1:1.0: USB Mass Storage device detected
[   40.554297] scsi host0: usb-storage 1-1.5.1:1.0
[   41.272115] usb 1-1.5.1: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[   41.482034] usbcore: registered new interface driver cdc_ncm
[   41.485869] usbcore: registered new interface driver cdc_wdm
[   41.513651] cdc_mbim 1-1.5.1:2.0: SET_NTB_FORMAT failed
[   41.526750] cdc_mbim 1-1.5.1:2.0: bind() failure
[   41.527227] usbcore: registered new interface driver cdc_mbim
[   41.602465] usb 1-1.5.1: USB disconnect, device number 5
[   42.718387] random: crng init done
[   46.256578] usb 1-1.5.1: new high-speed USB device number 6 using dwc_otg
[   46.388018] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=157d
[   46.388031] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   46.388039] usb 1-1.5.1: Product: HUAWEI Mobile
[   46.388046] usb 1-1.5.1: Manufacturer: HUAWEI
[   46.388054] usb 1-1.5.1: SerialNumber: FFFFFFFFFFFFFFFF
[   46.442431] usb-storage 1-1.5.1:1.0: USB Mass Storage device detected
[   46.442783] scsi host0: usb-storage 1-1.5.1:1.0
[   47.120598] usb 1-1.5.1: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[   47.331287] cdc_mbim 1-1.5.1:2.0: SET_NTB_FORMAT failed
[   47.351442] cdc_mbim 1-1.5.1:2.0: bind() failure
[   47.490474] usb 1-1.5.1: USB disconnect, device number 6
[   52.146573] usb 1-1.5.1: new high-speed USB device number 7 using dwc_otg
[   52.278144] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=157d
[   52.278157] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   52.278165] usb 1-1.5.1: Product: HUAWEI Mobile
[   52.278173] usb 1-1.5.1: Manufacturer: HUAWEI
[   52.278180] usb 1-1.5.1: SerialNumber: FFFFFFFFFFFFFFFF
[   52.378335] usb-storage 1-1.5.1:1.0: USB Mass Storage device detected
[   52.378681] scsi host0: usb-storage 1-1.5.1:1.0
[   53.029767] usb 1-1.5.1: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[   53.241572] cdc_mbim 1-1.5.1:2.0: SET_NTB_FORMAT failed
[   53.256731] cdc_mbim 1-1.5.1:2.0: bind() failure
[   53.378450] usb 1-1.5.1: USB disconnect, device number 7
[   58.036574] usb 1-1.5.1: new high-speed USB device number 8 using dwc_otg
[   58.177878] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=157d
[   58.177892] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   58.177900] usb 1-1.5.1: Product: HUAWEI Mobile
[   58.177907] usb 1-1.5.1: Manufacturer: HUAWEI
[   58.177916] usb 1-1.5.1: SerialNumber: FFFFFFFFFFFFFFFF
[   58.281694] usb-storage 1-1.5.1:1.0: USB Mass Storage device detected
[   58.282052] scsi host0: usb-storage 1-1.5.1:1.0
[   58.905841] usb 1-1.5.1: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[   59.118108] cdc_mbim 1-1.5.1:2.0: SET_NTB_FORMAT failed
[   59.136682] cdc_mbim 1-1.5.1:2.0: bind() failure
[   59.266457] usb 1-1.5.1: USB disconnect, device number 8
[   63.916575] usb 1-1.5.1: new high-speed USB device number 9 using dwc_otg
[   64.048099] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=157d
[   64.048111] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   64.048119] usb 1-1.5.1: Product: HUAWEI Mobile
[   64.048127] usb 1-1.5.1: Manufacturer: HUAWEI
[   64.048134] usb 1-1.5.1: SerialNumber: FFFFFFFFFFFFFFFF
[   64.163534] usb-storage 1-1.5.1:1.0: USB Mass Storage device detected
[   64.163886] scsi host0: usb-storage 1-1.5.1:1.0
[   64.815228] usb 1-1.5.1: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[   65.025760] cdc_mbim 1-1.5.1:2.0: SET_NTB_FORMAT failed
[   65.036624] cdc_mbim 1-1.5.1:2.0: bind() failure
[   65.154459] usb 1-1.5.1: USB disconnect, device number 9
pi@raspberrypi:~$


Ugraded to 2.5.1:
Code:
pi@raspberrypi:~$ dmesg
...
[   30.386345] usb 1-1.5.3: new high-speed USB device number 5 using dwc_otg
[   30.518218] usb 1-1.5.3: New USB device found, idVendor=12d1, idProduct=157d
[   30.518229] usb 1-1.5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   30.518237] usb 1-1.5.3: Product: HUAWEI Mobile
[   30.518245] usb 1-1.5.3: Manufacturer: HUAWEI
[   30.518253] usb 1-1.5.3: SerialNumber: FFFFFFFFFFFFFFFF
[   30.573386] usb-storage 1-1.5.3:1.0: USB Mass Storage device detected
[   30.574410] scsi host0: usb-storage 1-1.5.3:1.0
[   31.624827] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[   31.691167] sr 0:0:0:0: [sr0] scsi-1 drive
[   31.691177] cdrom: Uniform CD-ROM driver Revision: 3.20
[   31.692072] sr 0:0:0:0: Attached scsi CD-ROM sr0
[   31.700262] sr 0:0:0:0: Attached scsi generic sg0 type 5
[   34.455135] sr 0:0:0:0: [sr0] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[   34.455152] sr 0:0:0:0: [sr0] tag#0 Sense Key : 0x3 [current]
[   34.455163] sr 0:0:0:0: [sr0] tag#0 ASC=0x11 ASCQ=0x0
[   34.455176] sr 0:0:0:0: [sr0] tag#0 CDB: opcode=0x28 28 00 00 00 ff fe 00 00 02 00
[   34.455186] blk_update_request: critical medium error, dev sr0, sector 262136
[   34.461278] sr 0:0:0:0: [sr0] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[   34.461294] sr 0:0:0:0: [sr0] tag#0 Sense Key : 0x3 [current]
[   34.461305] sr 0:0:0:0: [sr0] tag#0 ASC=0x11 ASCQ=0x0
[   34.461319] sr 0:0:0:0: [sr0] tag#0 CDB: opcode=0x28 28 00 00 00 ff fe 00 00 02 00
[   34.461329] blk_update_request: critical medium error, dev sr0, sector 262136
[   34.461339] Buffer I/O error on dev sr0, logical block 32767, async page read
[   53.459904] random: crng init done
pi@raspberrypi:~$


Also enabled logging, but nothing in /var/log after installing 2.5.1.

Seems like usb_modeswitch isn't run after ugrading?


Offline
PostPosted: Wed Aug 23, 2017 12:03 am Reply with quote
Posts: 6 Joined: Wed Aug 09, 2017 8:50 pm
Ok, as usb_storage is built-in in the kernel that ships with raspbian, I got around to build a new one from source (4.9.43), and tried to blacklist usb_storage.

It seems like that helped somewhat:
Code:
[  108.976948] usb 1-1.5.4: new high-speed USB device number 5 using dwc_otg
[  109.108869] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  109.108883] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumb                                                                                                 er=3
[  109.108891] usb 1-1.5.4: Product: HUAWEI Mobile
[  109.108899] usb 1-1.5.4: Manufacturer: HUAWEI
[  109.108906] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  110.158277] usbcore: registered new interface driver cdc_ncm
[  110.168030] usbcore: registered new interface driver cdc_wdm
[  110.196038] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  110.207154] cdc_mbim 1-1.5.4:2.0: bind() failure
[  110.207324] usbcore: registered new interface driver cdc_mbim
[  110.413538] usb 1-1.5.4: USB disconnect, device number 5
[  115.116990] usb 1-1.5.4: new high-speed USB device number 6 using dwc_otg
[  115.248785] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  115.248798] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumb                                                                                                 er=3
[  115.248806] usb 1-1.5.4: Product: HUAWEI Mobile
[  115.248814] usb 1-1.5.4: Manufacturer: HUAWEI
[  115.248822] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  116.264178] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  116.277160] cdc_mbim 1-1.5.4:2.0: bind() failure
[  116.302576] usb 1-1.5.4: USB disconnect, device number 6
[  121.007041] usb 1-1.5.4: new high-speed USB device number 7 using dwc_otg
[  121.138907] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  121.138919] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumb                                                                                                 er=3
[  121.138927] usb 1-1.5.4: Product: HUAWEI Mobile
[  121.138935] usb 1-1.5.4: Manufacturer: HUAWEI
[  121.138943] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  122.154788] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  122.167216] cdc_mbim 1-1.5.4:2.0: bind() failure
[  122.190415] usb 1-1.5.4: USB disconnect, device number 7
[  126.897075] usb 1-1.5.4: new high-speed USB device number 8 using dwc_otg
[  127.028931] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  127.028945] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumb                                                                                                 er=3
[  127.028953] usb 1-1.5.4: Product: HUAWEI Mobile
[  127.028962] usb 1-1.5.4: Manufacturer: HUAWEI
[  127.028969] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  127.986356] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  127.997238] cdc_mbim 1-1.5.4:2.0: bind() failure
[  128.078420] usb 1-1.5.4: USB disconnect, device number 8
[  132.787108] usb 1-1.5.4: new high-speed USB device number 9 using dwc_otg
[  132.918947] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  132.918959] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumb                                                                                                 er=3
[  132.918968] usb 1-1.5.4: Product: HUAWEI Mobile
[  132.918976] usb 1-1.5.4: Manufacturer: HUAWEI
[  132.918983] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  134.057229] usb usb1-port1: disabled by hub (EMI?), re-enabling...
[  134.057252] usb 1-1: USB disconnect, device number 2
[  134.057263] usb 1-1.1: USB disconnect, device number 3
[  134.057851] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-3f980000.usb-1                                                                                                 .1, smsc95xx USB 2.0 Ethernet
[  134.058006] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[  134.087213] smsc95xx 1-1.1:1.0 eth0 (unregistering): Failed to read reg index                                                                                                  0x00000114: -19
[  134.087231] smsc95xx 1-1.1:1.0 eth0 (unregistering): Error reading MII_ACCESS
[  134.087239] smsc95xx 1-1.1:1.0 eth0 (unregistering): MII is busy in smsc95xx_                                                                                                 mdio_read
[  134.087252] smsc95xx 1-1.1:1.0 eth0 (unregistering): Failed to read MII_BMSR
[  134.127970] usb 1-1.5: USB disconnect, device number 4
[  134.127988] usb 1-1.5.4: USB disconnect, device number 9
[  138.967197] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  138.987202] cdc_mbim 1-1.5.4:2.0: bind() failure
[  139.187233] Indeed it is in host mode hprt0 = 00001501
[  139.387160] usb 1-1: new high-speed USB device number 10 using dwc_otg
[  139.387276] Indeed it is in host mode hprt0 = 00001101
[  139.617410] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[  139.617421] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  139.618259] hub 1-1:1.0: USB hub found
[  139.618345] hub 1-1:1.0: 5 ports detected
[  139.937167] usb 1-1.1: new high-speed USB device number 11 using dwc_otg
[  140.067407] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[  140.067419] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber                                                                                                 =0
[  140.070310] smsc95xx v1.0.5
[  140.170820] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-                                                                                                 1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:bd:84:da
[  140.267168] usb 1-1.5: new high-speed USB device number 12 using dwc_otg
[  140.397574] usb 1-1.5: New USB device found, idVendor=1a40, idProduct=0101
[  140.397585] usb 1-1.5: New USB device strings: Mfr=0, Product=1, SerialNumber                                                                                                 =0
[  140.397594] usb 1-1.5: Product: USB 2.0 Hub
[  140.398378] hub 1-1.5:1.0: USB hub found
[  140.398482] hub 1-1.5:1.0: 4 ports detected
[  140.717172] usb 1-1.5.4: new high-speed USB device number 13 using dwc_otg
[  140.848573] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  140.848584] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumb                                                                                                 er=3
[  140.848593] usb 1-1.5.4: Product: HUAWEI Mobile
[  140.848601] usb 1-1.5.4: Manufacturer: HUAWEI
[  140.848609] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  141.268426] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[  141.268696] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  141.814475] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  141.834625] cdc_mbim 1-1.5.4:2.0: bind() failure
[  141.888892] usb 1-1.5.4: USB disconnect, device number 13
[  142.790893] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  142.793340] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE                                                                                                 1
[  146.487211] usb 1-1.5.4: new high-speed USB device number 14 using dwc_otg
[  146.618117] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=1442
[  146.618130] usb 1-1.5.4: New USB device strings: Mfr=2, Product=1, SerialNumb                                                                                                 er=0
[  146.618139] usb 1-1.5.4: Product: HUAWEI Mobile
[  146.618147] usb 1-1.5.4: Manufacturer: HUAWEI Technology
[  146.658402] usbcore: registered new interface driver usbserial
[  146.658499] usbcore: registered new interface driver usbserial_generic
[  146.658584] usbserial: USB Serial support registered for generic
[  146.674474] usbcore: registered new interface driver option
[  146.674565] usbserial: USB Serial support registered for GSM modem (1-port)
[  146.675031] option 1-1.5.4:1.0: GSM modem (1-port) converter detected
[  146.676309] usb 1-1.5.4: GSM modem (1-port) converter now attached to ttyUSB0
[  146.676463] option 1-1.5.4:1.1: GSM modem (1-port) converter detected
[  146.676868] usb 1-1.5.4: GSM modem (1-port) converter now attached to ttyUSB1


Just to check if that it wasn't a more recent kernel that fixed the problem, I tested without blacklisting usb_storage:

Code:
[  117.935606] usb 1-1.5.4: new high-speed USB device number 5 using dwc_otg
[  118.067472] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  118.067485] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  118.067494] usb 1-1.5.4: Product: HUAWEI Mobile
[  118.067502] usb 1-1.5.4: Manufacturer: HUAWEI
[  118.067509] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  118.176772] usb-storage 1-1.5.4:1.0: USB Mass Storage device detected
[  118.177457] scsi host0: usb-storage 1-1.5.4:1.0
[  118.178029] usbcore: registered new interface driver usb-storage
[  118.902184] usb 1-1.5.4: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[  119.104363] usbcore: registered new interface driver cdc_ncm
[  119.108599] usbcore: registered new interface driver cdc_wdm
[  119.136777] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  119.155868] cdc_mbim 1-1.5.4:2.0: bind() failure
[  119.156356] usbcore: registered new interface driver cdc_mbim
[  119.160010] usb 1-1.5.4: USB disconnect, device number 5
[  124.075659] usb 1-1.5.4: new high-speed USB device number 6 using dwc_otg
[  124.207536] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  124.207549] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  124.207557] usb 1-1.5.4: Product: HUAWEI Mobile
[  124.207565] usb 1-1.5.4: Manufacturer: HUAWEI
[  124.207573] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  124.267767] usb-storage 1-1.5.4:1.0: USB Mass Storage device detected
[  124.268128] scsi host0: usb-storage 1-1.5.4:1.0
[  124.957481] usb 1-1.5.4: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[  125.168573] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  125.185814] cdc_mbim 1-1.5.4:2.0: bind() failure
[  125.256146] usb 1-1.5.4: USB disconnect, device number 6
[  129.965695] usb 1-1.5.4: new high-speed USB device number 7 using dwc_otg
[  130.097369] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  130.097382] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  130.097390] usb 1-1.5.4: Product: HUAWEI Mobile
[  130.097398] usb 1-1.5.4: Manufacturer: HUAWEI
[  130.097406] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  130.225626] usb-storage 1-1.5.4:1.0: USB Mass Storage device detected
[  130.226021] scsi host0: usb-storage 1-1.5.4:1.0
[  130.921528] usb 1-1.5.4: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[  131.132446] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  131.145878] cdc_mbim 1-1.5.4:2.0: bind() failure
[  131.146235] usb 1-1.5.4: USB disconnect, device number 7
[  135.855736] usb 1-1.5.4: new high-speed USB device number 8 using dwc_otg
[  135.987732] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  135.987744] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  135.987752] usb 1-1.5.4: Product: HUAWEI Mobile
[  135.987760] usb 1-1.5.4: Manufacturer: HUAWEI
[  135.987768] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  136.046039] usb-storage 1-1.5.4:1.0: USB Mass Storage device detected
[  136.046379] scsi host0: usb-storage 1-1.5.4:1.0
[  136.736195] usb 1-1.5.4: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[  136.947193] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  136.965911] cdc_mbim 1-1.5.4:2.0: bind() failure
[  137.036276] usb 1-1.5.4: USB disconnect, device number 8
[  141.745776] usb 1-1.5.4: new high-speed USB device number 9 using dwc_otg
[  141.877668] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  141.877680] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  141.877688] usb 1-1.5.4: Product: HUAWEI Mobile
[  141.877696] usb 1-1.5.4: Manufacturer: HUAWEI
[  141.877704] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  141.990674] usb-storage 1-1.5.4:1.0: USB Mass Storage device detected
[  141.991051] scsi host0: usb-storage 1-1.5.4:1.0
[  142.702838] usb 1-1.5.4: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[  142.912900] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  142.925950] cdc_mbim 1-1.5.4:2.0: bind() failure
[  142.926251] usb 1-1.5.4: USB disconnect, device number 9
[  147.885821] usb 1-1.5.4: new high-speed USB device number 10 using dwc_otg
[  148.017731] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=157d
[  148.017743] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  148.017751] usb 1-1.5.4: Product: HUAWEI Mobile
[  148.017759] usb 1-1.5.4: Manufacturer: HUAWEI
[  148.017766] usb 1-1.5.4: SerialNumber: FFFFFFFFFFFFFFFF
[  148.067671] usb-storage 1-1.5.4:1.0: USB Mass Storage device detected
[  148.068279] scsi host0: usb-storage 1-1.5.4:1.0
[  148.767859] usb 1-1.5.4: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[  148.979109] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  148.995992] cdc_mbim 1-1.5.4:2.0: bind() failure
[  149.066394] usb 1-1.5.4: USB disconnect, device number 10
[  153.515866] usb 1-1.5.4: new high-speed USB device number 11 using dwc_otg
[  153.646727] usb 1-1.5.4: New USB device found, idVendor=12d1, idProduct=1442
[  153.646739] usb 1-1.5.4: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[  153.646747] usb 1-1.5.4: Product: HUAWEI Mobile
[  153.646755] usb 1-1.5.4: Manufacturer: HUAWEI Technology
[  153.686069] usbcore: registered new interface driver usbserial
[  153.686175] usbcore: registered new interface driver usbserial_generic
[  153.686267] usbserial: USB Serial support registered for generic
[  153.701687] usbcore: registered new interface driver option
[  153.701792] usbserial: USB Serial support registered for GSM modem (1-port)
[  153.702265] option 1-1.5.4:1.0: GSM modem (1-port) converter detected
[  153.702686] usb 1-1.5.4: GSM modem (1-port) converter now attached to ttyUSB0
[  153.702819] option 1-1.5.4:1.1: GSM modem (1-port) converter detected
[  153.703194] usb 1-1.5.4: GSM modem (1-port) converter now attached to ttyUSB1


And we have yet again the fight between usb-storage and usb_modeswitch, but it in the end I get a pair of GSM modems on ttyUSB0 and ttyUSB1.

So that is definitely an improvement.


Offline
PostPosted: Thu Aug 24, 2017 8:21 pm Reply with quote
Site Admin Posts: 6420 Joined: Sat Nov 03, 2007 12:30 am
cdk wrote:
And we have yet again the fight between usb-storage and usb_modeswitch

That's a false impression. The real problem is here:
Code:
[  130.921528] usb 1-1.5.4: usbfs: [...] while 'usb_modeswitch' sets config #2
[  131.132446] cdc_mbim 1-1.5.4:2.0: SET_NTB_FORMAT failed
[  131.145878] cdc_mbim 1-1.5.4:2.0: bind() failure
[  131.146235] usb 1-1.5.4: USB disconnect, device number 7
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It is obvious that despite the complaint, usb_modeswitch manages to set the MBIM configuration, having detected both the presence of the respective driver and the matching device configuration.

The MBIM driver is then auto-loaded, and that's where the real problem appears. The driver can't finish its initialization work because the device is suddenly GONE. It obviously does a hard reset which brings it back to the initial state - the start of a loop.

This happens regardless of usb-storage being available or not.

There is a whole range of possible causes for that reset. I have seen several reports where the Raspi USB host driver was to blame.
I have also seen resets myself with modems not getting sufficient power. Be aware that once the modem is in its usable mode or configuration, it starts transmitting which can draw up to the maximum current specified for USB2 (500 mA). Now check the total current going into the Raspi. It should at least be 2 A.

Even with a powered USB hub, you'd have to make sure that the power supply can guarantee those 500 mA per port if they are all in use. The hub itself requires some current too, so a 2 A power supply may be insufficient for four fully used ports.

Then there is the possibility of a firmware flaw, potentially in combination with a certain driver version. Do you have a desktop Linux system available to check the modem behaviour there?


Offline
PostPosted: Sat Aug 26, 2017 7:51 pm Reply with quote
Posts: 6 Joined: Wed Aug 09, 2017 8:50 pm
The RPi has a 2.5A supply and the 4-port USB hub has 2A supply, so there should be sufficient power.

I tried the modem with a ubuntu live-USB (usb_modeswitch 2.4.0) on my workstation, and fared much better there.

With the modem connected to a USB port on the motherboard,
Code:
ubuntu@ubuntu:~$ dmesg
...
[  269.952463] usb 5-2: new high-speed USB device number 3 using xhci_hcd
[  270.153683] usb 5-2: New USB device found, idVendor=12d1, idProduct=157d
[  270.153686] usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  270.153688] usb 5-2: Product: HUAWEI Mobile
[  270.153690] usb 5-2: Manufacturer: HUAWEI
[  270.153691] usb 5-2: SerialNumber: FFFFFFFFFFFFFFFF
[  270.209775] usb-storage 5-2:1.0: USB Mass Storage device detected
[  270.209994] scsi host12: usb-storage 5-2:1.0
[  271.234371] scsi 12:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[  271.278160] sr 12:0:0:0: [sr1] scsi-1 drive
[  271.278520] sr 12:0:0:0: Attached scsi CD-ROM sr1
[  271.278690] sr 12:0:0:0: Attached scsi generic sg6 type 5
[  276.366009] usbcore: registered new interface driver option
[  276.366028] usbserial: USB Serial support registered for GSM modem (1-port)
ubuntu@ubuntu:~$


I then checked connecting via the USB hub I used with the RPi,
Code:
ubuntu@ubuntu:~$ dmesg
...
[  123.463199] usb 5-2.4: new high-speed USB device number 4 using xhci_hcd
[  123.564509] usb 5-2.4: New USB device found, idVendor=12d1, idProduct=157d
[  123.564512] usb 5-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  123.564514] usb 5-2.4: Product: HUAWEI Mobile
[  123.564516] usb 5-2.4: Manufacturer: HUAWEI
[  123.564518] usb 5-2.4: SerialNumber: FFFFFFFFFFFFFFFF
[  123.617748] usb-storage 5-2.4:1.0: USB Mass Storage device detected
[  123.617934] scsi host12: usb-storage 5-2.4:1.0
[  124.651009] scsi 12:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[  124.722696] sr 12:0:0:0: [sr1] scsi-1 drive
[  124.722951] sr 12:0:0:0: Attached scsi CD-ROM sr1
[  124.723041] sr 12:0:0:0: Attached scsi generic sg6 type 5
[  129.828714] usbcore: registered new interface driver option
[  129.828736] usbserial: USB Serial support registered for GSM modem (1-port)
ubuntu@ubuntu:~$


It seems that it works flawlessly on my workstation, both directly onto a motherboard USB port and via the USB hub.

So I guess this smells like a RPi host driver issue?


Offline
PostPosted: Sat Aug 26, 2017 9:27 pm Reply with quote
Site Admin Posts: 6420 Joined: Sat Nov 03, 2007 12:30 am
cdk wrote:
So I guess this smells like a RPi host driver issue?

We don't know that yet. The Ubuntu variant of usb_modeswitch (they use their own dispatcher) seems to use a different configuration of the modem - not the MBIM configuration. Consequently, the MBIM driver never binds to the modem on that platform.

I wonder if you can post the output of "sudo lsusb -vd 12d1:157d" from that Ubuntu test.


Offline
PostPosted: Sat Aug 26, 2017 10:34 pm Reply with quote
Posts: 6 Joined: Wed Aug 09, 2017 8:50 pm
Josh wrote:
I wonder if you can post the output of "sudo lsusb -vd 12d1:157d" from that Ubuntu test.


Ofcourse, here goes:
Code:
ubuntu@ubuntu:~$ sudo lsusb -vd 12d1:157d

Bus 003 Device 008: ID 12d1:157d Huawei Technologies Co., Ltd.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol       255
  bMaxPacketSize0        64
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x157d
  bcdDevice            1.02
  iManufacturer           1 HUAWEI
  iProduct                2 HUAWEI Mobile
  iSerial                 3 FFFFFFFFFFFFFFFF
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    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           95
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass      14
      bFunctionProtocol       0
      iFunction               8 Huawei Mobile
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass     14
      bInterfaceProtocol      0
      iInterface              5 CDC Network Control Model (NCM)
      CDC Header:
        bcdCDC               1.10
      CDC MBIM:
        bcdMBIMVersion       1.00
        wMaxControlMessage   1024
        bNumberFilters       16
        bMaxFilterSize       20
        wMaxSegmentSize      1500
        bmNetworkCapabilities 0x20
          8-byte ntb input size
      UNRECOGNIZED CDC:  08 24 1c 00 01 10 dc 05
      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               9
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      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 Unused
      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
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol       255
  bMaxPacketSize0        64
  bNumConfigurations      2
Device Status:     0x0001
  Self Powered
ubuntu@ubuntu:~$


Offline
PostPosted: Mon Aug 28, 2017 9:31 pm Reply with quote
Site Admin Posts: 6420 Joined: Sat Nov 03, 2007 12:30 am
It looks like there is only the MBIM-style port available in this mode.

You can try annother mode but first you have to disable the MBIM check as described. Then use the following method to switch the modem:

Put a file named "12d1:157d" in the folder "/etc/usb_modeswitch.d".

Edit the file so that it contains this:
Code:
MessageContent="55534243123456780000000000000011063000000000010000000000000000"

If you enable usb_modeswitch's logging in /etc/usb_modeswitch.conf, you can see in detail what happens when you plug your modem in.


Offline
PostPosted: Tue Aug 29, 2017 12:19 am Reply with quote
Posts: 6 Joined: Wed Aug 09, 2017 8:50 pm
Josh wrote:
It looks like there is only the MBIM-style port available in this mode.

You can try annother mode but first you have to disable the MBIM check as described. Then use the following method to switch the modem:

Put a file named "12d1:157d" in the folder "/etc/usb_modeswitch.d".

Edit the file so that it contains this:
Code:
MessageContent="55534243123456780000000000000011063000000000010000000000000000"

If you enable usb_modeswitch's logging in /etc/usb_modeswitch.conf, you can see in detail what happens when you plug your modem in.


Ok, this looks promising. I did the following:
- Installed fresh usb_modeswitch 2.5.1
- Set 'DisableMBIMGlobal' and 'EnableLogging' in usb_modeswitch.conf
- Created a new file in /etc/usb_modeswitch.d as described above

Code:
pi@raspberrypi:/etc$ dmesg
...
[  459.489033] usb 1-1.5: new high-speed USB device number 4 using dwc_otg
[  459.621102] usb 1-1.5: New USB device found, idVendor=12d1, idProduct=157d
[  459.621116] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  459.621125] usb 1-1.5: Product: HUAWEI Mobile
[  459.621133] usb 1-1.5: Manufacturer: HUAWEI
[  459.621140] usb 1-1.5: SerialNumber: FFFFFFFFFFFFFFFF
[  459.778041] usb-storage 1-1.5:1.0: USB Mass Storage device detected
[  459.779914] scsi host0: usb-storage 1-1.5:1.0
[  459.780311] usbcore: registered new interface driver usb-storage
[  460.731654] usb 1-1.5: USB disconnect, device number 4
[  465.889087] usb 1-1.5: new high-speed USB device number 5 using dwc_otg
[  466.020550] usb 1-1.5: New USB device found, idVendor=12d1, idProduct=1001
[  466.020561] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  466.020570] usb 1-1.5: Product: HUAWEI Mobile
[  466.020577] usb 1-1.5: Manufacturer: HUAWEI
[  466.303469] usbcore: registered new interface driver usbserial
[  466.305186] usbcore: registered new interface driver usbserial_generic
[  466.305344] usbserial: USB Serial support registered for generic
[  466.321378] usbcore: registered new interface driver option
[  466.321481] usbserial: USB Serial support registered for GSM modem (1-port)
[  466.321858] option 1-1.5:1.0: GSM modem (1-port) converter detected
[  466.322632] usb 1-1.5: GSM modem (1-port) converter now attached to ttyUSB0
[  466.322773] option 1-1.5:1.1: GSM modem (1-port) converter detected
[  466.323189] usb 1-1.5: GSM modem (1-port) converter now attached to ttyUSB1
[  466.323306] option 1-1.5:1.2: GSM modem (1-port) converter detected
[  466.323753] usb 1-1.5: GSM modem (1-port) converter now attached to ttyUSB2
pi@raspberrypi:/etc$


Code:
pi@raspberrypi:/etc$ cat /var/log/us
usb_modeswitch_1-1.5      usb_modeswitch_1-1.5:1.0  user.log
pi@raspberrypi:/etc$ cat /var/log/usb_modeswitch_1-1.5

USB_ModeSwitch log from Tue Aug 29 00:08:15 CEST 2017

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

----------------
USB values from sysfs:
  manufacturer  HUAWEI
  product       HUAWEI Mobile
  serial        FFFFFFFFFFFFFFFF
----------------
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
ConfigList: /etc/usb_modeswitch.d/12d1:157d /usr/share/usb_modeswitch/12d1:157d pack/12d1:157d pack/12d1:#linux
SCSI attributes not needed, move on
Check config: /etc/usb_modeswitch.d/12d1:157d
! matched. Read config data
Use config file from override folder /etc/usb_modeswitch.d
Logger is /usr/bin/logger
Command line:
usb_modeswitch -W -D  -b 1 -g 4 -v 12d1 -p 157d -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.1 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x157d
MessageContent="55534243123456780000000000000011063000000000010000000000000000"
System integration mode enabled

Use given bus/device number: 001/004 ...
Look for default devices ...
 bus/device number matched
  found USB ID 12d1:157d
   vendor ID matched
   product ID matched
 Found devices in default mode (1)
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
     Product: HUAWEI Mobile
  Serial No.: FFFFFFFFFFFFFFFF
-------------------------
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 -1)
 Device is gone, skip any further commands
ok:busdev
--------------------------------
(end of usb_modeswitch output)

Check success of mode switch for max. 20 seconds ...
 Wait for device file system (1 sec.) ...
 Wait for device file system (2 sec.) ...
 Wait for device file system (3 sec.) ...
 Wait for device file system (4 sec.) ...
 Wait for device file system (5 sec.) ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...
 Read attributes ...

Target config not matching - current values are
    1-1.5:1.0/bInterfaceClass: ff
    bConfigurationValue:       1
    bNumConfigurations:        1
    busnum:                    1
    devnum:                    5
    idProduct:                 1001
    idVendor:                  12d1
    manufacturer:              HUAWEI
    product:                   HUAWEI Mobile
    serial:

Mode switching may have failed. Exit

pi@raspberrypi:/etc$


Code:
pi@raspberrypi:/etc$ cat /var/log/usb_modeswitch_1-1.5\:1.0

USB_ModeSwitch log from Mon Aug 28 23:59:28 CEST 2017

Use global config file: /etc/usb_modeswitch.conf

Started via systemd
Raw args from udev: /1/1.5:1.0

Use top device dir /sys/bus/usb/devices/1-1.5

----------------
USB values from sysfs:
  manufacturer  HUAWEI
  product       HUAWEI Mobile
  serial        FFFFFFFFFFFFFFFF
----------------
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
ConfigList: /etc/usb_modeswitch.d/12d1:157d pack/12d1:157d pack/12d1:#linux
SCSI attributes not needed, move on
Check config: /etc/usb_modeswitch.d/12d1:157d
! matched. Read config data
Use config file from override folder /etc/usb_modeswitch.d
Logger is /usr/bin/logger
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Device may have an MBIM configuration, check driver ...
 driver for MBIM devices is available
Find MBIM configuration number ...
Command to be run:
usb_modeswitch -W -D -s 20  -b 1 -g 55 -v 12d1 -p 157d -f $configBuffer
pi@raspberrypi:/etc$


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
10 posts
Users browsing this forum: No registered users and 2 guests
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum