My esp8266 is battery powered and sends data to Thingspeak every 15 mins and then goes to deep sleep. It works great but the battery life is way short of my calcs. The problem seems to be that every now and then the router/internet is down and then the battery is drained by repeated connection attempts.
What I would like is to limit the connection attempts to say 3 and then skip to deep sleep as normal as if everything had worked.
WiFi.disconnect();
WiFi.begin("VM172234-2G","Password");
while ((!(WiFi.status() == WL_CONNECTED))){
delay(300); }
At the mo have bog standard connection routine as above.
Can anyone advise of a simple and elegant solution?
TIA
Tim