rohlik
Posts: 8
Joined: Sun Apr 05, 2020 3:58 pm

Reconnecting Huawei USB dongle E3372 on RPi3B

Fri Jul 10, 2020 8:55 am

Dear RPi fans,
I have a trouble with USB Huawei dongle (E3372H) connected to RPi 3B with Raspbian 8. I need this dongle just for sending SMS via smstools.
Sometimes, without reason, USB dongle start re-connecting as you can see in my log:

Code: Select all

Jul  9 13:15:30 raspismsgw kernel: [ 6457.698918] usb 1-1.4: USB disconnect, device number 70
Jul  9 13:15:30 raspismsgw kernel: [ 6457.699478] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
Jul  9 13:15:30 raspismsgw kernel: [ 6457.699534] option 1-1.4:1.0: device disconnected
Jul  9 13:15:30 raspismsgw kernel: [ 6457.700132] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
Jul  9 13:15:30 raspismsgw kernel: [ 6457.700183] option 1-1.4:1.1: device disconnected
Jul  9 13:15:30 raspismsgw kernel: [ 6457.700585] huawei_cdc_ncm 1-1.4:1.2 wwan0: unregister 'huawei_cdc_ncm' usb-3f980000.usb-1.4, Huawei CDC NCM device
Jul  9 13:15:41 raspismsgw kernel: [ 6469.006997] usb 1-1.4: new high-speed USB device number 71 using dwc_otg
Jul  9 13:15:41 raspismsgw kernel: [ 6469.138303] usb 1-1.4: New USB device found, idVendor=12d1, idProduct=1506
Jul  9 13:15:41 raspismsgw kernel: [ 6469.138317] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jul  9 13:15:41 raspismsgw kernel: [ 6469.138325] usb 1-1.4: Product: HUAWEI_MOBILE
Jul  9 13:15:41 raspismsgw kernel: [ 6469.138333] usb 1-1.4: Manufacturer: HUAWEI_MOBILE
Jul  9 13:15:41 raspismsgw kernel: [ 6469.167741] option 1-1.4:1.0: GSM modem (1-port) converter detected
Jul  9 13:15:41 raspismsgw kernel: [ 6469.168151] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB0
Jul  9 13:15:41 raspismsgw kernel: [ 6469.168703] option 1-1.4:1.1: GSM modem (1-port) converter detected
Jul  9 13:15:41 raspismsgw kernel: [ 6469.169051] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB1
Jul  9 13:15:42 raspismsgw kernel: [ 6469.282430] huawei_cdc_ncm 1-1.4:1.2: MAC-Address: 00:1e:10:1f:00:00
Jul  9 13:15:42 raspismsgw kernel: [ 6469.282442] huawei_cdc_ncm 1-1.4:1.2: setting rx_max = 16384
Jul  9 13:15:42 raspismsgw kernel: [ 6469.289656] huawei_cdc_ncm 1-1.4:1.2: NDP will be placed at end of frame for this device.
Jul  9 13:15:42 raspismsgw kernel: [ 6469.289961] huawei_cdc_ncm 1-1.4:1.2: cdc-wdm0: USB WDM device
Jul  9 13:15:42 raspismsgw kernel: [ 6469.291559] huawei_cdc_ncm 1-1.4:1.2 wwan0: register 'huawei_cdc_ncm' at usb-3f980000.usb-1.4, Huawei CDC NCM device, 00:1e:10:1f:00:00
Jul  9 13:16:16 raspismsgw kernel: [ 6503.522921] usb 1-1.4: USB disconnect, device number 71
Jul  9 13:16:16 raspismsgw kernel: [ 6503.523480] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
Jul  9 13:16:16 raspismsgw kernel: [ 6503.523536] option 1-1.4:1.0: device disconnected
Jul  9 13:16:16 raspismsgw kernel: [ 6503.524135] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
Jul  9 13:16:16 raspismsgw kernel: [ 6503.524188] option 1-1.4:1.1: device disconnected
Jul  9 13:16:16 raspismsgw kernel: [ 6503.524590] huawei_cdc_ncm 1-1.4:1.2 wwan0: unregister 'huawei_cdc_ncm' usb-3f980000.usb-1.4, Huawei CDC NCM device
Jul  9 13:16:27 raspismsgw kernel: [ 6514.827066] usb 1-1.4: new high-speed USB device number 72 using dwc_otg
Jul  9 13:16:27 raspismsgw kernel: [ 6514.958353] usb 1-1.4: New USB device found, idVendor=12d1, idProduct=1506
Jul  9 13:16:27 raspismsgw kernel: [ 6514.958368] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jul  9 13:16:27 raspismsgw kernel: [ 6514.958376] usb 1-1.4: Product: HUAWEI_MOBILE
Jul  9 13:16:27 raspismsgw kernel: [ 6514.958384] usb 1-1.4: Manufacturer: HUAWEI_MOBILE
Jul  9 13:16:27 raspismsgw kernel: [ 6514.987753] option 1-1.4:1.0: GSM modem (1-port) converter detected
Jul  9 13:16:27 raspismsgw kernel: [ 6514.988165] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB0
Jul  9 13:16:27 raspismsgw kernel: [ 6514.988715] option 1-1.4:1.1: GSM modem (1-port) converter detected
Jul  9 13:16:27 raspismsgw kernel: [ 6514.989072] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB1
Jul  9 13:16:27 raspismsgw kernel: [ 6515.094358] huawei_cdc_ncm 1-1.4:1.2: MAC-Address: 00:1e:10:1f:00:00
Jul  9 13:16:27 raspismsgw kernel: [ 6515.094371] huawei_cdc_ncm 1-1.4:1.2: setting rx_max = 16384
Jul  9 13:16:27 raspismsgw kernel: [ 6515.101645] huawei_cdc_ncm 1-1.4:1.2: NDP will be placed at end of frame for this device.
Jul  9 13:16:27 raspismsgw kernel: [ 6515.101945] huawei_cdc_ncm 1-1.4:1.2: cdc-wdm0: USB WDM device
Jul  9 13:16:27 raspismsgw kernel: [ 6515.103599] huawei_cdc_ncm 1-1.4:1.2 wwan0: register 'huawei_cdc_ncm' at usb-3f980000.usb-1.4, Huawei CDC NCM device, 00:1e:10:1f:00:00
Of course, smstools daemon have also some errors:

