I'm working with a Lolin D1 Mini (a genuine Lolin, not some cheap imitation), and for this project I really don't want it to restart if it freezes up. I want it to fail, and not try again. So based on info found several places, I tried using this code:
It's supposed to disable both the software and hardware watchdogs. At first, I thought it was working, but waiting long enough, I get reset text on the serial monitor every 73 seconds:
[at 115200 baud]
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3424, room 16
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8
tail 0
chksum 0x2b
csum 0x2b
v000409a0
~ld
[then at 74880 baud]
rf cal sector: 1020
freq trace enable 0
rf[112] :
Can anyone shed any light on what's going on? If it matters, I have the latest ESP8266 core, which I believe is v1.3.0.
I think this goes beyond my pay grade. I can't get it to compile. It's either not declared in this scope, or if I make it ESP.system_get_rst_info(), it says "'class EspClass' has no member named 'system_get_rst_info'". Do you have a code example showing what you want me to try?
Latest or 1.3.0?
I haven't been playing with 8266 for years, but if you have latest core, I think you can simply try:
Serial.println(ESP.getResetReason());
Well, it doesn't exactly crash, but it reboots every 73 seconds. The lines above it are supposed to disable the software and hardware watchdogs, and they do stop the shorter watchdog reboots, but not the 73 second one.
The while loop is just to test whether the watchdogs have been disabled. If they were, there would be no crash or reboot. I know you're supposed to leave them alone, and do enough yield()s to keep the watchdogs fed. I can answer for my code, but have no idea what the various libraries are doing. I just need to be sure it won't reboot, so I was hoping I could just disable the watchdogs. But it looks like that's not possible. So I'll need to do a yield loop or something.
Could you disable WiFi all together ? I mean it anyway won't work properly if the scheduled tasks aren't performed, and there is a chance the reset is caused by the WiFi hardware / software
I tried wifi-off, but it didn't make any difference.
Well, Perplexity reports that this is a known problem with the ESP8266, but no solution has been found. So it looks like I just need to go back to yielding a lot, and hope for the best.
The ESP8266 is EOL.
You should have moved to the ESP32 range a while ago.
The ESP32-C3 (single core) is a direct replacement for the now obsolete 8266 chip.
My favorite is the Seeed XIAO range.
Leo..
I don't think it's EOL. It's still manufactured by Expressif, and still supported. But I agree that the ESP32 is the way to go. It's just that I didn't have any of those on hand, but did have three ESP8266s in the junque box.
I don't know. I just copied the line from a source that said it would work to disable the hardware watchdog. I don't understand the line at all, except that it supposedly writes something to a register.