Close

How to Flash NodeMCU on Mac OS X Yosemite

luke-benoLuke Beno wrote 09/14/2015 at 07:23 • 3 min read • Like

Working with ESP8266 and NodeMCU can be very easy, or very challenging! I’ve been fortunate to have good luck but I’ve fielded may questions from people that have been having trouble.

If you are on a Mac (or Linux), unfortunately there are not as many GUI options as there are on Windows. There is however one solid option that has been my go to method.

Setting up the software environment

First things first, think about the hardware, it is important to know what UART interface that you plan to program with. I’m a FTDI guy, I’ve always had good luck with the parts, they might no be the cheapest but I’ve found that they keep there drivers up to date, and overall have great quality. (no comments on FTDI Gate)

ALWAYS be sure to update your drivers. Especially on Yosemite because Apple’s default is to use their own version of libftdi instead of the official FTDI VCP drivers. This for certain does not work with the FT232X series parts.

You may download the FTDI VCP drivers here and install them:

Other drivers that might be useful if you are not using FTDI are:

SiLabs

Prolific

Be advised that some low cost boards (including the official NodeMCU dev board) use a very cheap USB to UART chip, the driver can be found here:

Once you know that your UART is working, now it is time to install esptool.py

You may download esptool here:

Once downloaded, create a folder and place esptool.py inside

open the terminal application and navigate to this folder using cd

You will also need to download the latest NodeMCU firmware binary from here:

There are two options for NodeMCU builds, one which includes floating point and one that does not. I highly recommend the binary without floating point because it does not leave much memory space for running code.

After download, place this bin file in the same folder.

esptool is written in python, as such it requires a working python environment. Luckily, OS X comes with Python pre-installed. pySerial is one dependency is not included but can be easily added using PIP.

You may install pySerial with the following command

pip install pySerial

Preparing the ESP8266

ESP8266 has a built in UART boot loader that is used to program new binaries. The boot loader is entered if GPIO0 is tied to GND when ESP8266 comes out of reset or is powered on. Most modules either have a push button or a pad where a wire my be soldered to. Use this pin/pad or button to tie GPIO0 to ground and power on the module.

CH_PD must be tied to VCC to be functional, this is equivalent to "Chip Power Down”.

Some ESP8266 modules including ESP-03 also require GPIO15 to be tied to ground at all times for proper function.

Flashing

With the software environment setup and the ESP8266 in bootloader mode, its time to finish the flashing process.

You will need to find the path to the UART. In OS X these are typically in the /dev/ path and typically begin with “tty.”. List these paths with:

ls /dev/tty.*

For FTDI based chips it is typically “tty.usbserial-xxxxxxxx”, find the correct path for your UART and copy it to the clip board.

The final step is to program the chip. To do this, use the following command to flash. Be sure to replace “/dev/tty.usbserial-FTSMF90L” with the path to your UART and “nodemcu_integer_0.9.6-dev_20150406.bin” with the name of the firmware file that you wish to download.

sudo python esptool.py -p /dev/tty.usbserial-FTSMF9OL write_flash 0x000000 nodemcu_integer_0.9.6-dev_20150406.bin

Enter your password for Sudo and with some luck, you’ll see a message that looks something like this:

There you have it, any questions on this process, the ESP8266 forum is a great resource. How to Flash NodeMCU on Mac OS X Yosemite

Like

Discussions

lordanubis wrote 01/13/2016 at 19:19 point

Great article, but where are the links? Without the links or the  files too download, the article has no value. Please add the links. Thank you

  Are you sure? yes | no

stopsendingmejunk wrote 12/31/2015 at 02:14 point

This article is helpful except that it seems to be missing all the links it is supposed to have. Specifically I'm wondering where I can find the drivers for cheap USB to UART chips. 

  Are you sure? yes | no