I have a Huawei E3351 3G dongle connected to a Pi which requires maximum unattended uptime. Ensuring that the connection remains solid over time has been a troublesome endeavour, largely due to unfamiliarity with the environment and best practices to manage this connection. I currently use usb_modeswitch to achieve the modem mode on the 3g dongle.
sudo udevadm trigger is called to manually perform the modeswitch if Raspian did not achieve this.
At an unknown length of time from powering up the Pi, the 3G connection will drop, anywhere from a few minutes to a few weeks. A primitive method to fix this was just simply restarting the Pi via
sudo reboot. We can probably all agree that this would be bandaid solution rather than addressing the root cause. However, the problem occasionally persisted over reboots, and required a physical power cycle (disconnecting and reconnecting the power to the Pi) in order to work.
A new method was to employ a script that takes down the network interface, cycles power on the USB bus, and brings the network interface back up:
#!/bin/sh ifdown etho0 sleep 1 echo 0 > /sys/devices/platform/bcm2708_usb/buspower sleep 1 echo 1 > /sys/devices/platform/bcm2708_usb/buspower sleep 2 ifup etho0
However, this exposed an issue which I believe is the real problem that requires addressing:
Listening on LPF/etho0/ADDRESS Sending on LPF/etho0/ADDRESS Sending on Socket/fallback DHCPRELEASE on eth0 to 220.127.116.11 port 67 send_packet: Network is unreachable send_packet: please consule README file regarding broadcast address. ifup: interface etho0 already configured
The current idea is to just increase the sleeping period between the power cycle from 1 second to 5 seconds. Testing this strategy is difficult, as it is unknown when the problem will manifest. It also feels like another bandaid solution rather than addressing the root cause.
What strategies can I employ to overcome this problem? Are there any further calls I can perform to further increase reliability?
Please let me know if you need more context.