undesired WDT-reset und reset cause 2

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
astirfreak
Posts: 5
Joined: Mon May 04, 2020 7:14 pm

undesired WDT-reset und reset cause 2

Post by astirfreak » Mon May 04, 2020 7:27 pm

Hi,
I have a Micropython 1.12 on an ESP12F-Board running.
My application has a small pin interrupt routine, which transfers the timestamp of a detected edge via a predefined array to the main loop. From there the edge data is send to a webserver via http get. A NTP-update ist made every 15 minutes.
For debug reasons I save every reboot to a log file and found something strange. Approx one time per day the board makes a WDT-reset.
The other thing ist, that sometimes I get a reset cause 2, which is not defined as constant in the machine lib. This reset seems to be triggered sometimes, when I try to connect via webrepl.
What can be the reason for this behavior?

Is there a way to do a hard reset via software, which completely reboots the board? In earlier versions of my script, I had the problem, that the pin interrupt was not working after a machine.reset(). I'm not sure, if this behaviour is gone now, because I disabled the daily reboot in the actual version.

Michael

astirfreak
Posts: 5
Joined: Mon May 04, 2020 7:14 pm

Re: undesired WDT-reset und reset cause 2

Post by astirfreak » Mon May 18, 2020 6:01 pm

I went back to Micropython 1.9.4 now. There I haven't such a problem, the board is stable there.

But on an ESP32 I also had problems with 1.12 and solved it by using utime.sleep_ms(x) with x > 10 now instead of utime.sleep_ms(10).
Maybe the short sleep period has also some impact on my ESP8266 which is only a problem on the newer micropython version.

But the script works now on 1.9.4 and now: Never touch a running system

But the question "what is reset cause 2?" is still unanswered.

Michael

Post Reply