bruhautomation / ESP-MQTT-JSON-Digital-LEDs

(OBSOLETE) ESP8266 MQTT JSON Digital LEDs for Home Assistant
https://youtu.be/9KI36GTgwuQ
Apache License 2.0
511 stars 268 forks source link

Animation Freezes upon internet/wifi disconnection #113

Open insane2subro opened 5 years ago

insane2subro commented 5 years ago

My problem is when ever the wifi/internet disconnects the animation freezes only to resume after the wifi/internet is back.

In India where data disconnection is very frequent with all ISPs it is a big problem, is there any way out of this?

bryanberger commented 5 years ago

@insane2subro You can add a conditional in the main loop function to try and reconnect to WiFi.

This is what i've done and it works fine.

  if (WiFi.status() != WL_CONNECTED) {
    delay(1);
    Serial.print("WIFI Disconnected. Attempting reconnection.");
    setup_wifi();
    return;
  }