
Wait! Don’t Go Yet! 👋
Become a Member Today and Unlock Access to All eBooks! 😍
Thousands of eBooks at your fingertips. Read, learn, and grow anytime, anywhere ✨

Become a Member Today and Unlock Access to All eBooks! 😍
Thousands of eBooks at your fingertips. Read, learn, and grow anytime, anywhere ✨

This quick article explains how to erase ESP8266 NodeMCU flash memory to restore it to its factory default settings. Using a tool named esptool.py, we'll be able to communicate. If the system keeps crashing and you can't upload new code, if you want to remove any firmware or configuration modifications you made, if you want to clean off old data, or for other reasons, you may find it useful to restore ESP8266 to its factory settings.
We'll use esptool, which is a “Python-based, open-source, platform-independent utility to communicate with the ROM bootloader in Espressif chips,” to perform an ESP8266 factory reset.
You need Python 3.7 or newer installed on your system to install esptool. Make sure you choose the right package for your system before beginning the download and installation process at the following link:
Open a terminal window and use pip to install the latest stable release of the esptool.py package when Python 3 is installed.
pip install esptoolNote: That command may not work in some Python installations, and you will receive an error. If this is the case, try installing esptool.py using:
Setuptools is also a requirement that is not installed by default on all systems. You may use the following command to install it:
pip install setuptoolsYou should be able to run esptool.py with the command esptool after installation since it will be placed in the default Python executables directory. Run the following command from your terminal window:
python -m esptoolIf it was installed properly, it should display a similar message (regardless of your operating system):

Follow the next steps to erase ESP8266 NodeMCU flash:

python -m esptool --chip esp8266 erase_flash
Note: If you keep seeing new dots after the “Connecting…” message, your ESP8266 board is not in flashing mode. To make sure that your ESP8266 enters flashing mode and properly completes the erasing process, you need to repeat all of the previously stated steps and hold the “BOOT/FLASH” button.
If you encounter a permission error while trying to run the esptool command, open the command prompt as an administrator (or as sudo on Linux).

If you like ESP8266, you may also like:
We hope you find this tutorial useful. Thanks for reading
🚀 Discover the world of electronics and innovation!
✨ Create, program, and experiment with all your creative ideas with ease.
🔥 Don't wait! Browse SpotPear products now and start your amazing project!
