Firmware watchdog and recovery

Recover from rare network hangs and sensor bus errors without climbing a ladder to power-cycle the board.

Top view of a blue Arduino Uno microcontroller board on a white background
Arduino-compatible boards run the sketch that polls probes and publishes JSON. Photo: Wikimedia Commons contributor. CC0

Garage hardware runs unattended for months. Rare hangs. Ethernet driver stalls, memory fragmentation, or sensor bus lockups: are cheaper to recover with a watchdog reset than with a ladder trip. A timed reset reboots the MCU and reinitializes shields and sensors.

When watchdog helps

  • Network stack freeze after router power blips.
  • Infinite retry loop on a disconnected DHT22 data line.
  • HTTP client backlog on the W5100 after sustained polling from the cloud.

Implementation notes

Pet the watchdog only when the main loop completes a full cycle: sensor read, LCD update, and HTTP housekeeping. Too-aggressive petting masks real deadlocks. Pair with DHCP renew and JSON serving logic in sketch polling main loop.

Operational expectations

Expect a brief JSON outage during reboot: seconds, not minutes. Stale reading debug distinguishes reboot gaps from feed misconfiguration. Ethernet stacking notes: Ethernet shield stacking.