{"id":48172115,"url":"https://github.com/mchsk/openwrt-lte-keep-alive","last_synced_at":"2026-04-04T17:35:13.621Z","repository":{"id":94595732,"uuid":"154718304","full_name":"mchsk/openwrt-lte-keep-alive","owner":"mchsk","description":"Having LTE modem up on OpenWRT but it keeps dropping the connection from time to time?","archived":false,"fork":false,"pushed_at":"2026-03-07T12:17:15.000Z","size":1774,"stargazers_count":41,"open_issues_count":2,"forks_count":31,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-07T18:58:31.550Z","etag":null,"topics":["connection","connection-manager","fix","lede","lede-project","lte","lte-dongle","network","online-monitor","openwrt","openwrt-multi-wan","openwrt-router","wan","wwan"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mchsk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-25T18:25:02.000Z","updated_at":"2026-03-07T12:17:18.000Z","dependencies_parsed_at":"2023-04-29T18:46:07.372Z","dependency_job_id":null,"html_url":"https://github.com/mchsk/openwrt-lte-keep-alive","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mchsk/openwrt-lte-keep-alive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchsk%2Fopenwrt-lte-keep-alive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchsk%2Fopenwrt-lte-keep-alive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchsk%2Fopenwrt-lte-keep-alive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchsk%2Fopenwrt-lte-keep-alive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mchsk","download_url":"https://codeload.github.com/mchsk/openwrt-lte-keep-alive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchsk%2Fopenwrt-lte-keep-alive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31407645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["connection","connection-manager","fix","lede","lede-project","lte","lte-dongle","network","online-monitor","openwrt","openwrt-multi-wan","openwrt-router","wan","wwan"],"created_at":"2026-04-04T17:35:13.083Z","updated_at":"2026-04-04T17:35:13.612Z","avatar_url":"https://github.com/mchsk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LTE Keep-Alive for OpenWrt\n\nA lightweight connectivity watchdog for OpenWrt routers with LTE/WWAN modems. When the connection drops, it restarts the interface. If restarts keep failing, it reboots the router.\n\nBuilt for routers in hard-to-reach locations — cabins, garages, remote sites — where manual intervention is not an option.\n\n## How it works\n\nA single daemon checks connectivity by pinging multiple DNS servers (8.8.8.8, 1.1.1.1, 9.9.9.9 by default). If **any** target responds, the connection is healthy.\n\nOn failure:\n\n| Consecutive failures | Action |\n|---|---|\n| 3 | Restart the WAN interface (`ifdown` / `ifup`) |\n| 6 | Restart the interface again |\n| 9 | Reboot the router |\n\nAll thresholds, targets, and intervals are configurable via UCI.\n\n## Requirements\n\n- OpenWrt 23.05 or later (tested on 25.12.0)\n- No extra packages needed — uses busybox `ping`\n\n## Quick install\n\nSSH into your router and run:\n\n```sh\nwget -q -O /tmp/install.sh https://raw.githubusercontent.com/mchsk/openwrt-lte-keep-alive/master/install.sh \u0026\u0026 sh /tmp/install.sh\n```\n\nThen edit the config to match your interface name:\n\n```sh\nvi /etc/config/lte-keepalive\n```\n\nStart the service:\n\n```sh\nservice lte-keepalive start\n```\n\n## Manual install\n\n```sh\n# Copy the files\nscp lte-keepalive root@router:/usr/bin/lte-keepalive\nscp lte-keepalive.init root@router:/etc/init.d/lte-keepalive\nscp lte-keepalive.config root@router:/etc/config/lte-keepalive\n\n# On the router\nchmod +x /usr/bin/lte-keepalive /etc/init.d/lte-keepalive\nservice lte-keepalive enable\nservice lte-keepalive start\n```\n\n## Configuration\n\nThe config lives at `/etc/config/lte-keepalive`. All values have sensible defaults.\n\n```\nconfig keepalive 'main'\n    option enabled '1'\n\n    # Network interface to monitor\n    option interface 'wwan'\n\n    # Space-separated IPs to ping (any response = online)\n    option ping_targets '8.8.8.8 1.1.1.1 9.9.9.9'\n\n    # ICMP packets per target\n    option ping_count '3'\n\n    # Seconds to wait for a ping reply\n    option ping_timeout '5'\n\n    # Seconds between checks\n    option check_interval '120'\n\n    # Restart interface after this many consecutive failures\n    option restart_threshold '3'\n\n    # Reboot after this many consecutive failures\n    option reboot_threshold '9'\n\n    # Seconds to pause during interface restart\n    option restart_delay '15'\n```\n\n### Common interface names\n\n| Protocol | Typical interface name |\n|---|---|\n| QMI | `wwan` or `wwan0` |\n| NCM | `wwan` |\n| ModemManager | `wwan0` or `lte` |\n| MBIM | `wwan` |\n| 3G/PPP | `3g-wan` |\n\nCheck your interface name with `uci show network` or in LuCI under **Network \u003e Interfaces**.\n\n## Logs\n\nAll events go to syslog. View them with:\n\n```sh\nlogread -e lte-keepalive\n```\n\nSample output:\n\n```\nlte-keepalive: Started: interface=wwan targets='8.8.8.8 1.1.1.1 9.9.9.9' interval=120s\nlte-keepalive: Connectivity check failed (1/9)\nlte-keepalive: Connectivity check failed (2/9)\nlte-keepalive: Connectivity check failed (3/9)\nlte-keepalive: Restarting interface 'wwan' (failure #3)\nlte-keepalive: Connectivity restored after 4 failure(s)\n```\n\n## Service management\n\n```sh\nservice lte-keepalive start     # Start the watchdog\nservice lte-keepalive stop      # Stop it\nservice lte-keepalive restart   # Restart (picks up config changes)\nservice lte-keepalive enable    # Start on boot\nservice lte-keepalive disable   # Don't start on boot\n```\n\n## Uninstall\n\n```sh\nwget -q -O /tmp/uninstall.sh https://raw.githubusercontent.com/mchsk/openwrt-lte-keep-alive/master/uninstall.sh \u0026\u0026 sh /tmp/uninstall.sh\n```\n\nOr manually:\n\n```sh\nservice lte-keepalive stop\nservice lte-keepalive disable\nrm /usr/bin/lte-keepalive /etc/init.d/lte-keepalive\n```\n\nThe config at `/etc/config/lte-keepalive` is preserved during uninstall.\n\n## Migrating from v1\n\nIf you used the old version (multiple `.sh` scripts with cron), remove the old files and cron entry:\n\n```sh\n# Remove old cron entry\ncrontab -l | grep -v internet-keep-alive | crontab -\n\n# Remove old script files\nrm -f internet-keep-alive.sh dns-test.sh restart-interface.sh restart-router.sh log.txt\n```\n\nThen follow the install instructions above.\n\n## File layout\n\n```\n/usr/bin/lte-keepalive           Main daemon script\n/etc/init.d/lte-keepalive        procd service definition\n/etc/config/lte-keepalive        UCI configuration\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchsk%2Fopenwrt-lte-keep-alive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmchsk%2Fopenwrt-lte-keep-alive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchsk%2Fopenwrt-lte-keep-alive/lists"}