/openwrt-lte-keep-alive

Having LTE modem up on OpenWRT but it keeps dropping the connection from time to time?

Primary LanguageShell

OpenWRT LTE Keep-alive scripts

OpenWRT logo

Forked from: https://github.com/mchsk/openwrt-lte-keep-alive - Many Thanks!

Changes from original.

  1. Switched to ping to relieve netcat dependency.
  2. Reduced log-size to save memory <0.5MB.
  3. Reboot router on 3 ping fails.

What is this? Long story short.
These scripts provide an automated 'keep-alive' ping to maintain your LTE modem connection on the carrier network and, if the connection fails, restarts your router. You would probably find use of it when you need to have working internet in locations with difficult access, e.g. cabin in the woods, garage or your house on Seychelles.

How it works?
All the scripts run on ash which is the basic shell for OpenWRT. The main script (internet-keep-alive.sh) tries to ping Google DNS servers (8.8.8.8) using [Ping]

  • If it fails 3 times in a row, it restarts whole system.
    Online/offline results are being logged into log.txt, which has a cap of 8000 lines, not to flood the whole space on the device.

Installation

  1. Log into the router via SSH and go to the directory where you want to keep the script files.
  2. Make sure the router is online, then run the installer using this command and follow the instructions:
    wget -q --no-check-certificate https://raw.githubusercontent.com/HiDef888/openwrt-lte-keep-alive/master/install.sh -O install.sh && chmod +x install.sh && ./install.sh
  3. Add to crontab: (internet-keep-alive.sh) at preferred interval.