rstephan / ArtnetWifi

Arduino library for Art-Net (artnet) over WiFi, send and receive DMX data. Runs on ESP8266, ESP32, Pi Pico W, WiFi101 and WiFiNINA devices.
Other
353 stars 59 forks source link

ws2801 lagging / skipping a frame every few seconds + flickering #20

Closed feuerziege closed 1 year ago

feuerziege commented 5 years ago

Hello, First of all, thank you for your work!

I tried to rework an old ws2801 led matrix, which is driven by a Raspberry Pi with OLA as an artnet->pixel gateway, with an ESP32 based on this firmware. My goal was to be able to free the Pi incl. USB Wifi adapter for other projects and to replace it with a more economical, slimmer always-on solution. The matrix consists of 4 panels connected in series with 8x8 pixels each. So it is basically a long string of 256 ws2801 modules. The voltage adjustment of the data and clock signals from 3.3 to 5V is done with a 74HCT08P. The pixels are divided into 2 universes with 384 channels each, the control is currently done with Jinx and this setup has worked very well so far.

The change from the Raspberry Pi to an ESP32 board was pretty straightforward and so the matrix lit up again very quickly. After the initial joy that everything seemed to work as I hoped it would, I quickly noticed two problems that didn't occur with the RasPi setup:

1) The animations stop every few seconds for a fraction of a second. The intervals between the dropouts are felt to be random and are in the range of 1...2 seconds. As if a buffer is running empty. It can be observed that the dropouts do not occur for a short time immediately after resetting the ESP. I can also observe in the web interface of my access point that a better data rate is displayed for the ESP module immediately after the connection is established, which quickly drops to a lower value and generally doesn't seem to be within the range of 802.11n, but rather b. Maybe this has something to do with it.

2) With the ESP32 suddenly the typical flickering of the leds appears, which indicates an unclean signal or a too high SPI speed, and I don't get it turned off completely. It shows up by default only in the last leds of the last panel. Since I suspected the SPI speed, I tried to reduce it by calling FastLED.addLeds with the parameter DATA_RATE_MHZ(1) or even DATA_RATE_KHZ(500). The results were relatively similar and there was no real improvement. However, with a higher data rate I was able to quickly increase the flickering... What is the default rate anyway? In my RasPi-OLA setup 2MHz SPI speed is set and nothing flickers. Also I still use the 74HCT08P circuit as a 5V "driver", so I can hardly explain this sudden deterioration. By the way, changing the output pins didn't change anything either.

I realize that there are many components involved here, and this may not be the best place to address these issues. But maybe you or someone here has had a similar situation before and can give me a hint in the right direction. If you need further information, please let me know. Thank you very much.

rstephan commented 5 years ago

Have you tested your setup with an FastLED example, just the LEDs, no WiFi? Is it working properly? The ESP32 is not a Raspbeery PI, so lower queue settings for WiFi, IP and UDP are possible. Sorry, that is all I can say. This is the ArtNet library not the lib for LEDs or WiFi.