Flashing NodeMCU firmware to ESP8266 module

Hello Guys in this tutorial we will be flashing NodeMCU firmware to ESP8266 a low cost Wi-Fi enabled microchip with micro-controller capability. Using this module we can create connected nodes which can do IOT related stuff.


1. Requirements

  1. ESP8266 module
  2. Python should be installed


2. Building the Firmware

First we need to build the firmware for flashing. This can be build using Cloud Build Service . This service will take few arguments from you and then scripts will build the firmware for you.

For building firmware you have enter your email id along with branch from which you want your build. After that choose the modules you want to build and trigger the build. Once its completed then it will shoot a success mail along with binaries links to download.

For this tutorial we will be including following modules:

  • net
  • node
  • GPIO
  • file
  • timer
  • UART
  • wifi
  • mqtt


3. Start ESP8266 in flashing mode

ESP8266 should be in Flash mode to flash Firmware. It can be started in flash mode by pressing flash button while powering on the module.


4. Flashing Firmware to ESP8266

Next step is to flash this firmware into ESP8266. For flashing we will be using a python tool called esptool. We will using version 2.2.1 of esptool.

Important !
To run this script you must have python installed on your computer.

Download esptool from the page and unzip it somewhere. Then go inside directory where you have unzipped the esptool. Here you have to run following command.

4.1 Variables will be resolved as per below table :
  •  <serial-port-of-ESP8266> points to the serial port to which your ESP8266 is connected. This value is /dev/tty.wchusbserial1410 in my case. This can be found using following command on mac.

  • <mode> is qio for 512 kByte modules and dio for >=4 MByte modules. So it will be dio in our case.
  • <nodemcu-firmware> should be replaced by path of binary.
4.1 So our final command should look something like this.

After this you will see some kind of progress which will indicate that Firmware is being flashed.

Please comment for any suggestions.


Technology enthusiast. Loves to tinker with things. Always trying to create something wonderful using technology. Loves coding for Android, Raspberry pi, Arduino , Opencv and much more.