WiFiManager: ESPhttpUpdate seems to corrupt WiFiManager after a OTA http update

Basic Infos

Hardware

WiFimanager Branch/Release:

  • Master
  • Development

Esp8266/Esp32:

  • ESP8266
  • ESP32

Hardware: ESP-12e, esp01, esp25

  • ESP01
  • ESP12 E/F/S (nodemcu, wemos, feather)
  • Other

ESP Core Version: 2.4.0, staging

  • 2.3.0
  • 2.4.0
  • staging (master/dev)

Description

I recently added OTA updates using HTTP to a program I’ve been testing for the past month with no issues. Something strange happens tho after an OTA update, the BIN downloads and install correctly, the ESP restarts, the WiFi credentials are wiped so the ESP goes into configuration mode, but as soon it gets there it reboots constantly with this error stack:

Exception (28): epc1=0x40240429 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000038 depc=0x00000000

stack>>>

ctx: cont sp: 3fff0270 end: 3fff0630 offset: 01a0 3fff0410: 3fff0b34 3fff1914 3fff1914 4022cc8b
3fff0420: 4024403d 00000002 3ffee618 00000000
3fff0430: 40244055 00000002 00000002 00000002
3fff0440: 402441b9 00000002 00000002 4024416d
3fff0450: 40243fee 00000001 00000000 3fff0b34
3fff0460: 40244292 00000002 00000002 00000001
3fff0470: 40204027 402044cc 3ffeeee4 3fff04f0
3fff0480: 40215618 3ffeeee4 3fff0540 3ffe86c2
3fff0490: 00000000 3ffeeee4 3fff0540 40209c62
3fff04a0: 3ffef1e8 000001a3 000001a3 401009e8
3fff04b0: 00000000 3ffeeee4 3fff04fc 40100e2c
3fff04c0: 00000000 3ffeeee4 3fff04f0 4020fbd0
3fff04d0: 3ffe8778 00000000 3fff0540 3ffe86c2
3fff04e0: 00000000 3ffeeee4 3fff0540 40209e6d
3fff04f0: 00000000 00000000 00000000 00000000
3fff0500: 00000000 00000000 00000028 40100c38
3fff0510: 00000001 3ffe8778 3fff0540 40208350
3fff0520: 00000001 00000000 3ffeef80 00000001
3fff0530: 3ffeed00 3ffeee00 3ffeef80 40202cbd
3fff0540: 00000000 00000000 3ffe8c24 00000000
3fff0550: 3fff1414 0000000f 00000000 3fff142c
3fff0560: 0000000f 00000000 00000000 00000000
3fff0570: 00000000 40215eb0 00000000 40215eb0
3fff0580: 00000000 40215eb0 00000000 40215eb0
3fff0590: 00000000 40215eb0 00000000 40215eb0
3fff05a0: 00000000 00000000 ffffffff fe000001
3fff05b0: 3ffe8778 00000000 fe00ef35 40202e3c
3fff05c0: 00000000 0000000a 3fff1444 feefeffe
3fff05d0: feefeffe feefeffe feefeffe feefeffe
3fff05e0: feefeffe feefeffe feefeffe feefeffe
3fff05f0: 0000000a feefeffe feefeffe feefeffe
3fff0600: feefeffe feefeffe feefeffe 3ffef098
3fff0610: 3fffdad0 00000000 3ffef064 402109f4
3fff0620: feefeffe feefeffe 3ffe863c 40100e89
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(3,7)

What its weird to me is that the downloaded BIN and the running BIN are exactly the same, so when the installed one runs it does not crash, ever, but when you download the copy from my http local server and install it something in memory gets corrupted that affects WiFiManager.

Does anyone experience something similar? If not, I’m not very good at debugging using the stack, maybe you can point me in the right direction.

BTW, the code I’m using to update my program is the basic one:

 t_httpUpdate_return ret = ESPhttpUpdate.update("192.168.1.53", 80, "/", firmwareVersion);
  
  switch(ret) {
      case HTTP_UPDATE_FAILED:
          Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
          break;
      case HTTP_UPDATE_NO_UPDATES:
          Serial.println("[update] Update no Update.");
          break;
      case HTTP_UPDATE_OK:
          Serial.println("[update] Update ok.");
          break;
  }

Im using a ESP12F, 4Mb no SPFSS.

Somebody had what it seems a similar issue https://github.com/tzapu/WiFiManager/issues/236 but is not very clear.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 41

Most upvoted comments

this happens also without WiFiManager opened issue on https://github.com/esp8266/Arduino/issues/6555

Quick follow up, after the OTA update, the crash is so bad that reflashing the chip just maintains the corrupted stuff and keeps crashing. I have to change the “Erase flash” option in the Arduino IDE from “Only Sckect” to ALL FLASH CONTENTS so it clears everything