Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
ashish8292
Posts: 3
Joined: 26 Mar 2018, 14:57

Huawei E3372 doesn't Detect automatically as usb modem

Post by ashish8292 » 26 Mar 2018, 15:35

Hi All,

I am working with Huawei E3372 dongle on linux-yocto-4.9. Version of Usb_modeSwitch is "2.2.0"

my device is not able to detect Huawei dongle automatically to usb modem. Instead of dongle get detected as storage device.
However, when I start usb_modeswitch manually, I am able to convert it.

Code: Select all

 usb_modeswitch -v 12d1 -p 157c -J
Logs when manually added

Code: Select all

usb_modeswitch -v 12d1 -p 157c -J
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 002 on bus 001
Current configuration number is 1
Use interface number 0
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 driver ...
 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
Reset response endpoint 0x81
Reset message endpoint 0x01
usb 1-1: USB disconnect, device number 2
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!

~# usb 1-1: new high-speed USB device number 3 using ci_hdrc
huawei_cdc_ncm 1-1:1.2: MAC-Address: 00:1e:10:1f:00:00
huawei_cdc_ncm 1-1:1.2: setting rx_max = 16384
huawei_cdc_ncm 1-1:1.2: NDP will be placed at end of frame for this device.
huawei_cdc_ncm 1-1:1.2: cdc-wdm0: USB WDM device
huawei_cdc_ncm 1-1:1.2 wwan0: register 'huawei_cdc_ncm' at usb-ci_hdrc.0-1, Huawei CDC NCM device, 00:1e:10:1f:00:00
usb-storage 1-1:1.3: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.3
usb-storage 1-1:1.4: USB Mass Storage device detected
scsi host1: usb-storage 1-1:1.4
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
option 1-1:1.0: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1:1.1: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
I tired all the steps on given on http://www.draisberghof.de/usb_modeswitch/ link.

Step1 : /lib/udev/rules.d/40-usb_modeswitch.rules

Added TTR{idVendor}=="12d1", ATTR{idProduct}=="157c", RUN+="usb_modeswitch '%b/%k'"

Step2 : /lib/udev/usb_modeswitch
Shell Script is present at this location.

Step 3: /usr/sbin/usb_modeswitch_dispatcher
This file is also present

Step 4: /etc/usb_modeswitch.conf

Code: Select all

DisableSwitching=0
EnableLogging=0
#SetStorageDelay=4
Here I have tired with DisableSwitching =1 as well.

Step5. /usr/share/usb_modeswitch

Code: Select all

-rw-r--r-- 1 root root 77 Mar 20 10:40 /usr/share/usb_modeswitch/12d1:157c
Step 6 : /etc/usb_modeswitch.d

Code: Select all

TargetVendor=0x12d1
TargetProduct=0x157c
MessageContent="55534243123456780000000000000011063000000100010000000000000000"
Step 7: /usr/sbin/usb_modeswitch
Binary Program is present.

Please help me with this issue

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

Re: Huawei E3372 doesn't Detect automatically as usb modem

Post by Josh » 26 Mar 2018, 17:12

There were a lot of corrections and fixes since version 2.2.0. I suggest using the current version.

ashish8292
Posts: 3
Joined: 26 Mar 2018, 14:57

Re: Huawei E3372 doesn't Detect automatically as usb modem

Post by ashish8292 » 27 Mar 2018, 07:20

Sure, I will check on latest version also and will let you know. However, this version works fine with yocto kernel version 4.1.

ashish8292
Posts: 3
Joined: 26 Mar 2018, 14:57

Re: Huawei E3372 doesn't Detect automatically as usb modem

Post by ashish8292 » 27 Mar 2018, 12:33

Hi Josh,

I tried with 2.5.0 version and I can see that device is being converted but again it get disconnected automatically . Moreover, after disconnect why coverter is attached to ttyUSB1 instead of ttyUSB0.

Code: Select all

usb 2-1: new high-speed USB device number 3 using ci_hdrc
usb-storage 2-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 2-1:1.0
scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
scsi 0:0:0:1: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
sd 0:0:0:1: [sda] Attached SCSI removable disk
usb 2-1: USB disconnect, device number 3
usb 2-1: new high-speed USB device number 4 using ci_hdrc
option 2-1:1.0: GSM modem (1-port) converter detected
[b]usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
option 2-1:1.1: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1[/b]
huawei_cdc_ncm 2-1:1.2: MAC-Address: 00:1e:10:1f:00:00
huawei_cdc_ncm 2-1:1.2: setting rx_max = 16384
huawei_cdc_ncm 2-1:1.2: NDP will be placed at end of frame for this device.
huawei_cdc_ncm 2-1:1.2: cdc-wdm0: USB WDM device
huawei_cdc_ncm 2-1:1.2 wwan0: register 'huawei_cdc_ncm' at usb-ci_hdrc.1-1, Huawei CDC NCM device, 00:1e:10:1f:00:00
usb-storage 2-1:1.3: USB Mass Storage device detected
scsi host0: usb-storage 2-1:1.3
usb-storage 2-1:1.4: USB Mass Storage device detected
scsi host1: usb-storage 2-1:1.4
scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
scsi 1:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
sd 1:0:0:0: [sda] Attached SCSI removable disk
usb 2-1: USB disconnect, device number 4
[b]option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
option 2-1:1.0: device disconnected
option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1[/b]
option 2-1:1.1: device disconnected
huawei_cdc_ncm 2-1:1.2 wwan0: unregister 'huawei_cdc_ncm' usb-ci_hdrc.1-1, Huawei CDC NCM device
usb 2-1: new high-speed USB device number 5 using ci_hdrc
usb-storage 2-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 2-1:1.0
usb 2-1: USB disconnect, device number 5
usb 2-1: new high-speed USB device number 6 using ci_hdrc
option 2-1:1.0: GSM modem (1-port) converter detected
[b]usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
option 2-1:1.1: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2[/b]
huawei_cdc_ncm 2-1:1.2: MAC-Address: 00:1e:10:1f:00:00
huawei_cdc_ncm 2-1:1.2: setting rx_max = 16384
huawei_cdc_ncm 2-1:1.2: NDP will be placed at end of frame for this device.
huawei_cdc_ncm 2-1:1.2: cdc-wdm0: USB WDM device
huawei_cdc_ncm 2-1:1.2 wwan0: register 'huawei_cdc_ncm' at usb-ci_hdrc.1-1, Huawei CDC NCM device, 00:1e:10:1f:00:00
usb-storage 2-1:1.3: USB Mass Storage device detected
scsi host0: usb-storage 2-1:1.3
usb-storage 2-1:1.4: USB Mass Storage device detected
scsi host1: usb-storage 2-1:1.4
scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
scsi 1:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
sd 1:0:0:0: [sda] Attached SCSI removable disk
random: crng init done
usb 2-1: USB disconnect, device number 6
[b]option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
option 2-1:1.0: device disconnected
option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2[/b]
option 2-1:1.1: device disconnected
huawei_cdc_ncm 2-1:1.2 wwan0: unregister 'huawei_cdc_ncm' usb-ci_hdrc.1-1, Huawei CDC NCM device
usb 2-1: new high-speed USB device number 7 using ci_hdrc
usb-storage 2-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 2-1:1.0
usb 2-1: USB disconnect, device number 7
usb 2-1: new high-speed USB device number 8 using ci_hdrc
option 2-1:1.0: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
option 2-1:1.1: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2
huawei_cdc_ncm 2-1:1.2: MAC-Address: 00:1e:10:1f:00:00
huawei_cdc_ncm 2-1:1.2: setting rx_max = 16384
huawei_cdc_ncm 2-1:1.2: NDP will be placed at end of frame for this device.
huawei_cdc_ncm 2-1:1.2: cdc-wdm0: USB WDM device
huawei_cdc_ncm 2-1:1.2 wwan0: register 'huawei_cdc_ncm' at usb-ci_hdrc.1-1, Huawei CDC NCM device, 00:1e:10:1f:00:00
usb-storage 2-1:1.3: USB Mass Storage device detected
scsi host0: usb-storage 2-1:1.3
usb-storage 2-1:1.4: USB Mass Storage device detected
scsi host1: usb-storage 2-1:1.4
scsi 1:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
sd 1:0:0:0: [sda] Attached SCSI removable disk

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Huawei E3372 doesn't Detect automatically as usb modem

Post by LOM » 27 Mar 2018, 14:37

You have a series of connect/disconnect and the most common reason for them is not enough power on the usb bus, the device resets itself and works until it connects to the tower when the added power consumption due to the transmitter being started creates a power dip.

usb_modeswitch does not create ttyUSBx devices, the kernel does and they are enumerated in ascending order. If you don't have any other serial devices on the usb bus then enumerastion should start with ttyUSB0 every time the device reappears after getting switched.

Both of the errors above could also be a chipidea usb controller driver error.

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

Re: Huawei E3372 doesn't Detect automatically as usb modem

Post by Josh » 17 Apr 2018, 20:24

The E3372 that I have in my modem collection cannot connect via its serial ports. They only work as diagnostic ports. The connection is made through the NCM port, initiated and configured by AT commands sent as USB control transfers.

The "huawei_cdc_ncm" driver in the Linux kernel provides an interface to this; however I don't know if there are programs to use it aside from Network Manager.

Post Reply