knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

Solved - MQTT Connection drops after few seconds with using Adafruit NeoPixels #426

Open Hugeldugelking opened 6 years ago

Hugeldugelking commented 6 years ago

Hello, I'm working on a little project, where i can control my LED Strips over MQTT (with animations). Every millisecond strip.show() gets called and everything works great with receiving commands. But after a few seconds (~30) the connection to the broker fails and it tries to reconnect but everytime it fails (this doesn't happen without strip.show()). I tested the WiFi connection but everytime it tries to reconnect the WiFi connection seems ok.

When I call strip.show() on a single command coming via mqtt everything's fine.

In Issue #411 someone seems to have a simmilar problem and he should use an async mqtt client. Should this work for me too and if yes, why? Whats the difference?

chinloon commented 4 years ago

I am facing a somewhat similar problem. Occasionally the NeoPixel displays the wrong color, seems always GREEN at max brightness. Depending on how the commands are run, the NeoPixel could not switch off the max GREEN. Is ther esome interrupt conflict? I seemed to trace down to the client.connect("") command causing the problem...

Hugeldugelking commented 4 years ago

Hey, i don't remember exactly what the problem was but i'm using the fastled library now, which is working perfectly while being connected to a mqtt broker