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).
- 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
- soldering iron + solder
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.
Build and download the latest version of NodeMCU firmware:
or this one (NodeMCU 0.9.5 build 20150214 powered by Lua 5.1.4):
Download the latest version of Python script (esptool.py) used to flash the Firmware:
or this one:
Build the circuit according to this schematic:
Connect the JP1 jumper to upgrade firmware.
Connect the circuit to USB.
Open terminal and go to the folder where you have esptool.py and the .bin file
in my case:
Start uploading the Firmware
in my case, the USB to Serial converter is seen as /dev/ttyUSB0
and firmware file is nodemcu_latest.bin
python esptool.py --port /dev/ttyUSB0 write_flash 0x00000 nodemcu_latest.bin
Terminal output must be:
Writing at 0x00062000... (100 %)
After uploading complete, disconnect the circuit from USB.
Disconnect the JP1 jumper.
Connect again the circuit to USB.
Open a Serial terminal, using 9600 BaudRate and “\n” as command ending and enter the command node.restart()
Output must be like in this image:
You can try a simple test, by entering these commands:
tmr.alarm(0, 1000, 1, function()
It starts printing "test" one time per second:
The NodeMCU is up and running. Enjoy :)