This sketch performs the following actions;
- Connects to local wifi
- Every 20 minutes, it pings 'google' (and if no reply - then 'cloudflare') and if it gets a response, the ESP will go to deep sleep mode for 20 mins, then repeat.
- If no reply is received from either, the sketch enters a loop, rechecking google & cloudflare, for a further 4 times, 1 minute apart.
- If no reply is received, the relay will remove power to the router for 5 seconds causing a router reboot.
- ESP will then go into deep sleep for 5 minutes to allow the router to stabilise.