Flashing NodeMCU

Flashing the NodeMCU Firmware to the ESP-01

Flashing NodeMCU

This page explains how to flash the NodeMCU firmware to the ESP-01 WiFi module. With NodeMCU you can run lua scripts directly from the memory of the ESP and you can upload them via Serial port (UART).

Materials needed:
- ESP-01 WiFi module
- USB to Serial adapter like FTDI
- 8-pin socket for the ESP-01 module
- 1x 470R resistor
- 2x 220R resistors
- 2x 47uF capacitors
- 3.3V 250mA LDO voltage regulator MCP1702T3302ECB
- 2-pin jumper + jumper header
- wires
- protoboard
- soldering iron + solder

Introduction

The NodeMCU firmware one of the things that made the ESP8266 so popular. You can find very good documentation on how to use this firmware and how to write lua programs on their website: NodeMCU Website.

Steps:

1.
Build and download the latest version of NodeMCU firmware:
https://nodemcu-build.com
or this one (NodeMCU 0.9.5 build 20150214 powered by Lua 5.1.4):

nodemcu_latest.bin

2.
Download the latest version of Python script (esptool.py) used to flash the Firmware:
https://github.com/espressif/esptool
or this one:

esptool.py

3.
Build the circuit according to this schematic:

flashing-nodemcu-firmware-to-esp8266-schematic.png

4.
Connect the JP1 jumper to upgrade firmware.

5.
Connect the circuit to USB.

6.
Open terminal and go to the folder where you have esptool.py and the .bin file
in my case:
cd ~/Desktop/espUpdate/

7.
Start uploading the Firmware
in my case, the USB to Serial converter is seen as /dev/ttyUSB0
and firmware file is nodemcu_latest.bin

terminal command:
python esptool.py --port /dev/ttyUSB0 write_flash 0x00000 nodemcu_latest.bin

8.
Terminal output must be:
Connecting...
Erasing Flash...
Writing at 0x00062000... (100 %)

Leaving...

After uploading complete, disconnect the circuit from USB.

9.
Disconnect the JP1 jumper.

10.
Connect again the circuit to USB.

11.
Open a Serial terminal, using 9600 BaudRate and ā€œ\nā€ as command ending and enter the command node.restart()

12.
Output must be like in this image:

flashing-nodemcu-firmware-to-esp8266.jpg

13.
You can try a simple test, by entering these commands:
tmr.alarm(0, 1000, 1, function()
print("test")
end)

It starts printing "test" one time per second:

testing-nodemcu-cutecom.png

14.
The NodeMCU is up and running. Enjoy :)