This example suitable for new esp unit or location change scenario.
But, in regular using situation, wifi signal unstable or AP temporary offline will cause
esp falling into broadcasting mode and stay offline forever.
So, I thought esp should be auto back online or auto reconnect, in order to maintain normal operation.
below is my enhancements
add timeout object
Metro broadcastModeTimeout = Metro(180000);
reconnect AP when broadcasting mode timout
add code in function manageESPHelper()
if ((wifiStatus == BROADCAST) && broadcastModeTimeout.check())
{
Serial.println("BROADCAST mode timeout and reset ESP");
ESP.reset();
delay(5000);
}
broadcast timeout timer reset after broadcastmode activated
add code in function checkForWifiTimeout() after myESP.broadcastMode()
broadcastModeTimeout.reset();
In my simple test, it's ok.
I hope someone can make it better.
I had try updateNetwork(), but i failed.
This example suitable for new esp unit or location change scenario. But, in regular using situation, wifi signal unstable or AP temporary offline will cause esp falling into broadcasting mode and stay offline forever. So, I thought esp should be auto back online or auto reconnect, in order to maintain normal operation. below is my enhancements
Metro broadcastModeTimeout = Metro(180000);
broadcastModeTimeout.reset();
In my simple test, it's ok. I hope someone can make it better. I had try updateNetwork(), but i failed.