# Frequent disconnection using Huawei MS2131i-8 3G USB dongle

**URL:** <https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858>\
**Category:** Product support\
**Tags:** support, network\
**Created:** [August 31, 2018, 4:14pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858 "2018-08-31T16:14:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [August 31, 2018, 4:14pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/1 "2018-08-31T16:14:02Z")

</div>

Hi there,  
I’m experiencing frequent disconnection when using a Huawei MS2131i-8 3G USB dongle on a Raspberry Pi 3 B+ installed with Resin OS 2.13.6+rev1.  
Some times I’ve been able to recover from problems disabling the connection, removing the huawei\_cdc\_ncm kernel module, reloading it then enabling the connection again.  
Other times I had to restart ModemManager on the host via a DBUS call.  
Any ideas?  
Regards,  
Danilo

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [September 1, 2018, 4:40am UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/4 "2018-09-01T04:40:35Z")

</div>

Hi. Can you provide the output of `journalctl --no-pager -u NetworkManager` when these disconnects happen please?

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 1, 2018, 7:43am UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/5 "2018-09-01T07:43:02Z")

</div>

Sure. Here it is:

```
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.3850] policy: auto-activating connection 'h3g' (09d0ce75-bf1b-4bed-aea4-6d1890f47d61)
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.3927] device (ttyUSB2): Activation: starting connection 'h3g' (09d0ce75-bf1b-4bed-aea4-6d1890f47d61)
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.3946] device (ttyUSB2): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.4014] device (ttyUSB2): state change: prepare -> need-auth (reason 'none', sys-iface-state: 'managed')
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.4117] device (ttyUSB2): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.4215] modem["ttyUSB2"]: modem state changed, 'registered' --> 'connecting' (reason: user-requested)
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.4357] modem["ttyUSB2"]: modem state changed, 'connecting' --> 'registered' (reason: user-requested)
Sep 01 07:40:07 b651902 NetworkManager[716]: <warn> [1535787607.4362] modem-broadband[ttyUSB2]: failed to connect modem: Couldn't connect: cannot keep data port open.Could n
ot open serial device ttyUSB0: it has been forced close
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.4365] device (ttyUSB2): state change: prepare -> failed (reason 'unknown', sys-iface-state: 'managed')
Sep 01 07:40:07 b651902 NetworkManager[716]: <warn> [1535787607.4402] device (ttyUSB2): Activation: failed for connection 'h3g'
Sep 01 07:40:07 b651902 NetworkManager[716]: <info> [1535787607.4417] device (ttyUSB2): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
```

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [September 1, 2018, 8:08am UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/6 "2018-09-01T08:08:28Z")

</div>

Thanks for the logs, we’re aware of similar problems.  
What is the SIM type you are using? Is it a special SIM or a regular one from a mobile carrier?

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 1, 2018, 8:44am UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/7 "2018-09-01T08:44:34Z")

</div>

It’s a regular SIM. Actually a data-only Super Internet PRO 30 GB from Wind Tre here in Italy.

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 2, 2018, 8:55pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/8 "2018-09-02T20:55:20Z")

</div>

BTW, do you think that trying with a different SIM may solve the problem??

I have now two Raspberry Pi 3 B+ using a MS2131i-8 modem. Both suffer frequent disconnection.  
The strange thing is that is always work on one board only, while the other also seems to need to be rebooted some times.

The code is this (the reboot is not included, but it is done via HTTP communication via the Supervisor):

```
try:
    tlshoot.network.connection.connectionDisable( modemconnection )
    time.sleep( 5 )
    modules.rmmod( 'huawei_cdc_ncm' )
    time.sleep( 5 )
    modules.modprobe( 'huawei_cdc_ncm' )
    time.sleep( 5 )
    tlshoot.network.connection.connectionEnable( modemconnection )
    time.sleep( 5 )
except Exception as exception:
    syslog.syslog( syslog.LOG_ERR, "can't reset modem: {}".format( str( exception ) ) )
try:
    import dbus
    bus = dbus.bus.BusConnection( 'unix:path=/host/run/dbus/system_bus_socket' )
    systemdmanagerproxy = bus.get_object( 'org.freedesktop.systemd1', '/org/freedesktop/systemd1' )
    systemdmanager = dbus.Interface( systemdmanagerproxy, 'org.freedesktop.systemd1.Manager' )
    job = systemdmanager.RestartUnit( 'ModemManager.service', 'fail' )
except Exception as exception:
    syslog.syslog( syslog.LOG_ERR, "can't reset network: {}".format( str( exception ) ) )

```

Regards,  
Danilo

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [September 3, 2018, 5:36am UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/9 "2018-09-03T05:36:54Z")

</div>

We have observed this kind of problem on particular SIM cards. If you can use a SIM card from a different provider for a while to test this, it would be great.

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 3, 2018, 2:48pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/10 "2018-09-03T14:48:17Z")

</div>

Ok, I’m going to try with 3 different SIMs/operators in the next days.

Have you got any suggestion to get out of troubles by resetting/restarting/clearing something within the container or the host OS? Something different from turning off and on again the Raspberry or detaching and attaching again the 3G dongle. That is, something that may stay within the code.

I’m trying with three different options:

1. Reloading the huawei\_cdc\_ncm kernel module via rmmod/modprobe within the container
2. Restarting the ModemManager Systemd unit via DBUS on the host from the container
3. Rebooting the system via Supervisor using curl on the container

