Hello Community Members, I need some help with a problem.

Hello Community Members, I need some help with a problem.

I am using a NodeMcu Esp8266, to run some FastLed Animation that can be changed with MQTT command. 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?

If you lose internet and that is what you solely rely on to update the animation how do you expect to find a way around it?

Do you perhaps have some check running on a loop trying to connect back to internet? If so, that is probably the problem and you need to maybe try adding some delay to how often it tries again to connect. Maybe like trying to connect every ten seconds

@Jeff_Tycz Internet is only used to change the animation. However if the connection is lost the running animation freezes.

@Reko_Merio Yes I do, and I tried adding delay it didn’t wotk. Seems like a inturrupt. When connection is lost and wifi tried to reconnect fastled probably cannot write the led animation sequence.

If you can share your code, we can see where it might be getting stuck

@Will_Tatam here it is https://github.com/CyanLabs/ESP-MQTT-JSON-Digital-LEDs/blob/master/ESP_MQTT_Digital_LEDs/ESP_MQTT_Digital_LEDs.ino

Well there’s the problem, reconnect function has while condition in it. Replace that with if and I think it should improve it a lot

@Reko_Merio Thank you for the reply. While dint work however PubSub Client library does have a way to handle Reconection without blocking the main loop. That works well.