'''I'm using ESP32 with nodemcu coded with lua. To test deep sleep by mistake I've mentioned node.dsleep(10) in init.lua file without any condition so my ESP32 is continuously restarting I can't able to upload the another program (modified one ) please help me to upload modified program node.dsleep(10) or please tell me how to get over this problem'''
Asked
Active
Viewed 137 times
1 Answers
2
You need to switch to bios mode and reinstall the firmware. I had lots of situations like this, to avoid reinstalling it everywhere I suggest to set a timer before running all code. During this timer you can reupload script you need. Or make some pin as debug pin, if it's set to HIGH do not run any code.

Spar
- 1,582
- 9
- 16
-
Thank you I did reinstall the firmware but before I erased everything in the flash using esptool with command "esptool.py --chip esp32 --port COM5 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader.bin 0x10000 NodeMCU.bin 0x8000 partitions.bin" – Abhi Nov 12 '20 at 05:36
-
@Abhi Good to hear you figure it out. You can mark this answer as accepted. – Spar Nov 12 '20 at 08:44
-
1@Abhi in our documentation for NodeMCU on ESP8266 we have an example `init.lua` that incorporates the strategy @Spar proposed: https://nodemcu.readthedocs.io/en/release/upload/#initlua – Marcel Stör Nov 12 '20 at 11:06
-
@Abhi Please mark this answer as "accepted" if it helped you. Read more: https://stackoverflow.com/help/someone-answers – Spar Nov 16 '20 at 23:47