i am using a Wemos D1 Mini and i have troubles using machine.reset()
Here is the code of main.py :
Code: Select all
import sys
import machine
from uio import StringIO
try:
import run.mpy
except KeyboardInterrupt:
sys.exit()
except Exception as e:
s=StringIO(); sys.print_exception(e, s)
x=s.getvalue()
payload="system exception=\"{1}\"".format(e)
temp=open("error.txt","w")
temp.write(payload)
temp.write(x)
temp.close()
machine.reset()
The Problem now, the error is logged correct, but the esp is not restarting.
I got the micropyhton-shell, it seems, that the boot.py and main.py is not excecuted?
Doing Strg+D everthing is ok, donig a hardreset with the reset button, also everthing is working as expected.
Yes, i could catch the error within the run.mpy but, for debubing reasons i would like to do it that why
Any ideas why?