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

fastled-support
gplus
(Subrata Dey (subrodey)) #1

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?

(Jeff Tycz) #2

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?

(Reko Meriö) #3

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

(Subrata Dey (subrodey)) #4

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

(Subrata Dey (subrodey)) #5

@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.

(Will Tatam) #6

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

(Subrata Dey (subrodey)) #7

@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

(Reko Meriö) #8

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

(Subrata Dey (subrodey)) #9

@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.