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
354 stars 60 forks source link

Lag #8

Closed PeeVv closed 6 years ago

PeeVv commented 6 years ago

Hi! I ran into some problems using this library on a NodeMCU 1.0. When using the library in combination with QLC+, it seemed to work previously without problems. I could control 4 led strips without any lag. But now the 8266 does not seem to be keeping up with the data, making the controls lag. The following times in ms are reported per onDmxFrame iteration:

169 1 2 2 2 1 2 2 1 2 190 1 2 2 3 2 1 2 1 2 etc.

So it seems to be working fine, until every 10th package where the time to process the data rises significantly. Occasionally it works realtime for a few seconds and it shows this sequence:

13 20 20 20 21 19 20 20 22 5 6 6 5 6 7 5 18 20 20 20 20 19 21 19

Which seems for feasible since QLC+ sends Artnet at 50hz, so around 20ms is the max time per iteration to prevent lag. This problems rises with both the 80Mhz and 160Mhz mode on different 8266-modules. Do you have any idea why this sudden spike in processing time arises?

PeeVv commented 6 years ago

Whoops, never mind, after debugging for hours and just after posting this, I had an epiphany. I guessed the 8266 maybe connected to the wrong access point (one which is a few rooms away instead of the one right next to it). Using a wifi which only the nearest AP broadcasts made it work in realtime again.