How to Test NodeMCU V3 Using Esptool

  • by

When your NodeMCU V3 development board is misbehaving or not functioning as expected, you may test the NodeMCU V3 using Esptool.

Esptool does not only work on NodeMCU V3. It works on any microcontroller module or development board using ESP8266 and ESP32.

A command line utility to communicate with the ROM bootloader in Espressif ESP8266 & ESP32 microcontrollers.

Allows flashing firmware, reading back firmware, querying chip parameters, etc.

Project Description – https://pypi.org/project/esptool/

How to Install Esptool

To install Esptool, you need to install Python first. Esptool works on top of Python. You don’t install Esptool by downloading from a link and running an installation program. You will install Esptool using Python pip.

Head over to https://www.python.org/downloads/. Download and install the latest version of Python, which, as of this writing, is version 3.8.1.

In Windows 10, open a command prompt, go to the directory where you installed the Python software. Go to the “scripts” directory. Then, on the command prompt, type “pip install esptool”.

C:\Python\Scripts>pip install esptool

Running the Esptool Tests

Display the NodeMCU V3 chip ID.

esptool.py --port com8 chip_id
Command Prompt output showing the results of running a chip id check on nodemcu v3 using esptool

Display the NodeMCU V3 flash ID.

esptool.py --port com8 flash_id
command prompt output showing the results of running a flash id test on nodemcu v3 using esptool

If you are testing a newly purchased NodeMCU V3 development board, you may want to save its existing, factory supplied firmware. This only works if you have not yet loaded any Arduino sketch on the board. Uploading and running an Arduino sketch on a NodeMCU V3 development board overwrites and erases its factory supplied AT Commands firmware.

esptool.py --port com8 read_flash 0 0x400000 nodemcu_backup.bin
command prompt output showing the outcome of read_flash command in saving the original firmware of nodemcu v3 development board.

Supplied Esptool read_flash parameter meaning:

  • com8 – the port where NodeMCU V3 is connected
  • 0 – start adddress of flash memory to read
  • 0x400000 – end address of flash memory to read (4MBytes)
  • nodemcu_backup.bin – the filename where to save the firmware

To restore the firmware later on, use the following esptool command:

esptool.py --port com8 write_flash 0 nodemcu_backup.bin

Related Articles on How to Test NodeMCU V3 Using Esptool

Arduino Reference and Resources
How to Test NodeMCU V3 Using Arduino IDE

References on How to Test NodeMCU V3 Using Esptool

Esptool – https://github.com/espressif/esptool
NodeMCU on Wikipedia – https://en.wikipedia.org/wiki/NodeMCU

Leave a Reply

Your email address will not be published. Required fields are marked *