Skip to content

OTA Updating ESP32-S2 from 0.15.0-b4 fails - if Tasmota Web installer was used #4241

Closed as not planned

Description

@espilioto

What happened?

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?

ESP32-S2

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. changed the title [-]Update from 0.15.0-b4 fails [/-] [+]OTA Updating ESP32-S2 from 0.15.0-b4 fails [/+] on Nov 1, 2024
  2. DedeHai commented on Nov 1, 2024

    @DedeHai
    Collaborator

    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?

  3. added
    cannot reproduce
    on Nov 1, 2024
  4. espilioto commented on Nov 1, 2024

    @espilioto
    Author

    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.

  5. DedeHai commented on Nov 2, 2024

    @DedeHai
    Collaborator

    Did you try a fresh 0.14 install and then update it to 0.15 B7?

  6. blazoncek commented on Nov 2, 2024

    @blazoncek
    Contributor

    S2, if used with MQTT or other functions may be low on free heap. This may prevent OTA.

  7. espilioto commented on Nov 2, 2024

    @espilioto
    Author

    Did you try a fresh 0.14 install and then update it to 0.15 B7?

    Tried downgrading to 0.14.4 via OTA but nothing. Obviously I'm trying to avoid manual flashing.

    S2, if used with MQTT or other functions may be low on free heap. This may prevent OTA.

    Hmm, can I do something about that? Maybe disable something in the settings?

  8. DedeHai commented on Nov 2, 2024

    @DedeHai
    Collaborator

    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?

  9. espilioto commented on Nov 2, 2024

    @espilioto
    Author

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

  10. blazoncek commented on Nov 2, 2024

    @blazoncek
    Contributor

    Which board are you using? Lolin S2?

  11. espilioto commented on Nov 2, 2024

    @espilioto
    Author

    ESP32 WEMOS S2 mini V1.0
    IMG_20241102_202545

  12. blazoncek commented on Nov 2, 2024

    @blazoncek
    Contributor

    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.

  13. espilioto commented on Nov 2, 2024

    @espilioto
    Author

    image

  14. willmmiles commented on Nov 3, 2024

    @willmmiles
    Member

    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.

  15. 29 remaining items

  16. Jason2866 commented on Nov 25, 2024

    @Jason2866
    Contributor

    @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

  17. blazoncek commented on Nov 25, 2024

    @blazoncek
    Contributor

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

  18. Jason2866 commented on Nov 25, 2024

    @Jason2866
    Contributor

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

  19. janchrillesen commented on Nov 25, 2024

    @janchrillesen

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

    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

  20. blazoncek commented on Nov 25, 2024

    @blazoncek
    Contributor

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

  21. Jason2866 commented on Nov 25, 2024

    @Jason2866
    Contributor

    @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

  22. blazoncek commented on Nov 25, 2024

    @blazoncek
    Contributor

    There are not many variants.

    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.

  23. Jason2866 commented on Nov 25, 2024

    @Jason2866
    Contributor

    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

  24. added
    external
    and removed on Nov 26, 2024
  25. kamkilt commented on Nov 27, 2024

    @kamkilt

    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:

    esptool.py erase_flash esptool.py write_flash 0x01000 S2_bootloader.bin esptool.py write_flash 0x08000 S2_partitions_4M.bin esptool.py write_flash 0x10000 WLED_0.15.0-b6_ESP32-S2.bin

    I used this approach and after flashing by USB, OTA is working correctly!
    Thx

  26. 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
  27. wga22 commented on Dec 10, 2024

    @wga22

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

    1. esptool.py erase_flash
    2. esptool.py write_flash 0x01000 S2_bootloader.bin
    3. esptool.py write_flash 0x08000 S2_partitions_4M.bin
    4. esptool.py write_flash 0x10000 WLED_0.15.0-b6_ESP32-S2.bin

    REF: #4241 / #3706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedexternalwontfix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions