-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP restart by itself after 1-2h | ip != 0 wrong@glue-esp/lwip-esp.c:757 #4596
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
Comments
@TakiKroSmaN without a MCVE sketch it is unlikely this will be looked at. This was required as art of the issue template. Can you provide it? |
@devyte Sure please find below part of the sketch. I removed SSID, password, and keys for api so adresses in HTTP functions are not correct :) sorry for language mix below :)
|
These |
I have the exact same issue here. Problem is that in 2.4.1 there is an issue when configuring a static IP: ip != 0 wrong@glue-esp/lwip-esp.c:757 This needs to be fixed, should be a problem for many users !? |
Can you please try this, assuming you are using git:
and check again for this issue ? |
I tried that lwip2 update. The ESP crashes depending on the order of WiFi.config() and WiFi.mode(), see below. With this code the ESP crashes:
the ESP crashes after first boot, outputs some garbage, and after restarting itself, it seems to run the sketch:
interestingly, when I exchange the wifi.mode and wifi.config commands to the following order:
the ESP runs ok without crashing. However still sending DHCP requests. |
First set the STA mode. After this set the config and then begin(). It's the standard order. Fixed IP need less time than DHCP, for DHCP you need insert this lines for wait connection result just after begin (with fixed IP it is also advisable) : In your sketch, with your order you are configuring STA + SoftAP (see debug message), and after this you are destroying it with mode(WIFI_STA) Regards |
@Markusenz |
Thank you! When removing the delay, DHCP seems completely turned off now, I do not see any requests now. With the right order of WiFi.. commands, all is working now. However, I could reproduce the crash of the above mentioned sketch (doing WiFi.config() first) on another Arduino installation, also with 2.4.1 core, however this one still uses the original lwip2 version from the 2.4.1 installation.
I don't know if this issue is relevant since the order of Wifi commands seems to be unusual, but its not documented anywhere I think. When inserting the check of WiFi.status() as @lrmoreno007 mentioned, I get a stack trace with the crash:
|
Would you be able to try this other sketch/installation with the current git version of the core (and with the lwip2 update from above) ? |
First of all, are you using a static IP in the DCHP range of your router? In the other hand, surely you are using "Erase Flash : All Flash Content", then this is what occurs:
After WDT reset, ESP start as STA and everything work fine, at least for me. It happens more or less the same with the order that I told you (as we can see in your feedback), but it's the correct order. You can check all this by inserting
|
Thanks @lrmoreno007, now I understand whats going on with DHCP. No, the static IP is not taken from the DHCP server's range. I could reproduce the crash on another machine with latest versions, however as mentioned the crash only happens when issuing WiFi.config() before WiFi.mode() so it can be avoided.
|
Fix is released in core-2.4.2 |
Platform
Settings in IDE
Problem Description
after one or two hours of working without any problem ESP restart by himself. I cannot decode stack I don't know why but decoder is doesn't work on my PC:
Debug Messages
I turn on debug and I get this stack:
ip != 0 wrong@glue-esp/lwip-esp.c:757
Fatal exception 29(StoreProhibitedCause):
epc1=0x40219250, epc2=0x00000000, epc3=0x400004e3, excvaddr=0x00000000, depc=0x00000000
Exception (29):
epc1=0x40219250 epc2=0x00000000 epc3=0x400004e3 excvaddr=0x00000000 depc=0x00000000
ctx: sys
sp: 3ffffc70 end: 3fffffb0 offset: 01a0
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
~ld
⸮H⸮SDK:2.2.1(cfd48f3)/Core:2.4.1/lwIP:2.0.3(STABLE-2_0_3_RELEASE/glue:arduino-2.4.1)
STUB: dhcp_stop
I have found this line in core 2.4.1 ip != 0 wrong@glue-esp/lwip-esp.c:757 but I don't know for what is it.
for moment I go back to core 2.4.0 and testing the same program once again.
Edit:
I think I have found. after 2h my router change the IP adress for ESP
I get debug message with core 2.4.0:
ip:0.0.0.0,mask:255.255.255.0,gw:192.168.0.1
wifi evt: 3
ip:192.168.0.106,mask:255.255.255.0,gw:192.168.0.1
wifi evt: 3
The text was updated successfully, but these errors were encountered: