You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OTA Updating ESP32-S2 from 0.15.0-b4 fails - if Tasmota Web installer was used #4241
I have 2 instances of wled running on a ESP32-S2 that updated fine up to 0.15.0-b4.
Updated them through Home Assistant actually, everything rosy.
The problem is that they can't be updated to any version after that through OTA, as both the web interface and HA fail.
I have a third wled running on a 8266 and it updated fine manually and through HA just now to 0.15.0-b7 actually.
Any ideas?
Is plugging 'em in and reflashing my only choice?
Thanks in advance <3
To Reproduce Bug
Upload binary, WLED_0.15.0-b7_ESP32-S2.bin in my case and press the update button.
Alternatively through the update dialog in HA.
Expected Behavior
The web interface times out.
HA fails with this message: Failed to perform the action update/install. Error communicating with WLED API
Install Method
Binary from WLED.me
What version of WLED?
0.15.0-b4
Which microcontroller/board are you seeing the problem on?
I just uploaded the 0.15.0-b7 OTA to an S2, works fine.
can you backup your config, your presets, then do a factory reset and try to OTA again through web UI?
So when you did the factory reset test: did you also try to OTA directly in AP mode before bringing it back into your wifi?
Didn't even think about trying it tbh.
Just did it though, same result.
S2, if used with MQTT or other functions may be low on free heap. This may prevent OTA.
No MQTT, just web interface and HA.
This gave me an idea though, deleted the HA integration (I figured it might use resources since it polls) and set my led length to one.
The free heap did gain a few kilobytes, but, of course, the update timed out once again.
(also I just remembered that the best case of this scenario was when I tried it right after the reset. Meh.)
I've got a few of those boards and I can replicate this issue. The root problem is heap exhaustion -- it appears to be that something in the wifi stack permanently locks up if it ever runs out of dma-capable heap, which overlaps partially with the regular heap used for other purposes. Unfortunately the S2s don't have much more available SRAM than the old 8266es, but a lot of the code shared with other ESP32s does larger allocations by default...
I've tried a few things here, manual curl commands, rate limiting, etc. to try to keep the dynamic heap usage down, but for me the OTA upload always stalls at about 60-80k uploaded. I'll take more of a look tomorrow. Unfortunately I don't think the situation will improve with -b7.
@janchrillesen As expected and explained earlier. Tasmota uses a different partition scheme. It is not possible to OTA from actual Tasmota to any other firmware which is not using safeboot
As long WLED is using the original NabuCasa WebInstaller, flashing S2 with CDC port will not work. Known issue of the used espressif esptool.js espressif/esptool-js#38
@janchrillesen can you explain where did you get bootloader and partition map from? Was it my Dropbox or did you get them elsewhere (PIO, etc)? You are missing app0 binary, though.
@blazoncek It does work without app0 binary as long the main firmware is at address 0x10000 That's a fails safe fall back mechanism. But yes it is incorrect to do without!
Imho it would be a good idea to release additional factory images (for initial flash) which includes everything needed to avoid issues like this at all.
@janchrillesen can you explain where did you get bootloader and partition map from? Was it my Dropbox or did you get them elsewhere (PIO, etc)? You are missing app0 binary, though.
Imho it would be a good idea to release additional factory images (for initial flash) which includes everything needed to avoid issues like this at all.
@softhack007@netmindz@willmmiles@lost-hope hope this may be best approach if you want to avoid future problems when flashing various versions. Unfortunately that would mean separate binary for every possible combination of flash/PSRAM configurations as well as WLED options. The other option is to prepare "bootloader" image(s) for those as the firmware may end being the same. By "bootloader" I am thinking about combined image of proper bootloader, partiton map and app0 images.
I think @Aircoookie prepared such image for classic ESP32 long time ago (and many may still be flashing that today).
@blazoncek Looking in release section of WLED. There are not many variants. Building the factory images can be fully integrated in Platformio build process. So when building a variant the factory image is generated too. See as example the Platformio script post_esp32.py from EspEasy or Tasmota
AFAIK S3 needs 3 different binaries: plain (no PSRAM), QSPI PSRAM and OPI PSRAM. ESP32 needs 2 binaries: 1 for rev.3 or newer (autodetect and use PSRAM if present), 1 for rev.1 for units with PSRAM. Others need one binary (compat and 160MHz versions are experimental).
We are not talking about different features within WLED which may require separate binary.
I am not PIO expert nor know how build process work. I only know what my own limited experience showed me. I hope someone more proficient will be able to streamline build process and release generation.
Yes, and only providing the firmware does not change anything of this. A S3 firmware build for QIO Flash and PSRAM will only work for this setup. Providing or not providing the matching "helper" files do not change that. Not ment offending the release section here in github is just incomplete and irritating
Edit: Not using the exact matching bootloader (Flash type / speed) can end in write errors. This looks like happens "out of nowhere" and first noticed with Filesystem
I also installed using the Tasmota webflasher and then did an OTA update to WLED. Just flashed one of my S2's with beta6 using esptool and then OTA upgrading to beta 7. This works, so I can confirm that starting with tasmota seems like the root cause. For those wanting to flash the S2 using esptool I did it like this:
changed the title [-]OTA Updating ESP32-S2 from 0.15.0-b4 fails [/-][+]OTA Updating ESP32-S2 from 0.15.0-b4 fails - if Tasmota Web installer was used[/+]on Nov 27, 2024
SOLVED: (adding this comment since not obvious from the comment above)
Please note that it is now possible to do a first-flash of the S2 Mini board by following these steps for the "first flash", the use OTA for subsequent updates. You can also update boards first installed with Tasmota this way (thanks to @janchrillesen):
Activity
[-]Update from 0.15.0-b4 fails [/-][+]OTA Updating ESP32-S2 from 0.15.0-b4 fails [/+]DedeHai commentedon Nov 1, 2024
I just uploaded the 0.15.0-b7 OTA to an S2, works fine.
can you backup your config, your presets, then do a factory reset and try to OTA again through web UI?
espilioto commentedon Nov 1, 2024
Hey, thanks for the reply.
Nope, the reset happened but still can't OTA update.
edit: tried from both firefox and chrome, just to be sure.
edit 2: also tried 0.14.4, nothing.
DedeHai commentedon Nov 2, 2024
Did you try a fresh 0.14 install and then update it to 0.15 B7?
blazoncek commentedon Nov 2, 2024
S2, if used with MQTT or other functions may be low on free heap. This may prevent OTA.
espilioto commentedon Nov 2, 2024
Tried downgrading to 0.14.4 via OTA but nothing. Obviously I'm trying to avoid manual flashing.
Hmm, can I do something about that? Maybe disable something in the settings?
DedeHai commentedon Nov 2, 2024
So when you did the factory reset test: did you also try to OTA directly in AP mode before bringing it back into your wifi?
espilioto commentedon Nov 2, 2024
Didn't even think about trying it tbh.
Just did it though, same result.
No MQTT, just web interface and HA.
This gave me an idea though, deleted the HA integration (I figured it might use resources since it polls) and set my led length to one.
The free heap did gain a few kilobytes, but, of course, the update timed out once again.
(also I just remembered that the best case of this scenario was when I tried it right after the reset. Meh.)
blazoncek commentedon Nov 2, 2024
Which board are you using? Lolin S2?
espilioto commentedon Nov 2, 2024
ESP32 WEMOS S2 mini V1.0

blazoncek commentedon Nov 2, 2024
That's Lolin all right. Have a few of them runnig on the edge of usable heap.
May require restart and immediate OTA. Show your Info screen.
espilioto commentedon Nov 2, 2024
willmmiles commentedon Nov 3, 2024
I've got a few of those boards and I can replicate this issue. The root problem is heap exhaustion -- it appears to be that something in the wifi stack permanently locks up if it ever runs out of dma-capable heap, which overlaps partially with the regular heap used for other purposes. Unfortunately the S2s don't have much more available SRAM than the old 8266es, but a lot of the code shared with other ESP32s does larger allocations by default...
I've tried a few things here, manual curl commands, rate limiting, etc. to try to keep the dynamic heap usage down, but for me the OTA upload always stalls at about 60-80k uploaded. I'll take more of a look tomorrow. Unfortunately I don't think the situation will improve with -b7.
29 remaining items
Jason2866 commentedon Nov 25, 2024
@janchrillesen As expected and explained earlier. Tasmota uses a different partition scheme. It is not possible to OTA from actual Tasmota to any other firmware which is not using safeboot
As long WLED is using the original NabuCasa WebInstaller, flashing S2 with CDC port will not work. Known issue of the used espressif esptool.js
espressif/esptool-js#38
blazoncek commentedon Nov 25, 2024
@janchrillesen can you explain where did you get bootloader and partition map from? Was it my Dropbox or did you get them elsewhere (PIO, etc)? You are missing app0 binary, though.
Jason2866 commentedon Nov 25, 2024
@blazoncek It does work without app0 binary as long the main firmware is at address 0x10000 That's a fails safe fall back mechanism. But yes it is incorrect to do without!
Imho it would be a good idea to release additional factory images (for initial flash) which includes everything needed to avoid issues like this at all.
janchrillesen commentedon Nov 25, 2024
Yes, I got it from https://github.com/Aircoookie/WLED/releases - go to the "WLED Beta Release 0.15.0-b2" release, under assets. I was not even aware there was an app0 file as well. Maybe you need to build from scratch with PIO to get it
blazoncek commentedon Nov 25, 2024
@softhack007 @netmindz @willmmiles @lost-hope hope this may be best approach if you want to avoid future problems when flashing various versions. Unfortunately that would mean separate binary for every possible combination of flash/PSRAM configurations as well as WLED options. The other option is to prepare "bootloader" image(s) for those as the firmware may end being the same. By "bootloader" I am thinking about combined image of proper bootloader, partiton map and app0 images.
I think @Aircoookie prepared such image for classic ESP32 long time ago (and many may still be flashing that today).
Jason2866 commentedon Nov 25, 2024
@blazoncek Looking in release section of WLED. There are not many variants. Building the factory images can be fully integrated in Platformio build process. So when building a variant the factory image is generated too. See as example the Platformio script
post_esp32.pyfrom EspEasy or Tasmotablazoncek commentedon Nov 25, 2024
AFAIK S3 needs 3 different binaries: plain (no PSRAM), QSPI PSRAM and OPI PSRAM. ESP32 needs 2 binaries: 1 for rev.3 or newer (autodetect and use PSRAM if present), 1 for rev.1 for units with PSRAM. Others need one binary (compat and 160MHz versions are experimental).
We are not talking about different features within WLED which may require separate binary.
I am not PIO expert nor know how build process work. I only know what my own limited experience showed me. I hope someone more proficient will be able to streamline build process and release generation.
Jason2866 commentedon Nov 25, 2024
Yes, and only providing the firmware does not change anything of this. A S3 firmware build for QIO Flash and PSRAM will only work for this setup. Providing or not providing the matching "helper" files do not change that. Not ment offending the release section here in github is just incomplete and irritating
Edit: Not using the exact matching bootloader (Flash type / speed) can end in write errors. This looks like happens "out of nowhere" and first noticed with Filesystem
kamkilt commentedon Nov 27, 2024
I used this approach and after flashing by USB, OTA is working correctly!
Thx
[-]OTA Updating ESP32-S2 from 0.15.0-b4 fails [/-][+]OTA Updating ESP32-S2 from 0.15.0-b4 fails - if Tasmota Web installer was used[/+]wga22 commentedon Dec 10, 2024
SOLVED: (adding this comment since not obvious from the comment above)
Please note that it is now possible to do a first-flash of the S2 Mini board by following these steps for the "first flash", the use OTA for subsequent updates. You can also update boards first installed with Tasmota this way (thanks to @janchrillesen):
REF: #4241 / #3706