Router resetter enclosure - ESP8266 pinging websites

Electronics box for a device to power cycle a fibre ONT and router: ESP8266, relay tests internet ping
0
6
0
55
updated August 27, 2024

Description

PDF

When my fibre service falls away, it does not always reconnect, and I have to power cycle the ONT and router to regain connection to the service provider.

ESP8266 code to power cycle a router if three different website pings all fails. Integrates with Home Assistant (HA) with auto-discovery via MQTT. Developed using the Arduino framework.

The ESP8266 pings three different web sites every ten seconds. If all three sites do not return replies for four tries (40 seconds), it is assumed that the internet is not connected and the power cycle is initiated. Power is down for some time, and then the ESP waits for a reconnect period before testing pings. The ESP is reboot every day to prevent memory leaks over long-term operation.

The state is displayed on three LEDS. The states are as follows:

  1. LED_WAIT (blue) power up & waiting for ping respond
  2. LED_PING (green) ping successful
  3. LED_DOWN (red) power out output relay is down

The relay normally-closed contacts are used, hence the relay is not consuming power and the system fails safe (keeping power on the output).

Code is here: 

https://github.com/NelisW/Router-Resetter

The enclosure uses Onesto Matrix connectors:

https://www.onestosa.co.za/items/matrix?category=switches-and-sockets&type=2&access=2&id=976a9efb-3c9c-4569-a0f8-3e58bff9e735 

Tags



Model origin

The author marked this model as their own original creation.

License


Highlighted models from creator

View more