Flash ESP8266 with Nodemcu in terminal

We all have them… or have at least heard of them: The tiny, yet mighty wifi module, the ESP8266. Have you ever trid to flash ESP8266 with Nodemcu in terminal? read on

They come in various shapes and sizes, but they’re basically all the same.. plus, minus some GPIO ports.

all_esp_modules1

I still have the v.01, that came flashed with AT firmware, which means yout can contrll them with AT conmmands, much like you could controll modems and cell phones….

So to actually make ESPs usefull, meant hooking them to a uC, and sending string over. It did work, but some clever bobbins decided to make the ESP8266 programmable, thus making it standalone. Enter NodeMCU, which is “lua based interactive firmware for mcu like esp8266”. It means you can program it directly 🙂

Im not going to go into details of programming it, just how to hook it up and flash it with NodeMCU, and since I reeeeaaaalllyyyy dons like GUIs, we’re going to do it in console, or as Apple calls it, the Terminal.

We need:

Take note that ESP8266 is NOT 5v tolerant. It works from 3.3v to 3.6v. Anything over that, will release the magic smoke.

First, we need to hook it up:

  • VCC – 3.3v
  • GND – ground
  • TX – RX
  • RX – TX
  • gpio0 – GND
  • CH_PD – 3.3v

Screen Shot 2015-10-09 at 11.45.18

GPIO0 has to be pulled to ground to enter the bootloader to allow programming of the device. A 10k resistor can be used, I just didnt have any 🙂

I order to to power up the ESP, you have to short pin CH_pd to 3.3v.

Here is the full schematic for the breakout board.

Here is the full schematic for the breakout board.

download EspTool. You have to have python installed. Linux and Macs already have it.

extract the zip, and locate esptool.py

Open it in you favourite text editor, and find line 367, and change from whatever default port is, to whatever suits your needs in the form of /dev/tty.NAME.

Screen Shot 2015-10-09 at 11.53.21

If you dont know which one to use, connect your serial device, open Terminal app (Applications – utilities – Terminal) and write

cat /dev/tty.

and press Tab. You should see something like this. You can probably figure out which one is the one 🙂

Screen Shot 2015-10-09 at 11.57.39

So, write that down, copy it to the file and save it.

Now, download NodeMcu latest firmware. At this point the lastest stable is 0.9.5, and 0.9.6_dev.

here, we’re going with nondev.Tthe one that uses integer-based calculations, uses less memory, feel free to download whichever you want/need.

Now open your terminal, cd into esptool directory, and run the esptool command with sppropriate arguments. Dont forget to fire up the ESP in bootloader mode.

For me, this was:

./esptool.py write_flash 0x00000 nodemcu_integer_0.9.5_20150318.bin

Press return, and Voila!

Screen Shot 2015-10-09 at 13.30.39

Thats it. Restart ESP to bring it into normal op mode, and you can use java based ESPlorer app to program it.

I made some breakout boards to make programming easier. DSC_0074 DSC_0073

This one is battery powered. Im making a Blynk powered remote for controlling a water heater in my bathroom. this one is just a prototype, its going to be smaller 🙂DSC_0071 DSC_0070

I also sent some .brd files to OSHpark, the renderring looks like this. kinda cool 🙂 I removed the 10k resistor between CH_PD and 3v3 since its not really needed. Its safe t use it, yes, but I have had no problems not using it.5e136c8caee03ee292b60c02b4604021 Screen Shot 2015-10-09 at 20.59.16

[paypal_donation_button align=”left”]

[ecp code=”LayerBanner”][ecp code=”TExtLinkAd”]

One Comment

  1. Pingback: ArduPilotMega Telemetry2Wifi bridge - spikey.si

Leave a Reply

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