Connection fails to ESP32, with MicroPython 1.9.4 after uploading python code
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: Connection fails to ESP32, with MicroPython 1.9.4 after uploading python code
If your ESP32 is crashing because of the code in boot.py the only way that I know to fix this is use esptool to erase the ESP32 then reflash the MicroPython firmware.
Re: Connection fails to ESP32, with MicroPython 1.9.4 after uploading python code
No, that is not what I ment ( forgive my english ).OutoftheBOTS_ wrote: ↑Sat Aug 04, 2018 6:49 amIf I am understanding your problem it is that your ESP32 is crashing during boot up and not getting a repl. Is this correct????perhaps I don't understand you answer- but I don't see how it is relevant for what I asked ( my english ? )
When Micro-Python starts up it executes boot.py during boot up then after boot up has finished it executes main.py. If there is a problem in the code in boot.py it will not exit to repl but if there is a problem in the code in main.py it will exit to repl. This means you need to be very careful with the code you put in boot.py, so you are much better to put your startup code in main.py
A code, including thread ( in charge of running a MQTT service )- causing ESP32, not to get connected using rshell. In order to gain access again, I just need to physically unplug and plug back ( a reset using on board button is not enough ).
When this code is running upon boot ( imported in main.py - since that is it purpose ), you can never get access again, only after re-flashing ESP to delete its entire content.
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: Connection fails to ESP32, with MicroPython 1.9.4 after uploading python code
Well that is unusual. I though that pressing the hard reset button worked by physically operating a transistor inside the ESP32 to cut the power to the ESP32 doing the same job as unplugging then replugging.I just need to physically unplug and plug back ( a reset using on board button is not enough ).
Ok a simple work around that you might be to add to your program that if it receives a MQTT message to quit then then exits by executing exit() fuction.
So the problem could either be with the ESP32 or with rshell. I would try anther shell like mpfshell and see if it works because if it does then it will tell you that it is a problem with rshell and not the ESP32.
Last edited by OutoftheBOTS_ on Mon Aug 06, 2018 8:16 am, edited 1 time in total.
Re: Connection fails to ESP32, with MicroPython 1.9.4 after uploading python code
If you need telnet, you can try loboris firmware, which is working pretty pretty well with telnet.