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.59k stars 3.13k forks source link

ESP32-S2 support ? #966

Closed johnall203 closed 1 year ago

johnall203 commented 4 years ago

Hello noob here. I was wondering if the newer ESP32-S2 board was supported ? Has anyone tried it and is the installation process the same as the regular ESP32 ? I figured if I was going to try it but wanted to be sure before making a purchase. Thank you for the help ! John

Aircoookie commented 4 years ago

Hi! Seems like the ESP32 Arduino core team is working on it, but the ESP32-S2 doesn't appear to be 100% compatible with the existing sources and binaries: https://github.com/espressif/arduino-esp32/issues/4066

So most likely there is no support for the ESP32-S2 yet until it is supported in the Arduino Core. Will use this issue to track ESP32-S2 support specifically in regards to WLED :)

stale[bot] commented 3 years ago

Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs. Thank you for using WLED!

vetezeTE commented 3 years ago

Any updates on the ESP32-S2 boards? I bought 4 of these not really thinking it would be an issue but I haven't been able to get WLED to work with them.

vetezeTE commented 3 years ago

Unexpected error: ESP Chip Auto-Detection failed: Unexpected UART datecode value 0x00000500.

misery commented 3 years ago

I found/added experimental support for my ESP32-S2 in ESPHome: https://github.com/esphome/esphome/pull/1433

As WLED also uses platformio it could be adopted easily until it is full supported?

[env:esp32s2]
board = nodemcu-32s
board_build.mcu = esp32s2
board_build.partitions = partitions.csv
framework = arduino
platform = espressif32@1.12.4
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.2
misteraddons commented 2 years ago

I would also like to know if there's any update on this? ESP32-S2 has been out for a year now and it seems like the future. Thanks :)

blazoncek commented 2 years ago

I would also like to know if there's any update on this? ESP32-S2 has been out for a year now and it seems like the future. Thanks :)

It works, kind of. The last reports I've heard of complained about LittleFS having issues on S2. WLED now officially includes a S2 build environment (saola) so you can build it yourself.

misteraddons commented 2 years ago

Where might I find the complaints? Is it a critical issue or an annoyance? Thank you for responding so promptly.

On Tue, Oct 5, 2021 at 12:56 PM Blaž Kristan @.***> wrote:

I would also like to know if there's any update on this? ESP32-S2 has been out for a year now and it seems like the future. Thanks :)

It works, kind of. The last reports I've heard of complained about LittleFS having issues on S2. WLED now officially includes a S2 build environment (saola) so you can build it yourself.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Aircoookie/WLED/issues/966#issuecomment-934683059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMFWWHXA5WG3ZWCOXQ72HJDUFNC5PANCNFSM4NUDSKSA .

blazoncek commented 2 years ago

Discord.

ByronAP commented 2 years ago

BUMP

lsiudut commented 2 years ago

FWIW I managed to build WLED for ESP32-S2 with minor (yet dirty) patches over LittleFS (which is now part of arduino-esp32) and ESPAsyncWebServer (mbedtls was apparently bumped to newer version). Haven't had much time for detailed testing but it seems to be working just fine (w/ ws2811 at least).

Given that I care about newborn baby now I don't expect myself to have time to familiarize myself with the codebase to submit a high quality PR. I don't know how far has the project went with the issue, maybe there's cleaner way of making it buildable already, but in case there isn't, here are gists with patches that make it work:

misery commented 2 years ago

Funny... nearly at the same time: https://github.com/Aircoookie/WLED/pull/2452 😉🙃

lsiudut commented 2 years ago

Ah, there you go. I haven't even check PRs. Disregard then :).

KishCom commented 2 years ago

Thought I'd chime in here with some recent experience. On my ESP32-S2-saola dev boards:

Using it to drive 256 Dotstars (APA102) seems to work just perfectly! (-DUSE_APA102)

Using it to drive 600 WS28XX LEDs, I start hitting the RMT error described here.

kudlav commented 2 years ago

Tried to build 0.13.1 with esp32s2_saola target. There are two problems making WLED unusable: 1) Switching the presets doesn't work. ESP closes the WebSocket connection (Connection Closed: 1005 ) after sending the request to switch a preset. Preset is not switched, and a new WebSocket connection is immediately created. JSON and HTTP interfaces doesn't change preset either, without any error codes or messages. 2) ESP32-S2 work only with 0-15 segments. After adding 16 segment (with id 15), WLED stops communicating via websockets and dosn't response to HTTP API commands. Removing 16 segment brings all functionality back.

blazoncek commented 2 years ago

Anyone interested may try https://github.com/blazoncek/WLED/tree/esp32-s2 Please use this as PIO environment:

[env:lolin_s2_mini]
platform = espressif32@5.1.1
board = lolin_s2_mini
board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
board_build.flash_mode = qio
upload_speed = 460800
upload_port = /dev/cu.usbmodem01
monitor_port = /dev/cu.usbmodem01
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s2.build_flags}
  -DBOARD_HAS_PSRAM
  -D ARDUINO_USB_CDC_ON_BOOT
  -D WLED_USE_PSRAM
  -D WLED_WATCHDOG_TIMEOUT=0
  -D CONFIG_ASYNC_TCP_USE_WDT=0
  -D LEDPIN=16
  -D BTNPIN=0
  -D HW_PIN_SCL=35
  -D HW_PIN_SDA=33
  -D HW_PIN_CLOCKSPI=7
  -D HW_PIN_DATASPI=11
  -D HW_PIN_MISOSPI=9
  -D STATUSLED=15
  -D WLED_DEBUG
  -UWLED_USE_MY_CONFIG
lib_deps = ${esp32s2.lib_deps}
michael-blue2 commented 1 year ago

@blazoncek Thank for your efford for the work that you did! I build the bin file using visual studio with the settigns you suggested in the PIO. I just need some help with flashing. Even when running esphome, i was only able to make them work with this method: while holding the O button connecting to pc. then press once the rst button and after some sec release the O. that would take the esp s2 into download mode. after I use esptool to erase the flash: esptool ip com9 erase_flash without doing anything on the esp, I would then go to esphome and flash it. It always needed 2 times. first time pressing the flash gives an error. second it loads and everything from there its all good (update online and everything) When I was trying to make it work with esphome i did try to flash bootleader first and then my bin file but no luck. So now back to wled. I do have the bin file ready and i have tried flashing with esptool( it does flash succesfully but wifi ap doesnt work. any other ways that i have tried doesnt work. Any ideas?

blazoncek commented 1 year ago

What worked for me (until I understood how things work) I flashed MiroPython 1st using the instructions on their page using esptool. Once MicroPython was up & running. I flashed firmware.bin from PIO build folder at the address 0x10000. You may skip the MicroPython if you flash with PIO but make sure you have correct partition map .CSV file.

blazoncek commented 1 year ago

Unfortunately running WLED on S2 is still very much hit & miss. If you do not access web UI it will be running ok, but frequent UI access will cause it to loose wifi connection or reboot. It may be a flaw in WiFi or TCP stack or AsyncWebServer incompatibility.

softhack007 commented 1 year ago

Just stumbled over this bug report for CDC on S2: "Issue realted ESP32-S2 CDC to the Serial.setDebugOutput(true)" https://github.com/espressif/arduino-esp32/issues/6766#issuecomment-1251546266 seems that debug out from parallel tasks will cause a lock-up.

https://github.com/espressif/arduino-esp32/pull/7284 "When using ESP32-S2 with USB CDC and debug output is set also to go to the CDC (Serial.setDebugOutput(true)), the S2 freezes after a few line of logging. It works fine on the ESP32-S3"

blazoncek commented 1 year ago

@softhack007 it looks like omitting ARDUINO_USB_CDC_ON_BOOT and WLED_DEBUG provide a more robust working on S2. Unfortunately no debugging possible on Lolin S2 mini board. Still not perfect though.

Germaine-Sail commented 1 year ago

Anyone interested may try https://github.com/blazoncek/WLED/tree/esp32-s2 Please use this as PIO environment:

Apologies if I'm asking a silly question but the above link seems not to work, I'd like to compile this code for an ESP32-S2, I take it the above link use to navigate to a WLED clone that was tweaked for the above IC.

Thanks Germaine

blazoncek commented 1 year ago

It has been since merged into main WLED.

michael-blue2 commented 1 year ago

It has been since merged into main WLED.

How do you guys install wled on the s2? I had lots of trouble just installing the esphome as well. but managed to find a way using their online installation but just needed 2 times of the sequence

blazoncek commented 1 year ago

Please use WLED forum or Discord for help and support questions. As a side note: it is a waste of time ATM to try anything on S2.

tanner0101 commented 1 year ago

I was able to get WLED running on my S2 mini board using the lolin_s2_mini env.

To do this I just followed the normal install instructions for compiling binary but overriding default envs to the s2 one @blazoncek added.

; default_envs = esp32s2_saola
+default_envs = lolin_s2_mini

I was a little confused on whether I needed to flash a bootloader or not. I ended up flashing the ESP32 v4 bootloader as the docs recommend. I did this using esptool.py.

I also tried flashing the binary with esptool.py but ultimately just used the "upload" button in PlatformIO as that was easiest. Had to reset things a few time on my bread board but then it worked! I'm able to connect over WiFi and everything.

IMG_1003

Note that to get the ESP32 to connect over USB I had to hold the two buttons while for 1-2s while plugging it in.

I've read there may be issues but I think it might be worth allowing this via the installer website maybe behind a warning just so its a bit easier to try for folks.

Hoping to learn more about how WLED and PlatformIO work soon so that I can contribute :) Awesome work on this project I love it.

blazoncek commented 1 year ago

ESP32 variants S2, S3 and C3 are partially supported but still very much experimental. Partially due to buggy Espressif core libraries and lacking support in underlying Arduino platform libraries.

softhack007 commented 1 year ago

@tanner0101 thanks for sharing the details on how you made your board work. I agree that currently the best approach is to build yourself in platformio. Pre-build .bin files are often not working on other boards.

I was a little confused on whether I needed to flash a bootloader or not. I ended up flashing the ESP32 v4 bootloader as the docs recommend. I did this using esptool.py.

The standard " ESP32 v4 bootloader" cannot work on -S2, as the CPU instruction set is different. You were lucky that platformIO upload also replaces invalid bootloaders.

fredolivas commented 1 year ago

I recently received an Adafruit Metro ESP32-S2 development board with the hopes of connecting it with WLED software. I haven't been able to install WLED onto this board even though I can see it in the COM devices list! Is there any solution for this board & WLED available that I'm just not finding?

blazoncek commented 1 year ago

Please use WLED forum or Discord for help and support questions. This issue is closed as S2 is (partially) supported, though still in experimental phase.

My personal experience is that do not expect too much from it.