Code: Select all

2020-07-09 13:14:23,5, GSM1: CMD: AT+COPS?: +COPS: 0 OK
2020-07-09 13:14:43,3, GSM1: Couldn't open serial port /dev/ttyUSB0, error: No such file or directory, waiting 30 sec.
2020-07-09 13:15:33,3, GSM1: Couldn't open serial port /dev/ttyUSB0, error: No such file or directory, waiting 30 sec.
2020-07-09 13:16:23,3, GSM1: Couldn't open serial port /dev/ttyUSB0, error: No such file or directory, waiting 30 sec.
2020-07-09 13:17:03,3, GSM1: Couldn't open serial port /dev/ttyUSB0, error: No such file or directory, waiting 30 sec.
2020-07-09 13:17:53,3, GSM1: Couldn't open serial port /dev/ttyUSB0, error: No such file or directory, waiting 30 sec.
2020-07-09 13:18:33,3, GSM1: Couldn't open serial port /dev/ttyUSB0, error: No such file or directory, waiting 30 sec.
2020-07-09 13:19:21,3, GSM1: Couldn't open serial port /dev/ttyUSB0, error: No such file or directory, waiting 30 sec.
What could cause this problem?

I would like to know how I can disable LTE part of this USB dongle, because it is creating a new interface in my system which is unwanted for my use case:

Code: Select all

86: wwan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether 00:1e:10:1f:00:00 brd ff:ff:ff:ff:ff:ff
    inet 169.254.62.145/16 brd 169.254.255.255 scope global wwan0
       valid_lft forever preferred_lft forever
    inet6 fe80::b0b4:a7ba:fee8:b03/64 scope link
       valid_lft forever preferred_lft forever
Diagnostic information

lsusb

Code: Select all

Bus 001 Device 087: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
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
/etc/usb_modeswitch.d/12d1 (I found this on some forum)

Code: Select all

# Huawei E3372 fallback mode
TargetVendor=0x12d1
TargetProduct=0x155e
MessageContent="55534243123456780000000000000011063000000100010000000000000000"
Last edited by rohlik on Wed Jul 22, 2020 5:51 am, edited 1 time in total.

sparkie777
Posts: 206
Joined: Tue Nov 27, 2012 4:37 am

Re: Reconnecting Huawei USB dongle E3372H on RPi3B

Fri Jul 10, 2020 10:03 am

disconnects could be caused by power supply problems. My E3372 (the version without a trailing 'H' in the name) is running with smstools for months without any unwanted disconnect.

