-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WDT reset when using modem sleep #3662
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
Sorry, i tried running the sketch you provided, but it does not compile. Could you please check and make sure that the sketch can be compiled and reproduces the issue? Thanks. |
Sorry Ivan, that was just a code snippet. Here is another example #include <TimeLib.h> //#define DHTTYPE DHT11 // DHT 11 extern "C" { extern "C" { #ifndef WIFI_CONFIG_H //const char* YOUR_WIFI_SSID = "BlueZebra"; static int connectAttempts = 0; const char* ahostname = "MQTT_Test"; #define SLEEPM 60000 // one minute //int8_t timeZone = 1; int8_t timeZone = -8; // PST // Start NTP only after IP network is connected // Manage network disconnection void processSyncEvent(NTPSyncEvent_t ntpEvent) { boolean syncEventTriggered = false; // True if a time even has been triggered void setup()
//connectAttempts++;
// **************** WIFI connect section *************** while (WiFi.waitForConnectResult() != WL_CONNECTED) { } void loop()
/* */
// delay(10000);
//Serial.println("Free Heap = " + String(ESP.getFreeHeap()));
// e2 = WiFi.onStationModeDisconnected(onSTADisconnected);
} |
Not sure if you wouold like like a new ticket opened or just add to this one. This time running 2.3.0 with a much simplified sketch.
Sketch:
This crash appears at random times, perhaps I need to reformat the flash? |
Sorry, did not mean to close this ticket. I reformatted the flash with esptool and uploaded again. monitoring for now. |
@trentbrown13 what was the result of your monitoring? |
It was still crashing after re-flashing and I am now downgraded again to 2.3 which is running flawlessly on several esp's. I'll try upgrading to 2.4.0-rc2 soon and try again on a few devices. Thanks for the help! |
I too get this issue with 8edeac0. The issue seems to be timing related and is hard to pin point. Essentially I do:
If I do NOT call doHttpsGetTransaction, the ESP8266 goes to sleep and the WDT does NOT trip. |
Turns out reducing the timeout value of the WiFiSecureClient from 15s to 100ms helps a lot with this issue. Indeed after the peer hangs up on the connection it took a while for my sketch to take notice and this is due to It looks like shaving these previous seconds allows the return from loop() and the hardware WDT being reset on time. I don't like the feel of this though as I expect to be bitten again later down the road. Is there a maximum absolute amount of time one should stay in loop before returning ? Does calling Best regards, |
Can confirm, |
As with issue #4082, WiFiForceSleepBegin() still caused a WDT reset with core 2.5 until I added a delay(1000) just before it. With this delay, my sketch has been running for 2+ days with a WiFiForceSleepBegin() every 60 seconds or so. Not sure if the "waiting for feed back" label is still pertinent, let me know if I can provide more info. |
Wow, looks like WiFi power down has been an issue a looong time. Closing as we've got an active discussion of this in #6172 where folks are making some progress, I believe. This will also make a link there to this discussion so they can avoid trying the same dead-ends you ran into. |
Basic Infos
Hardware
Hardware: Wemos d1 mini
Core Version: 2.4.0-rc1
Description
I am using modem sleep with the wemos D1 mini which works fine with 2.3.0. After upgrading to 2.4.0-rc1 I get a wdt reset immediately after issuing "WiFi.forceSleepBegin();" I later downgraded back to 2.3.0 and it works fine again. One note, my free heap reported by "ESP.getFreeHeap(); seemed to be much lower when using 2.4.0-rc1 but I was primarily trying to isolate the wdt reset cause. I only noticed this as I am chasing a memory leak problem and printing heap size all over the place.
Settings in IDE
Module: Wemos D1 R2 mini
Flash Size: ?4MB/1MB?
CPU Frequency: ?80Mhz?
Flash Mode: ?qio?
Flash Frequency: ?40Mhz?
Upload Using: SERIAL
Reset Method: ?ck / nodemcu?
Sketch
Stack Trace
Soft WDT reset
ctx: cont
sp: 3fff0990 end: 3fff0c00 offset: 01b0
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vf6d232f1
~ld
Decoding 8 results
0x4021ad48: ieee80211_setup_ratetable at ?? line ?
0x40203d5e: ESP8266WiFiGenericClass::enableSTA(bool) at C:\Users\Windows7\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.cpp line 96
0x40203d49: ESP8266WiFiGenericClass::getMode() at C:\Users\Windows7\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.cpp line 96
: (inlined by) ESP8266WiFiGenericClass::enableSTA(bool) at C:\Users\Windows7\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.cpp line 329
0x40203452: loop at D:\Programming\ESP\Weather nodes\Trents_Office_Msleep1G/Trents_Office_Msleep1G.ino line 738 (discriminator 3)
0x4020a77c: String::changeBuffer(unsigned int) at C:\Users\Windows7\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.cpp line 720
0x4020b4b0: String::move(String&) at C:\Users\Windows7\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.cpp line 205
: (inlined by) String::String(String&&) at C:\Users\Windows7\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.cpp line 51
0x4010070c: cont_resume at C:\Users\Windows7\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/cont.S line 99
The text was updated successfully, but these errors were encountered: