Automatically rebooting LoRaWAN gateway when Internet connection unavailable
Some user installations may experience a loss of network connectivity after some period that requires a gateway reboot to resolve. This bulletin describes how to configure your gateway so that the Internet connection is monitored and an automatic reboot is performed when necessary.
Implementation
Before you begin, ensure your gateway is loaded with the latest firmware and connected to the internet via Wi-Fi or Ethernet
An SSH session to your gateway is required over the LAN port, if you do not have an SSH client already installed PuTTY (https://www.putty.org/) is recommended. The Dragino default password and connection details are:
- Address: 10.130.1.1 (unless it has been changed)
- Port: 2222 (try SSH port 22 if 2222 fails)
- Login as: root
- Password: dragino
Type following command to update the opkg package manager:
- opkg update
Type following command to install the "watchcat" package:
- opkg install watchcat
Configure watchcat with the following commands that will ping 8.8.8.8 (Google DNS) every 2 minutes and reboot after 30 minutes of no response:
- uci set system.@watchcat[0].period=30m
- uci set system.@watchcat[0].mode=ping
- uci set system.@watchcat[0].pinghosts=8.8.8.8
- uci set system.@watchcat[0].pingperiod=2m
- uci set system.@watchcat[0].forcedelay=60
- uci commit system
Now reboot to start watchcat:
- reboot
After the gateway has rebooted you may log back in and enter the following command to confirm that watchcat is running:
- ps | grep "[w]atchcat"
That command should show output such as the following:
- 1590 root 1200 S /bin/sh /usr/bin/watchcat.sh period 1800 60 8.8.8.8 120
The value 1800 represents the 30-minute delay period in seconds and 120 is the delay between ping attempts. The value 60 is the number of seconds to allow for a graceful shutdown before performing a forced reboot.
Get Started with T2U Today!
Begin with a 14-day free trial before choosing from one of three 'all-inclusive' plans.
Purchase hardware from our online store and you'll enjoy a 60-day free-trial