mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #808] ESPhttpUpdate seems to corrupt WiFiManager after a OTA http update #678
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#678
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @domingosl on GitHub (Jan 16, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/808
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 https://github.com/tzapu/WiFiManager/issues/236 but is not very clear.
@domingosl commented on GitHub (Jan 16, 2019):
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
@tablatronix commented on GitHub (Jan 16, 2019):
You have corrupt flash have to full erase, you probably updated from an older sdk or something.
@tablatronix commented on GitHub (Jan 16, 2019):
See if iy happens again
@domingosl commented on GitHub (Jan 17, 2019):
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
@tablatronix commented on GitHub (Jan 17, 2019):
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() ?
@tablatronix commented on GitHub (Jan 17, 2019):
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()
@domingosl commented on GitHub (Jan 17, 2019):
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.
@tablatronix commented on GitHub (Jan 17, 2019):
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
@domingosl commented on GitHub (Jan 17, 2019):
So far I think I'm doing everything correctly
@tablatronix commented on GitHub (Jan 17, 2019):
do you have serial logs before the exception ?
@tablatronix commented on GitHub (Jan 17, 2019):
curious how far into setupConfigPortal this is failing, it is not clear
@domingosl commented on GitHub (Jan 19, 2019):
This might be related with https://github.com/esp8266/Arduino/pull/5522
@mignacio commented on GitHub (Mar 20, 2019):
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.
@Daemach commented on GitHub (Mar 20, 2019):
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 notifications@github.com
wrote:
@mignacio commented on GitHub (Mar 20, 2019):
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.
@mignacio commented on GitHub (Mar 21, 2019):
Ok, I just confirmed fully powering it down and the up has the same results.
@Daemach commented on GitHub (Mar 21, 2019):
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: https://github.com/esp8266/Arduino/issues/2478
Maybe you can post your code here.
On Thu, Mar 21, 2019 at 5:58 AM Ignacio Moya notifications@github.com
wrote:
@tablatronix commented on GitHub (Mar 21, 2019):
What exactly should I do to reproduce this?
@smarta1980 commented on GitHub (Sep 17, 2019):
Arduino version 1.8.10
ESP Board version 2.5.2
I havae a very serious problem and not find any solution for it.
I upload bin file to update ESP-12E from server using OTA
then all times I have issue for wdt reset.
on the other hand, I tried to program same code via usb no have any problem so the problem just with OTA wdt reset all times
could you please guide me what to do?
this is settings I used in Arduino IDE
@tablatronix commented on GitHub (Sep 17, 2019):
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 )
@Daemach commented on GitHub (Sep 17, 2019):
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 notifications@github.com wrote:
@smarta1980 commented on GitHub (Sep 17, 2019):
you can check the log after sending 108 messages each 10 seconds to firebase cloud messaging then wdt rest.
Log.txt
@smarta1980 commented on GitHub (Sep 17, 2019):
The steps that I do as following :
1- program OTA sketch via usb.
2- then after upload it I disconnect usb port to esp board
3- connect usb again to esp board
4- wait until OTA update
@smarta1980 commented on GitHub (Sep 17, 2019):
I can not find solution all times wdt reset
@tablatronix commented on GitHub (Sep 18, 2019):
What does this have to do with ota ? You are having WDT resets in your code..
@smarta1980 commented on GitHub (Sep 18, 2019):
after ota update the code wdt reset
if use same code without ota it is working without any problem.
@tablatronix commented on GitHub (Sep 18, 2019):
So you can reboot and it will run fine, do an ota, it resets, runs for a bit then wdts?
@marcolettieri commented on GitHub (Sep 25, 2019):
same issue here.
Firmware works perfectly, when ota is launched, after some seconds i receive exception stack and after reboot the esp8266 'forget' all Wifi credentials.
this is decoded exception
@tablatronix commented on GitHub (Sep 25, 2019):
Erase flash
@tablatronix commented on GitHub (Sep 25, 2019):
What esp versions are you all using ?
@marcolettieri commented on GitHub (Sep 25, 2019):
@tablatronix as you can see in logs 2.5.2
Flash has been erase already
@tablatronix commented on GitHub (Sep 25, 2019):
Ok, are you using arduino ota, or http update ?
Can I reproduce this by just adding ota to one of the basic WM examples?
@marcolettieri commented on GitHub (Sep 25, 2019):
ESPhttpUpdate
@tablatronix commented on GitHub (Sep 25, 2019):
Just tested using ota branch (dev + ota form)
https://github.com/tzapu/WiFiManager/blob/ota/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino
Works fine, it uses form upload ota.
Could be a bug in master branch, are you using 0.15 beta?
@tablatronix commented on GitHub (Sep 25, 2019):
Got min sketch code ?
@tablatronix commented on GitHub (Sep 25, 2019):
Your code is causing a
disconnect(), Not sure what you are calling, but that is where your creds go, bye buyeIt sure does look like that is a out of bounds memory access in lwip
@tablatronix commented on GitHub (Sep 25, 2019):
Do you have any event callbacks ?
@marcolettieri commented on GitHub (Sep 26, 2019):
yes, no one is called, it starts doing update and then rise the exception
@tablatronix commented on GitHub (Sep 26, 2019):
Ok so maybe it has something to do with wificlient , ill try a ota fetch.
Wonder if it has sonething to do with wm not stopping webserver and dns after using it
@tablatronix commented on GitHub (Sep 26, 2019):
Make sure you are trying the 0.15 beta there was a loss of creds bug fixed I think
@marcolettieri commented on GitHub (Sep 26, 2019):
this happens also without WiFiManager opened issue on https://github.com/esp8266/Arduino/issues/6555