WLED icon indicating copy to clipboard operation
WLED copied to clipboard

ESP32-S2 support ?

Open johnall203 opened this issue 4 years ago • 25 comments

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

johnall203 avatar Jun 05 '20 16:06 johnall203

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 :)

Aircoookie avatar Jun 06 '20 22:06 Aircoookie

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!

stale[bot] avatar Oct 05 '20 01:10 stale[bot]

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 avatar Oct 15 '20 03:10 vetezeTE

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

vetezeTE avatar Oct 15 '20 03:10 vetezeTE

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 = [email protected]
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.2

misery avatar Jan 01 '21 15:01 misery

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 :)

misteraddons avatar Oct 05 '21 18:10 misteraddons

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.

blazoncek avatar Oct 05 '21 18:10 blazoncek

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 .

misteraddons avatar Oct 05 '21 19:10 misteraddons

Discord.

blazoncek avatar Oct 05 '21 19:10 blazoncek

BUMP

ByronAP avatar Nov 04 '21 16:11 ByronAP

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:

  • for WLED: https://gist.github.com/lsiudut/af6fcd9c9c2e9d30e777f61a77604a7e
  • for ESPAsyncWebServer: https://gist.github.com/lsiudut/1722a69cacef166539ac4c88d117c25f

lsiudut avatar Dec 27 '21 21:12 lsiudut

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

misery avatar Dec 27 '21 21:12 misery

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

lsiudut avatar Dec 27 '21 21:12 lsiudut

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.

KishCom avatar May 09 '22 19:05 KishCom

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.

kudlav avatar Jul 07 '22 18:07 kudlav

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

[env:lolin_s2_mini]
platform = [email protected]
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}

blazoncek avatar Sep 15 '22 11:09 blazoncek

@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?

michael-blue2 avatar Oct 05 '22 19:10 michael-blue2

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 avatar Oct 05 '22 19:10 blazoncek

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.

blazoncek avatar Oct 05 '22 19:10 blazoncek

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"

softhack007 avatar Oct 21 '22 15:10 softhack007

@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.

blazoncek avatar Nov 01 '22 13:11 blazoncek

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

Germaine-Sail avatar Nov 07 '22 00:11 Germaine-Sail

It has been since merged into main WLED.

blazoncek avatar Nov 07 '22 05:11 blazoncek

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

michael-blue2 avatar Nov 07 '22 09:11 michael-blue2

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.

blazoncek avatar Nov 07 '22 10:11 blazoncek

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.

tanner0101 avatar Jan 25 '23 03:01 tanner0101

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.

blazoncek avatar Jan 25 '23 10:01 blazoncek

@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.

softhack007 avatar Jan 25 '23 11:01 softhack007

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?

fredolivas avatar May 02 '23 18:05 fredolivas

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.

blazoncek avatar May 02 '23 19:05 blazoncek