MoonModules / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi! MoonModules adds features on top of upstream.
https://mm.kno.wled.ge
European Union Public License 1.2
228 stars 70 forks source link

Dmx input esp dmx #28

Closed netmindz closed 1 year ago

netmindz commented 1 year ago

Add support for listening to DMX, just like e1.31 and art-net but over a wired connection.

Note: needs the newer ESP32 platform so only enabled for the _V4 builds

netmindz commented 1 year ago

Please test using the esp32_4MB_V4_S build target

ewoudwijma commented 1 year ago

I see a compile error on:

image

Could you compile this separately and see what happens? Most likely over 100% flash size...

@softhack007 , should we change esp32_4MB_PSRAM_M to esp32_4MB_PSRAM_S (small) ? Or another way PSRAM is partitioned possible?

softhack007 commented 1 year ago

Could you compile this separately and see what happens? Most likely over 100% flash size...

@softhack007 , should we change esp32_4MB_PSRAM_M to esp32_4MB_PSRAM_S (small) ? Or another way PSRAM is partitioned possible?

Yes, I think that's necessary, as we are regularly fighting with size on the PSRAM config. Another option (but incompatible with previous installs) would be to use another partition file for that config - it would only have 256Kb for file system (LittleFS), but adds about 300Kb of program space.

I'll look into the compile errors 👍

netmindz commented 1 year ago

Yeah could squeeze a little more space for the app Vs file system that would be great. Don't think we really need much filesystem space for most users do we?

softhack007 commented 1 year ago

You can already do that for testing. I also gives you more space for debug build. Just uncomment line 263 in platformio.ini, and comment out line 262.

https://github.com/MoonModules/WLED/blob/922b8b69dbc0145b70be6c61cb73968dde254d0d/platformio.ini#L262-L263

Downside is, it leads to reformatting the flash, so you'll lose your config when uploading firmware with a different partitioning.

I'm just changing the PSRAM buildenv to "_S" - lets see if that's enough.

softhack007 commented 1 year ago

@netmindz technical question - are you relying on the SparkFun DMX driver (in wled dependancies folder), or using a different driver?

I'm hoping for the second, because the SparkFun driver does a few suspicious things (like timer interrupts on Serial2), and its not compatible with ESP32-S2 or ESP32-C3.

softhack007 commented 1 year ago

@softhack007 , should we change esp32_4MB_PSRAM_M to esp32_4MB_PSRAM_S (small) ? Or another way PSRAM is partitioned possible?

Just did both:

see my latest commit e8d3712d4f4e645e7cde3f476e138a3044371efe

netmindz commented 1 year ago

I'm using esp_dmx - which does use also uses interrupts and Serial2, I don't have any of the -S2, -S3 or -C3 board to test with sadly.

netmindz commented 1 year ago

Thanks, @softhack007 that's the builds all running green now.

ewoudwijma commented 1 year ago

Is this ready to merge? So can be part of the release ...

netmindz commented 1 year ago

I've tested and seems to work for me, was trying to get some other folk to test as well just to be sure.

As it's only enabled for the experimental _V4 builds it should be relatively low risk