Hello, my name is Dirk and I am new to this Forum.
I just try to find my way into this little universe and so I read a lot in the docs and in this forum lately.
At the moment my problem is, that I struggle to stop my esp8266 from outputting to the console and be responsive for file transfers and so. I hooked up a BMP180 Sensor and created a timer callback for reading and outputting values to the console. It is a real pain to try to stop that and change my program because it starts over after a hard reset. (My IDE is Thonny at the moment) Mostly I am only successful when I disconnect the sensor.
I could attach a switch so I could suppress these actions in the program depending on the switches position, but I would like to know if there is a simpler method to regain control or probably some best practices on how such programs have to be designed to prevent such behaviour.
Thanks in advance
Dirk
Keeping the ESP8266 responsive...Best practices?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Keeping the ESP8266 responsive...Best practices?
I'm not familiar with Thonny but in general you can interrupt a program with ctrl-c and ctrl-d does a soft reboot.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Keeping the ESP8266 responsive...Best practices?
Usually Ctrl-C in the Thonny REPL should stop whatever program is running. Next in line would be a Ctrl-D to do a soft reset of the device, then if things really get out of whack, Ctrl-F2 to restart the Thonny backend usually does the trick.
Usually during development, I'll manually start programs in the Thonny REPL instead of doing it automatically with main.py until the code is sound. That way if everything locks up, a brute force power cycle will get me back on line.
Usually during development, I'll manually start programs in the Thonny REPL instead of doing it automatically with main.py until the code is sound. That way if everything locks up, a brute force power cycle will get me back on line.
John Sheehan