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.
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.
- ESP8266 (duuh)
- USB to serial converter, Arduino or similar
- breadboard and jumper wires
- NodeMcu firmware (https://github.com/nodemcu/nodemcu-firmware/releases)
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
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.
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.
If you dont know which one to use, connect your serial device, open Terminal app (Applications – utilities – Terminal) and write
and press Tab. You should see something like this. You can probably figure out which one is the one 🙂
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!
Thats it. Restart ESP to bring it into normal op mode, and you can use java based ESPlorer app to program it.
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.
[ecp code=”LayerBanner”][ecp code=”TExtLinkAd”]