I think the device is renamed from /dev/ttyUSB0 to /dev/ttyUSB2 after spurious disconnects which causes smstools to fail.

for running smstools it is sufficient to leave MODEM and PCUI configured. You don't need the NCM stuff

to achieve this just issue

Code: Select all

AT^SETPORT="FF;10,12"
to control the results issue:

Code: Select all

AT^GETPORTMODE
expected results then:

Code: Select all

^GETPORTMODE: TYPE: WCDMA: huawei,modem:1,pcui:2,
usbmodeswitch is completely unconfigured here (I don't use it)

MODEM is found at /dev/ttyUSB0
PCUI is found at /dev/ttyUSB1
Last edited by sparkie777 on Fri Jul 10, 2020 11:03 am, edited 1 time in total.

rohlik
Posts: 8
Joined: Sun Apr 05, 2020 3:58 pm

Re: Reconnecting Huawei USB dongle E3372H on RPi3B

Fri Jul 10, 2020 10:42 am

Thank you so much for your fast answer.

I tried what you suggested but I got error :? :

Code: Select all

AT
OK

AT^SETPORT="FF;10,12"
ERROR

AT^GETPORTMODE
^GETPORTMODE: TYPE: WCDMA: huawei,,pcui:0,3g_modem:1,ncm:2
What I should try next?

sparkie777
Posts: 206
Joined: Tue Nov 27, 2012 4:37 am

Re: Reconnecting Huawei USB dongle E3372H on RPi3B

Fri Jul 10, 2020 11:15 am

Very odd. After each configuration change make sure to temporarily unplug the modem from USB.

did you try all the devices '/dev/ttyUSB[0-9]' to connect?

You can list all the commands that are supported by the modem:

Code: Select all

AT+CLAC
Is '^SETPORT' not listed?

My system is setup minimally from 'debootstrap'. So there is no 'usbmodeswitch' or 'network-manager' that possibly could interfere.

I don't know what (running) software components in your system eventually could harm an online configuration change.

The firmware I use:

Code: Select all

ATI
Manufacturer: huawei
Model: E3372
Revision: 21.300.05.00.55
IMEI: 8..............
+GCAP: +CGSM,+DS,+ES
make sure to use a version with leading '21' since a leading '22' indicates HILINK (causing tons of issues here)

I wonder why my Modem dongle shows up like this in lsusb:

Code: Select all

Bus 003 Device 003: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
maybe because it's no E3372H but E3372

rohlik
Posts: 8
Joined: Sun Apr 05, 2020 3:58 pm

Re: Reconnecting Huawei USB dongle E3372H on RPi3B

Fri Jul 10, 2020 12:27 pm

Code: Select all

AT+CLAC
return also ^SETPORT

My firmware information:

Code: Select all

Manufacturer: huawei
Model: E3372
Revision: 21.315.01.00.1363
IMEI: 868230037021973
+GCAP: +CGSM,+DS,+ES
So you are right, I have E3372, not E3372H. Sory about that.

I will try remove usbmodeswitch and we will see.

sparkie777
Posts: 206
Joined: Tue Nov 27, 2012 4:37 am

Re: Reconnecting Huawei USB dongle E3372H on RPi3B

Fri Jul 10, 2020 1:03 pm

rohlik wrote:
Fri Jul 10, 2020 12:27 pm
I will try remove usbmodeswitch and we will see.
at least remove your special configuration for this you mentioned somewhere above.

Network- and Modem- Managers are not installed at all on my machine

nonetheless:

the main cause of your trouble "the spurious disconnects" are probably power-supply and/or USB contact/ cable issues.

rohlik
Posts: 8
Joined: Sun Apr 05, 2020 3:58 pm

Re: Reconnecting Huawei USB dongle E3372 on RPi3B

Wed Jul 22, 2020 6:52 am

I was able to finally set:

Code: Select all

AT^SETPORT="FF;10,12"

Before that I run this commands:

Code: Select all

AT&F0
AT^RESET
Which reset modem to factory settings and restart. I also deactivated usb-modeswitch as you suggested.

Interesting thing is that at^fhver command return:

Code: Select all

^FHVER:"E3372H-153 21.315.01.00.1363,CL2E3372HM Ver.A"
And there is E3372H instead of E3372 :?

Sadly, not all of my problem was solved. Network interface wwan0 is still present :|

Return to “Troubleshooting”