ph1p / ikea-led-obegraensad

ESP32/Arduino hack for the ikea OBEGRÄNSAD led wall lamp
MIT License
578 stars 78 forks source link

Add DDP client plugin #104

Closed zuckschwerdt closed 3 months ago

zuckschwerdt commented 4 months ago

I'm recently playing around with some LED controllers (e.g. LedFx).

How about adding a DDP client plugin?

This is a very rough sketch to illustrate and as POC.

There are some discussion points:

zuckschwerdt commented 3 months ago

This is battle-tested now and works very well.

On an ESP32 I thoroughly tested the interaction between network on Core 0 and drawing on Core 1, I was expecting some tearing maybe but nothing is visible -- we need not care if onScreenTimer's SPI writing reads the renderBuffer while a DDP update is only partially written.

No need to invest in checking the protocol headers. All tools (and renderes) I had a look at just write (and assume) valid (non-extended) RGB DDP frames. There is no harm in reading broken frames (or even garbage UDP data), the display might look funny that's all.

I changed the loops to properly use COLS and ROWS for forward compatibility and also updated two other places to use the constants.

This is ready for review and merge now.