Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
14.29k stars 3.05k forks source link

Adalight via serial glitches/flicker (after pixel 85) #2698

Open sh00bx opened 2 years ago

sh00bx commented 2 years ago

What happened?

Using Adalight via serial, I'm getting intermittent glitches towards the end of the signal going to the ESP. Out of my 116 pixels, the ones up to pixel 85 are fine, pixels > pos 85 occasionally flicker in random colors while the others remain accurate (can add a picture if needed). The flicker is noticable @ peek on web GUI as well.

Physical issue with installation has been ruled out. I managed to narrow the cause down to interference by wifi activity, proportional to traffic from/to wled:

I mostly tested on ESP32, but similar problems are noticable on ESP8266, but behavior is slightly different there (other pixels affected)

Random note: 85x3colors=255, so it might be related to some overflow (?)

Some further research lead me here: https://www.reddit.com/r/esp32/comments/inbgjn/led_ws8211_glitching_while_using_wifi_solved/

Could integration of FastLED-idf (or similar) be a solution?

To Reproduce Bug

Send Adalight to WLED via serial with >85 pixels

Expected Behavior

No flicker / accurate colors on pixels >85

Install Method

Self-Compiled

What version of WLED?

WLED 0.13.2-a0 (build 2203191)

Which microcontroller/board are you seeing the problem on?

ESP8266, ESP32

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

ChuckMash commented 2 years ago

May also be related to how the message-length bytes inside the incoming data packet are being decoded. I ran into the (seemingly) same issue with how the these bytes were being set while sending data out from WLED over serial. (#2628). If that is the case, the code that deals with that seems to be around here

edit However, that seems like it would not be the case if disabling WiFi works around it.

sh00bx commented 2 years ago

Yup I think I recall reading you mention it somewhere 🙂 And I agree meanwhile that it may not be related.. I'm not a great coder but I managed to butcher wled_serial.cpp down to a basic fasted sketch at some point to narrow this down. Issue persisted. So we might actually be looking at an upstream issue with wifi on esp here... If I run just the adalight sketch w/o wled (i.e. also no wifi) all is well though