If your a beginner like me, you will some day find yourself in a endless loop from your code, and can't communicate with the module.
READ the help file on "Recovery Mode". Shorting Tx and Rx pins together will allow you to boot up in a "virgin state" allowing you to edit your code.
Glad I read this before losing ALL my hair! Hope I saved you some!
Zim
If you code your module into an endless loop.....
-
- Posts: 351
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 187 times
- Been thanked: 113 times
Re: If you code your module into an endless loop.....
Wait till you have code which does a sensor read and then sleeps!
I now always put in a removeable hardware link to a GPIO pin and test in code to decide sleep or no sleep.
The watchdog timer is also very handy for getting out of endless loops.
I now always put in a removeable hardware link to a GPIO pin and test in code to decide sleep or no sleep.
The watchdog timer is also very handy for getting out of endless loops.
Re: If you code your module into an endless loop.....
LOL LOL!Wait till you have code which does a sensor read and then sleeps!
Thats exactly what I did!
Zim
-
- Posts: 222
- Joined: Mon Feb 15, 2021 1:44 pm
- Has thanked: 126 times
- Been thanked: 132 times
Re: If you code your module into an endless loop.....
Ah yes, been there done it.
When I'm using sleep commands I'll put in a 10 second delay at the beginning of the program while I'm debugging.
It gives me a chance to halt the program before it gets to the sleep routine.
Such as when I used SLEEP 60000, before remembering the time is in seconds, not milliseconds
When I'm using sleep commands I'll put in a 10 second delay at the beginning of the program while I'm debugging.
It gives me a chance to halt the program before it gets to the sleep routine.
Such as when I used SLEEP 60000, before remembering the time is in seconds, not milliseconds
Re: If you code your module into an endless loop.....
If shorting Rx toTx doesn't work for you (as I have found on some ESP32) , try the online flasher. Enter atleast one change in the "config" prompt and uncheck all check marks on the firmware page. This will only erase the config page and prevent running the auto start bas. file.
Cheers
Zim
Cheers
Zim
- Electroguard
- Posts: 890
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 287 times
- Been thanked: 329 times
Re: If you code your module into an endless loop.....
Good tip Zim.
And for modules like S2's which don't have conventional RX and TX for shorting together to break out of an endless loop, it may be worthwhile defining the onboard gpio0 button interrupt branch just to issue an END instruction... then simply pressing the gpio0 button could halt the script.If shorting Rx to Tx doesn't work for you (as I have found on some ESP32)...
Re: If you code your module into an endless loop.....
And for modules like S2's which don't have conventional RX and TX for shorting together to break out of an endless loop, it may be worthwhile defining the onboard gpio0 button interrupt branch just to issue an END instruction... then simply pressing the gpio0 button could halt the script.
Thanks Electroguard. Sounds like a good idea! I will try that.
Zim