Interrupt NodeMCU init.lua November 24, 2015
Antre du Tryphon

Interrupt NodeMCU init.lua

November 24, 2015 · Admin Linux ESP8266 NodeMCU IoT Internet of Things

It can be sometimes challenging to regain control of the NodeMCU running on a ESP8266 when init.lua has a tight loop in it.  To do so,  first, download esptool.py from GitHub. Execute the following command

python esptool.py --port /dev/ttyUSB0 --baud <baud-rate> erase_flash

where is the baud rate of the connection between the ESP8266 and your PC.  Typically, 9600. is the serial port the ESP8266 is connected to.  Typically,  /dev/ttyUSBn on Linux. After having done this, you will need to re-install NodeMCU.  It can be done using the following command:

python esptool.py --port /dev/ttyUSB0 --baud <baud-rate> 
     write_flash 0x00000 <nodemcu-path>

where is the baud rate of the connection between the ESP8266 and your PC.  Typically, 9600. is the serial port the ESP8266 is connected to.  Typically,  /dev/ttyUSBn on Linux. is the filename an path of the NodeMCU image.  Example: ../nodemcu_float_0.9.6-dev_20150704.bin


Copyright 2012–2026, Claude "Tryphon" Théroux