Hacking ESP8266's

I heard about ESP8266's from a friend at Google last year; I'd seen noise about them but hadn't paid any attention. Then what he said caught my attention -- using standard batteries we can make them run months, maybe more.

I started trying to come up with a good reason to get a few and play with them. Then I saw the Huzzah announcement and thought, heck, $10? I'll get a couple and play.

Then a colleague, was picking up a FTDI Friend -- so I asked him to grab me one. At that point I had all the hardware I just needed a few minutes some time to figure out how to use them.

I spent last Saturday afternoon fighting these things. Nothing worked, I was fighting everything -- finding software, serial console baud rates, horrified I might have to resort to, gasp AT commands. Then Sunday afternoon, I found the #esp866 irc channel and life got good fast.

Here's a summarized version of how I got started, so that others don't waste the time I did:

Using these four pieces of hardware:

  1. USB Cable
  2. FTDI Friend
  3. Huzzah
  4. Experiment Breadboard

I did these things:

git clone https://github.com/themadinventor/esptool.git
  • Install pyserial: pip install pyserial

Then using esptool.py flash the nodemcu firmware to the esp8266 code. This involves two steps, and the second step must be done before the first step times out:

Step 1: Invoke the flashing command on your machine.

sudo python esptool.py --port /dev/tty.usbserial-AH0331HQ write_flash 0x00000 ~/Downloads/nodemcu-master-7-modules-2015-11-15-02-21-44-integer.bin

Step 2: Reset the hardware so it accepts the firmware update.

While holding down the GPIO0 button, press and release the RESET button.

Voila! Reflashed.

Now, connect to your Huzzah and play at the command line. I do this by using screen:

screen /dev/tty.usbserial-AH0331HQ

Happy Hacking.