How to Automatically Reboot a LoRaWAN Gateway When the Internet Connection is Lost

Learn how to install and configure Watchcat on your LoRaWAN gateway to automatically reboot when the Internet drops—helping you maintain reliable, uninterrupted connectivity with Telemetry2U.

How to Set Up Auto-Reboot on Your LoRaWAN Gateway

If your LoRaWAN gateway loses Internet connectivity, an automatic reboot can help restore service without manual intervention. This guide explains how to use Watchcat—a lightweight watchdog utility—to monitor the connection and trigger a reboot when needed, helping ensure continuous communication with the Telemetry2U platform.

Before You Begin

Before starting, ensure your gateway is running the latest firmware and is connected to the Internet via Wi-Fi or Ethernet.

Accessing Your Gateway via SSH

To configure the auto-reboot functionality, access your gateway via SSH over the LAN port. If you don't already have an SSH client installed, we recommend using PuTTY. The default Dragino SSH login details are:

  • Address: 10.130.1.1 (unless it has been changed)
  • Port: 2222 (try port 22 if 2222 doesn’t work)
  • Username: root
  • Password: dragino

Updating the Package Manager

Run the following command to update the opkg package manager:

  • opkg update

Installing Watchcat

Install the Watchcat package using this command:

  • opkg install watchcat

Configuring Watchcat

Configure Watchcat to ping Google’s DNS server (8.8.8.8) every 2 minutes, and reboot the gateway if no response is received within 30 minutes. Enter the following commands:

  • 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

Rebooting to Start Watchcat

Reboot the gateway to apply the changes and start the Watchcat service:

  • reboot
Watchcat configuration example for auto-rebooting LoRaWAN gateway

Verifying Watchcat is Running

After the gateway has rebooted, log in again and run the following command to confirm that Watchcat is running:

  • ps | grep "[w]atchcat"

Understanding the Output

If Watchcat is running, you’ll see an output similar to this:

  • 1590 root 1200 S /bin/sh /usr/bin/watchcat.sh period 1800 60 8.8.8.8 120

In this output:

  • 1800 = 30-minute delay before reboot (in seconds)
  • 120 = Delay between ping attempts (in seconds)
  • 60 = Grace period before performing a forced reboot