-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
ESP32 crash when can't connect to WIFI #3079
Comments
I also see mega-20200426 on D1 mini rebooting sometimes, when wifi is not available. |
I know there is a version of the ESP32 that looks very similar to the Wemos D1 mini, but then with 2 rows on each side. About the logs in the topic start.
This I find quite strange. Why should it switch on AP+STA mode every 100 msec? |
Yes. this is what I see very rapid connect failure then exception. |
you mean 2 soldering pad rows each side? no, only one each side. |
That's an ESP8266 module. Which doesn't mean by the way, it can't be related. |
@fmuntean do you have error log? |
I can reproduce the issue by removing the WiFi Antenna on a Wroover board. |
Is that the only way to reproduce it? See also this issue: esp8266/Arduino#6471 |
Nope. It does the same when not finding the SSID for some reason or not being able to connect to it. I said the easiest way to reproduce is to remove the antenna. |
thanks @uzi18:
|
@uzi18: let me know if you need something else from me. |
@fmuntean Have used without any additional capacitor with usb connection from computer. |
On the ESP8266, the WiFi settings needed to be set "non persistent". So maybe something similar is also happening here? The system keeps firing "disconnect" events and our sketch reacts to that. |
@TD-er : where we can check that the settings are "non persistent" ? |
Well I thought wel set it to non persistent.
See the ESPEasyWiFi_ProcessEvent.ino file. |
Any update on this issue ? What i found so far is that if I send the wifiapmode command, from serial connection, it works with no issues until the ap mode gets disabled. |
I've changed a lot on the WiFi code, including some parts about the frequent wifi mode changing. |
here are the logs:
|
Before was failing after 4 attempts now it fails after two attempts only. So from this point of view is worse than before. |
What build is this? |
this is a build with only the plugins I use enabled. |
just got the lastest from mega branch and uploaded to my board.
|
Do you use syslog? |
yes. |
also the latest build seems to be even more unstable. It does reboot even when I start wifiapmode and connect to the page |
Try to disable syslog and see if stability improves. |
just did that and is working. |
Yep |
but the code should not send if not connected as there is a call to NetworkConneted() |
Yep, but then you assume the status of the core lib is correct... which isn't always the case :( |
Is there anything we can do about ? |
If there is, please let me know. |
So it looks that sending any syslog/udp message before the wifi connects will trigger this overflow and reboot. |
The way I see it is that two statuses ( WL_NO_SSID_AVAIL = 1,WL_SCAN_COMPLETED = 2)arriving at the wrong time could result in (WL_CONNECTED = 3): The ClearBits and SetBits are two atomic operations by themselves but in between we can have the following: Thread1=>ClearBits(..) Resulting in the status = b11 aka 3 aka WL_CONNECTED |
After some more investigation I think the NetworkConnected() inside the syslog(..) method is too heavy. |
Yep and that's where I'm working on. |
I just changed it to WiFi.isconnected() for testing purposes and the board is stable now |
Problem is with ESP8226, where the return value of that function is not reliable. |
do we know if it is reliable for ESP32 ? |
Found your ticket for ESP8266 wifi status issue: esp8266/Arduino#7432 (so it seems that one is in the low level SDK driver) |
I know for sure it is not reliable on ESP8266 and I hope it is more reliable now on ESP32 since my recent changes of the past 2 months. I for sure want to have it in a more generic function, so we have a single function both supporting WiFi and ethernet. |
The problem with the NetworkConnected() is that it not only check the connection but tries to set AP mode and reset wifi thus triggering other addToLog() thus calling back the syslog and here we go in circles. Or we can hope they fix the isConnected() for ESP32. |
This has been fixed a while ago, as far as I know. |
INIT : Booting version: MFD-mega-2020_05_15 (ESP32 SDK v3.2.3-14-gd3e562907)
45 : Info : INIT : Free RAM:291676
46 : Info : INIT : Cold Boot - Restart Reason: CPU0: Software reset CPU CPU1: Software reset CPU
47 : Info : FS : Mounting...
79 : Info : CRC : No program memory checksum found. Check output of crc2.py
90 : Info : CRC : SecuritySettings CRC ...OK
161 : Info : INIT : Free RAM:285984
164 : Info : INIT : I2C
165 : Info : INIT : SPI not enabled
175 : Info : INFO : Plugins: 16 [Normal] (ESP32 SDK v3.2.3-14-gd3e562907)
177 : Info : EVENT: System#Wake
285 : Info : WIFI : Set WiFi to STA
472 : Info : WIFI : Start network scan
473 : Info : WIFI : Connecting Howard attempt #0
476 : Info : WIFI : WiFi.status() = WL_DISCONNECTED SSID: Howard
480 : Info : Webserver: start
485 : Info : OTA : Arduino OTA enabled on port 3232
498 : Info : EVENT: System#Boot
2094 : Info : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 1508 ms
2108 : Info : EVENT: WiFi#Disconnected
2125 : Info : WD : Uptime 0 ConnectFailures 0 FreeMem 218460 WiFiStatus 255
5582 : Info : WIFI : Set WiFi to STA
5696 : Info : WIFI : Start network scan
5697 : Info : WIFI : Connecting Howard attempt #1
5700 : Info : WIFI : WiFi.status() = WL_DISCONNECTED SSID: Howard
10707 : Info : WIFI : Connecting Howard attempt #2
10709 : Info : WIFI : No SSID found matching: Howard
20195 : Info : WIFI : Set WiFi to AP+STA
20295 : Info : WIFI : Set WiFi to AP+STA
20395 : Info : WIFI : Set WiFi to AP+STA
20495 : Info : WIFI : Set WiFi to AP+STA
20595 : Info : WIFI : Set WiFi to AP+STA
20695 : Info : WIFI : Set WiFi to AP+STA
20795 : Info : WIFI : Set WiFi to AP+STA
20895 : Info : WIFI : Set WiFi to AP+STA
20995 : Info : WIFI : Set WiFi to AP+STA
21095 : Info : WIFI : Set WiFi to AP+STA
21195 : Info : WIFI : Set WiFi to AP+STA
21295 : Info : WIFI : Set WiFi to AP+STA
21395 : Info : WIFI : Set WiFi to AP+STA
21495 : Info : WIFI : Set WiFi to AP+STA
21595 : Info : WIFI : Set WiFi to AP+STA
21695 : Info : WIFI : Set WiFi to AP+STA
21795 : Info : WIFI : Set WiFi to AP+STA
21895 : Info : WIFI : Set WiFi to AP+STA
21995 : Info : WIFI : Set WiFi to AP+STA
22095 : Info : WIFI : Set WiFi to AP+STA
22195 : Info : WIFI : Set WiFi to AP+STA
22295 : Info : WIFI : Set WiFi to AP+STA
22395 : Info : WIFI : Set WiFi to AP+STA
22495 : Info : WIFI : Set WiFi to AP+STA
22595 : Info : WIFI : Set WiFi to AP+STA
22695 : Info : WIFI : Set WiFi to AP+STA
22795 : Info : WIFI : Set WiFi to AP+STA
22895 : Info : WIFI : Set WiFi to AP+STAGuru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x40085ea0 PS : 0x00060233 A0 : 0x80085f30 A1 : 0x3ffbdcc0
A2 : 0x00000050 A3 : 0x00001800 A4 : 0x00000050 A5 : 0x00000000
A6 : 0x00060120 A7 : 0x3ffbe818 A8 : 0x00000000 A9 : 0x3ffbdca0
A10 : 0xfffffff9 A11 : 0x00000000 A12 : 0x00060c23 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000001 SAR : 0x00000013 EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000006c LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Core 0 was running in ISR context:
EPC1 : 0x40085ea0 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x00000000
Backtrace: 0x40085ea0:0x3ffbdcc0 0x40085f2d:0x3ffbdce0 0x400863f1:0x3ffbdd00 0x4000beaf:0x3ffbdd20 0x4008991e:0x3ffbdd40 0x40089b64:0x3ffbdd60 0x400864c4:0x3ffbdd80 0x400864f4:0x3ffbdda0 0x40086645:0x3ffbddd0 0x401811df:0x3ffbddf0 0x4017bb7d:0x3ffbe0b0 0x40179081:0x3ffbe100 0x4008b0dd:0x3ffbe130 0x40089ccd:0x3ffbe160 0x40083b88:0x3ffbe180 0x40082e2d:0x3ffbe1b0 0x40085c55:0x3ffbe1d0 0x401c0907:0x3ffbc5b0 0x4013dfde:0x3ffbc5d0 0x4008b8a9:0x3ffbc5f0 0x4008a085:0x3ffbc610
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
�U45 : Info :
INIT : Booting version: MFD-mega-2020_05_15 (ESP32 SDK v3.2.3-14-gd3e562907)
The text was updated successfully, but these errors were encountered: