New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESPhttpUpdate seems to corrupt WiFiManager after a OTA http update #808
Comments
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 |
You have corrupt flash have to full erase, you probably updated from an older sdk or something. |
See if iy happens again |
It happens every single time. Is not an older SDK, this is how I reproduce the issue every time:
As you can see the BIN I'm using during the serial programming is exactly the same BIN I'm using during the OTA update. Unless there is something wrong with the ESPhttpUpdate library, it almost looks to me that during the OTA flash some parameter store by WiFiManager in flash gets corrupted |
I have not tested ota on master branch, only development, and have not had an issue with it. when you say
Should not be expected, credentials should not be affected from an ota update. Is ota code doing anything with wifi , like disconnect() ? |
only thing I can think of is to decode the exception, and check the stack trace. or eliminate pieces and see what happens, maybe remove wm, and do manual begin() |
I just assume that OTA update clears all the flash memory, if not, you're right, the WiFi credentials should still be there. This just still makes me think that something weird happens after the OTA. Again, the BIN is correct but something is being modified in flash that breaks WiFIManager. One of my theories was a bad board parameter, for example, having a board with 2Mb of flash but setting it as 4Mb could mean that a BIN flashed on it could overwrite data in places of the flash memory used by other things, like the WiFi credentials. But I'm using an ESP12F that are supposed to be 4Mb flash. I need an expert of low-level stack to understand what is missing from the stack trace of my first message. |
yes wrong flash will cause issues like this, maybe the ota method you are using is wrong, or requires a missing argument for flash size? you can just use the espexception decoder ( its a ide pliugin) and post it |
So far I think I'm doing everything correctly
|
do you have serial logs before the exception ? |
curious how far into setupConfigPortal this is failing, it is not clear |
This might be related with esp8266/Arduino#5522 |
Hi, I'm having exactly the same issue. ESP 12F, core version 2.5.0. Also in 4Mb no SPIFFS. After trying an OTA update, trying to setup the ESP as AP would throw Exception(28). I'm no an expert in reading the stack, but just wanted to let you know that I was able to recreate the same issue. I'll look into #5522 for more info. |
This is an aside, but by any chance did you do a firmware update using
serial before testing OTA? There is a known issue that you need to fully
power down the device after a serial firmware update before doing OTA or it
will get into a crash loop like this. Just disconnect everything then
power it up and try again.
…On Wed, Mar 20, 2019 at 8:22 AM Ignacio Moya ***@***.***> wrote:
Hi, I'm having exactly the same issue. ESP 12F, core version 2.5.0. Also
in 4Mb no SPIFFS.
After trying an OTA update, trying to setup the ESP as AP would throw
Exception(28). I'm no an expert in reading the stack, but just wanted to
let you know that I was able to recreate the same issue.
I'll look into #5522 for more info.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#808 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL-O4eS9K4xzE040OK_Z234cSCa19EiFks5vYlIegaJpZM4aD-4m>
.
|
Yes. First I updated the firmware through serial. Then did a reset but with the reset button. I will try fully powering down and then up. And see if the problem persists. |
Ok, I just confirmed fully powering it down and the up has the same results. |
So you unplugged the device from all power, then plugged it back in, waited
for the OTA and it got into a death loop after the update? That's
unfortunate. Cycling power solved my problem. See this thread for more
info: esp8266/Arduino#2478
Maybe you can post your code here.
…On Thu, Mar 21, 2019 at 5:58 AM Ignacio Moya ***@***.***> wrote:
Ok, I just confirmed fully powering it down and the up has the same
results.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#808 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL-O4Zo5hrVC72qJIfsAFPEJIEh5-m51ks5vY4HggaJpZM4aD-4m>
.
|
What exactly should I do to reproduce this? |
Arduino version 1.8.10 I havae a very serious problem and not find any solution for it. this is settings I used in Arduino IDE |
Do you have a log? Are you reseting esp after programming it via usb ( in case you are testing, you must reset for ota after serial upload ) |
You need to unplug power after programming via USB/Serial and before doing
OTA.
…On Tue, Sep 17, 2019 at 12:11 PM Shawn A ***@***.***> wrote:
Do you have a log? Are you reseting esp after programming it via usb ( in
case you are testing, you must reset for ota after serial upload )
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#808?email_source=notifications&email_token=AC7Y5YIPNFPCPKTXFSRM4LDQKETV3A5CNFSM4GQP5YTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD65S3KI#issuecomment-532360617>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC7Y5YM3WCZBQUV2V3UIVM3QKETV3ANCNFSM4GQP5YTA>
.
|
you can check the log after sending 108 messages each 10 seconds to firebase cloud messaging then wdt rest. |
I can not find solution all times wdt reset |
What does this have to do with ota ? You are having WDT resets in your code.. |
after ota update the code wdt reset |
So you can reboot and it will run fine, do an ota, it resets, runs for a bit then wdts? |
same issue here. this is decoded exception Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
Decoding 29 results
0x40236031: netif_set_down at /home/gauchard/dev/esp8266/esp8266/tools/sdk/lwip2/builder/glue-esp/lwip-esp.c line 616
0x402477b0: node_remove_from_list at ?? line ?
0x40236054: netif_remove at /home/gauchard/dev/esp8266/esp8266/tools/sdk/lwip2/builder/glue-esp/lwip-esp.c line 537
0x40239bde: wifi_get_opmode at ?? line ?
0x402381d2: eagle_lwip_if_free at ?? line ?
0x4023ad7a: wifi_station_disconnect at ?? line ?
0x40203abc: ESP8266WiFiSTAClass::disconnect(bool) at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.cpp line 373
0x402189c8: tcpip_tcp_timer at /home/gauchard/dev/esp8266/esp8266/tools/sdk/lwip2/builder/lwip2-src/src/core/timeouts.c line 145
0x4021fe80: mem_malloc at /home/gauchard/dev/esp8266/esp8266/tools/sdk/lwip2/builder/lwip2-src/src/core/mem.c line 210
0x40218928: lwip_cyclic_timer at /home/gauchard/dev/esp8266/esp8266/tools/sdk/lwip2/builder/lwip2-src/src/core/timeouts.c line 233
0x401001fc: millis at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/core_esp8266_wiring.cpp line 186
0x4020b21a: String::reserve(unsigned int) at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/WString.cpp line 148
0x4020b36c: String::move(String&) at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/WString.cpp line 230
0x4020107f: std::_Function_handler ::_M_invoke(std::_Any_data const&, WiFiEventStationModeDisconnected const&) at c:\users\marcoletteri\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2/functional line 2073
0x402034e8: std::_Function_handler )::{lambda(_esp_event*)#1}>::_M_invoke(std::_Any_data const&, _esp_event*) at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src/ESP8266WiFiType.h line 112
: (inlined by) operator() at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.cpp line 122
: (inlined by) _M_invoke at c:\users\marcoletteri\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2/functional line 2071
0x40100aca: ppEnqueueRxq at ?? line ?
0x40204cf5: WiFiClient::stopAll() at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src/WiFiClient.cpp line 386 (discriminator 2)
0x4020371b: ESP8266WiFiGenericClass::_eventCallback(void*) at c:\users\marcoletteri\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits/stl_list.h line 157
: (inlined by) ESP8266WiFiGenericClass::_eventCallback(void*) at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.cpp line 234
0x401008d2: ppProcessTxQ at ?? line ?
0x4023c2e4: wifi_set_status_led_output_level at ?? line ?
0x40104438: call_user_start_local at ?? line ?
0x4010443e: call_user_start_local at ?? line ?
0x4010000d: call_user_start at ?? line ?
0x40100600: cont_ret at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/cont.S line 142
0x401005ad: cont_continue at C:\Users\MarcoLetteri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/cont.S line 51 |
Erase flash |
What esp versions are you all using ? |
@tablatronix as you can see in logs 2.5.2 |
Ok, are you using arduino ota, or http update ? |
ESPhttpUpdate |
Just tested using ota branch (dev + ota form) Works fine, it uses form upload ota. Could be a bug in master branch, are you using 0.15 beta? |
Got min sketch code ? |
Your code is causing a
It sure does look like that is a out of bounds memory access in lwip |
Do you have any event callbacks ? |
yes, no one is called, it starts doing update and then rise the exception
|
Ok so maybe it has something to do with wificlient , ill try a ota fetch. |
Make sure you are trying the 0.15 beta there was a loss of creds bug fixed I think |
this happens also without WiFiManager opened issue on esp8266/Arduino#6555 |
Basic Infos
Hardware
WiFimanager Branch/Release:
Esp8266/Esp32:
Hardware: ESP-12e, esp01, esp25
ESP Core Version: 2.4.0, staging
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:
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:
Im using a ESP12F, 4Mb no SPFSS.
Somebody had what it seems a similar issue #236 but is not very clear.
The text was updated successfully, but these errors were encountered: