Getting started with the esp8266

The internet is full of pretty okay 😐 tutorials for the esp8266 I guess, but I thought it would be good to have a full, decent tutorial for total noobs like me who ordered the esp8266–01 to try to get started doing stuff for cheap. Baby steps 👶🛠.
This tutorial has three parts: Buy Stuff 💸, Build Stuff 👷🔧, and Program Stuff 💻.
Buy Stuff
Like me, you might be a software developer just getting into hardware hacking, so this tutorial assumes that you literally own zero hardware. Here’s some stuff. I’ll include amazon prime links just in case you have prime.
🚨WARNING🚨 Not all USB-to-serial converters work with the esp8266, so if you already have one, check this awesome list to make sure yours will work. I used the one above successfully.
Amazon.com: JBtek Breadboard Power Supply Module 3.3V/5V For Arduino Board Solderless Breadboard: Electronicswww.amazon.com
The reason to get a power supply is that the esp8266 draws more current than the usb-to-serial converter can give. If you try to just use usb power, it will seem to work at first but will die at the worst possible time.
If you need the basics, this is the best and cheapest kit I could find.
Build Stuff
This is both super fun and kind of boring, because while you get to make something with your hands you also have to install things and troubleshoot problems, but you’ll do just fine! 👌
STEP ① Plug everything in! Here’s a cheat sheet for which pins are what on the esp8266. Leave the power supply off and don’t plug the usb into your computer until Step ③, though.
RXD → USB TX
VCC → Power supply 3.3V
GPIO0 → Loose wire for occasionally plugging into ground for flashing
RST → Loose wire for occasionally touching ground to reset chip
GPIO2 → nothing
CH_PD → Power supply 3.3V
GND → Power supply ground
TXD → USB RX
USB GND → Power supply ground
STEP ② Make a folder for all the 💩 you’ll download and all the code you’ll write (if you get that far 😱). Call this folder “esp8266” or something logical. Other logical names also include Viserion, Rhaegal, and Drogon because DRAGONS 🐉🔥.
- Install the CP2102 driver if you bought the usb-to-serial device I linked above.
- Get esptool for flashing firmware. Run “python setup.py” to install its dependencies.
- Grab the latest nodemcu firmware, probably the float version but it’s up to you. Such firm. Will ware later.
- Finally get ESPlorer™. 👈 This is what we’ll use to write and upload lua scripts. To run it, mac/linux users do “java -jar ESPlorer.jar” and windows users probably click on ESPlorer.bat? (I’m not a windows user)
STEP ③ Plug in your power supply ⚡️ and usb because we’re going to flash the nodemcu firmware to your esp8266. We won’t even try to use the preloaded AT firmware that the esp8266 ships with because there are too many things to troubleshoot.
Find the device port for your usb-to-serial connection. For me, it was “/dev/tty.SLAB_USBtoUART”
Here are the steps for flashing the firmware.
- Plug in esp8266 GPIO0 to your power supply ground to enable flash mode.
- Briefly touch the esp8266 RST to ground to reset it. When you release RST from ground, the blue light on the esp should blink once.
- Flash it ✨ with this one-liner from your 🐉 folder:
python ./esptool/esptool.py -p /dev/tty.SLAB_USBtoUART write_flash 0x0000 ./nodemcu_float_0.9.6-dev_20150704.bin
The output should look something like this.

If it got stuck on Connecting…, then make sure GPIO0 is plugged into ground, and make sure your usb-to-serial converter actually works according to this blog post.
If it looked like it worked, great! Unplug GPIO0 from ground to take it out of flash mode, and touch RST to ground to reset it. Only one last bit of setup before you’re ready to program.
STEP ④ Now you can check that ESPlorer works with your esp8266. Find and click the refresh/scan 🔄 button on the right side (it’s right next to Open) and then select your port in the dropdown above it. My port was “/dev/cu.SLAB_USBtoUART.” After selecting a port, click Open. If it shows like a million dots, try a different port or make sure you took your esp out of flash mode. If it shows “Got answer!” you’re probably good 😅. And if it shows something like this…

…then just touch the reset pin to ground briefly and then it should automatically start working, showing something like this…

…yay (even though it says “cannot open init.lua” you’ll be fine). 🙏
Program Stuff
This is the super fun part! 🎉
Blinking an LED is soooooo IoT 1.0, so instead for our “hello world” program we’ll scan for wifi access points! If you can find access points, you’re halfway to anywhere 😀. Paste the following code into the left side of ESPlorer, save it as something like “listap.lua” and then click the “Send to ESP” button on the bottom if it doesn’t automatically run after saving. ESPlorer is in very active development right now, so things might be automatic or not.
You’ll see ESPlorer upload your lua file one line at a time, and then it should run, showing you a list of access points.

Now that you’re halfway to getting pwned from anywhere, go ahead and read up on nodemcu and make something sweet!