I believe that I have still not found the root cause, because the first action may be sufficient some times, while other times I also need to reboot. Also, just rebooting may work… or not!

Also, is there any data/log/whatever I can obtain from within my container as long as I detect a network outage for debugging?  
E.g. Is there any way to obtain the NetworkManager/ModemManager logs from the host OS from within the container?

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [September 4, 2018, 8:24pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/11 "2018-09-04T20:24:50Z")

</div>

You can see this sample project [https://github.com/resin-io-playground/resin-nmcli](https://github.com/resin-io-playground/resin-nmcli) and user nmcli to inspect and to try and bring the connection down and up again with it.

Have you managed to try with different SIMs? I am interested in the test results with SIMs from other mobile carriers

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 5, 2018, 5:12pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/12 "2018-09-05T17:12:12Z")

</div>

I’ve activated 3 more SIM from Ho Mobile (Vodafone), Kena Mobile (TIM) and Iliad here in italy.  
The first two are under testing right now.

Have you any suggestion about wath to look for with nmcli?  
Is there any way a can “save” the journal for the NetworkManager unit from the host OS or get it via the container?

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [September 7, 2018, 5:01am UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/13 "2018-09-07T05:01:30Z")

</div>

Hi. We are testing a fix currently. Will come back to you in a few days when we have had enough time to confirm the modem stability with the changes we did

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 8, 2018, 4:32pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/14 "2018-09-08T16:32:35Z")

</div>

Great!  
By now, I’m experiencing the same problem on all the new SIMs. Maybe one of them is giving the error less frequently.  
Also, most important, I’m experiencing the problem even if the Raspberry Pi is also connected to my network via Ethernet!

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 10, 2018, 12:26pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/15 "2018-09-10T12:26:54Z")

</div>

Hi @floion!  
Is there any issue I can follow on GitHub or something else can would allow me to “partecipate”?  
As said before, now I have some new Raspberry Pi 3 B+ with Resin OS 2.13.6+rev1 on board for testing and all of them are disappearing from time to time. The problem pesistes even if the boards are connected to an Ethernet network, non only with the 3G dongle. Also, just reboot does not always work!

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [September 10, 2018, 2:15pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/16 "2018-09-10T14:15:57Z")

</div>

@daghemo we have merged the modem fix so this will be available in the next OS release (due in about 1 week).  
Also, for the WiFi disconnect problems, can you try to replicate that on the latest OS versions available? (2.15.1+rev1)

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 10, 2018, 2:49pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/17 "2018-09-10T14:49:20Z")

</div>

Ethernet disconnect problems, not WiFi.  
Is there any issue/article/whatelse than I can look at? Or, in other words, what was the problem?

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 11, 2018, 10:28am UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/18 "2018-09-11T10:28:24Z")

</div>

As of yesterday I switched from 2.13.6+rev1 to 2.15.1+rev1.

As you may remember I have 3 Raspberry Pi 3 B+ with both Ethernet and 3G USB dongle connected (no WiFi).  
The SIM are from different operators.  
After updating to 2.15.1+rev1 the problem still remains. Some hours ago I disconnected the 3G USB dongles from the first 3 boards and the problem seems to have disappeared. That is, just having the 3G USB dongle configured and connected creates problems, even if the boards have their default gateway on the Ethernet!

I have other boards with 2.17.7+rev1 and they do not present the same problem.

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [September 11, 2018, 1:43pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/19 "2018-09-11T13:43:22Z")

</div>

Hi. The fix for this was [https://github.com/resin-os/resin-raspberrypi/pull/242](https://github.com/resin-os/resin-raspberrypi/pull/242)

This fix has not made it into 2.15.1+rev1. It will be present in the next `2.15` release which is due in the next few days.

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 11, 2018, 5:03pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/20 "2018-09-11T17:03:14Z")

</div>

Thank you @floion! BTW, I was trying 2.15.1 just because of your other post here above.

Do you think that deleting 77-mm-huawei-net-port-types.rules from within /mnt/sysroot/{active,inactive} on the host OS will work in the meantime? I’m going to try in the next few hours.

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [September 12, 2018, 6:53am UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/21 "2018-09-12T06:53:12Z")

</div>

@daghemo that is exactly what YOU SHOULD NOT DO.  
You actually need to add

> # Airtel branded E3372h-607, using huawei-cdc-ncm driver but with unresponsive cdc-wdm port  
> ATTRS{idVendor}==“12d1”, ATTRS{idProduct}==“1506”, ENV{ID\_MM\_HUAWEI\_NDISDUP\_SUPPORTED}=“1”

to `/lib/udev/rules.d/77-mm-huawei-net-port-types.rules ` just before this line

> LABEL=“mm\_huawei\_port\_types\_end”

---

<div class="post-metadata">

**Author:** ![daghemo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/daghemo/32/531_2.png) [@daghemo](https://forums.balena.io/u/daghemo)\
**Post date:** [September 12, 2018, 5:10pm UTC](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858/22 "2018-09-12T17:10:23Z")

</div>

Well, you are obviously right. 🙂  
I’ve added that line and will test on 2.15.1 for some days.

[Next page](https://forums.balena.io/t/frequent-disconnection-using-huawei-ms2131i-8-3g-usb-dongle/3858.md?page=2)
