Flashing NodeMCU using Ubuntu

When I received my two NodeMCU boards, I rapidly tried to update the firmware … and broke the firmware of one of the board. So here is the correct way to flash a firmware on a NodeMCU board which allowed me to save it.

Image by Vowstar (Own work) [CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0)], via Wikimedia Commons.

Most of the information here come from NodeMCU’s wiki page dedicated to Mac OS X. But you can safely transpose most of the commands to Ubuntu.

  1. Download a firmware.
    I used the latest one, from NodeMCU, with float support: https://github.com/nodemcu/nodemcu-firmware/releases
  2. Copy esptools.py to your disk. Direct link on NodeMCU’s github.
  3. Launch the command to flash the board (I do not remember if I needed to reset the board pressing the flash button).
    python ./esptool.py --port=/dev/ttyUSB0  write_flash -fm=dio -fs=32m 0x00000 ./nodemcu_float_0.9.6-dev_20150704.bin
  4. Unplug and plug the board.
  5. Connect to the board.
    screen /dev/ttyUSB0 9600
  6. Try to light up the LED (it seems that GPIO can be different depending on board).
    gpio.mode(4, gpio.OUTPUT)
    gpio.write(4, gpio.LOW)

2 Replies to “Flashing NodeMCU using Ubuntu”

  1. Hello,

    I can’t find any contact info in the site so forgive me for using the comment section. I’m Algen, I work with engineering website EEWeb.com and would love to have your website featured as a site of the day on EEWeb. Is this of interest to you?

    Hope to hear from you soon.



  2. The board doesn’t show up as ttyUSB0, if I plug in an arduino it shows as ttyUSB0

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.