first of all thanks for your work. This awesome stuff :)
Not sure if that happens only with me but my Wemos D1 gets randomly (sometimes after 10 minutes sometimes after 2 days) stuck in the WIFI connection loop. The Blue LED is on and stays on forever until i make a hardware reset. Then everything works normal again until it get stuck again. No fun of course so i added the code you see in the bottom right after which makes the Wemos go to sleep for a while if it can't connect to the Access point within 30 seconds.
I am a script kiddy. So it doesn't mean that this code is smart... but it works. Since then i never have to reset the Wemos any more.
I guess a restart after 30 seconds would have been the better option. Anyway. You get the idea.
My access point is the TP Link Archer 7 if that is of interest.
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
int z = 0;
while (WiFi.status() != WL_CONNECTED && z < 30) {
delay(500);
z++;
Serial.print(".");
}
if (WiFi.status() != WL_CONNECTED) {
// DeepSleep n microseconds
//
Serial.print("\nWifi Connection problems. DeepSleep for ");
Serial.print(sleepSeconds);
Serial.println(" Seconds");
ESP.deepSleep(sleepSeconds * 1000000);
}