OpenWrt Forum Archive

Topic: How to keep my 3G dongle always connected?

The content of this topic has been archived on 2 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi, I want my 3G USB modem to always be connected to the internet, because when it isn't exanging packets with the internet it automatically enters in a "stand by" state and produces lag when a new connection starts after it changes light colors (blue=stand by; green=connected).

This is really notorious when playing online games because often the game isn't constantly uploading/downloading info so makes the modem enter in stand by and then lags the hell out of it.

Hope someone can help me, I really appreciate your help <3

Maybe a watchdog script (ping)

Cron:

# WAN3 Restart -  ping fail:
* */2 * * * /root/wan3-watchdog.sh

Script (modify the name with that of your interface!):

# /root/wan3-watchdog.sh

tries=0
while [[ $tries -lt 5 ]]
do
    if /bin/ping -c 1 -I 3g-wan3 8.8.8.8 >/dev/null
    then
        exit 0
    fi
    tries=$((tries+1))
done
gcom -d /dev/ttyUSB1 # Signal check 
killall pppd # Restart Connection if fail ping

chmod 777 /root/wan3-watchdog.sh


Or maybe in cron, use the connection every minute(s):

 * */2 * * *  wget -O - -q -nv -t 1 --timeout=5 --delete-after http://ipecho.net/plain

(Last edited by murilo.xd on 30 Aug 2017, 07:33)

The discussion might have continued from here.