Introduction: Esp8266 Team Hack Programming

This project is part of a series for an instructables team hack. See the series for more information.

At this point, we have an esp8266 development board running MicroPython. We can talk to it using any serial console program. This is how we will control the esp8266.

Step 1: Software

There are several programs which talk to the esp8266, it will all depend on your OS and your comfort level with various interfaces. Here are some recommendations:

MacOS

Linux

Winders

For any of these, we need a few settings to connect to the esp8266:

  • Serial port (ex. /dev/cu.usbserial-0001, /dev/ttyUSB0, or COM5)
  • Speed: 115200
  • Data bits: 8 (usually the default)
  • Parity: none (usually the default)
  • Stop bits: 0 (usually the default)

This is sometimes expressed as `115200,8,N,1`.

If you find this all awkward, you are not alone. There will be an easier option once the esp8266 is connected to wifi.

Step 2: Talking to the Esp8266

Connect the microcontroller to your computer using a micro usb cable. Configure your software from the previous step, and then `connect`. If it worked, you should see a line that looks like:

>>>

Now is the time to celebrate. This is a Python shell on the esp8266. It is traditional to run a hello world program as the very first thing. Let's do that now. Type the following into the console and hit enter/return.

print("hello world")

The console should print out `hello world` and return to the `>>>` prompt. That was a complete program written in the python programming language, running on your esp8266. Yay!

As a bonus, the esp8266 dev board does not need to be connected to a computer anymore. Plug it into a wall, or a USB power supply to embed it in a project. Note that some USB power supplies turn off if they think they are not in use. These esp8266 dev boards use so little power, it may cause some supplies to turn off.