1. Get the latest version of Python 2 or 3 (we recommend 2)
python
. python
in Command Prompt. If that doesn't work, you can also try the command py
.python --version
in the command line interface (i.e. Command Prompt for Windows, Terminal for Mac/Linux). *>>>
or ...
, and you can return to the command line interface by using exit()
. This distinction will be important later.C:\Users\yourname>
.SoAndSo's Macbook:~ yourname$
.2. As the regular download of Python contains only an interpreter and a single-line command prompt (known as a REPL, or read-eval-print-loop), it is recommended that you also download a text editor. We recommend the Anaconda package, which contains the Spyder IDE application and can be downloaded here (link). Spyder creates an environment similar to MATLAB, as opposed to using just what comes with Python--which would be like coding using only MATLAB's Command Window. It's like using a typewriter instead of Microsoft Word.
3. "pip" is a command line program used to install packages. Insure that you have pip installed by running the command pip --help
in the command line directly into Terminal or Command Prompt (read: not the Python interpreter).
pip install -U pip
on Mac or python -m pip install -U pip
on PC.4. Use pip to install esptool.py (a python script which allows us to flash firmware to all ESP8266 boards):
pip install esptool
in Terminal or Command Promptpip2 install esptool
or pip3 install esptool
depending on your version of Python.5. Download Micropython Firmware from MicroPython.org (link).
6. Put board in firmware flashing mode. This is automatic for the Adafruit Feather HUZZAH when you connect to the serial port of a computer (i.e. USB). For other boards within the ESP8266 class, refer to the manual for instructions on putting the board in firmware flashing mode.
7. Install the driver to make the board's serial port visible, courtesy of Silicon Labs (link).
8. Look below for the command to run for Mac/Windows to erase the existing flash on the board.
esptool.py --port (port) erase_flash
, replacing "(port)
" with the path or name of the serial port that is connected to the ESP8266 without the parentheses.esptool.py --port /dev/cu.SLAB_USBtoUART erase_flash
esptool.py --port COM# erase_flash
9. Write the Micropython firmware onto to the ESP8266
esptool.py --port (port) --baud (baud) write_flash --flash_size=detect 0 (firmware)
(port)
, Insert the path or name of the serial port that is connected to the ESP8266 (without the parenthesis)/dev/cu.SLAB_USBtoUART
COM#
as before.(baud)
, Insert the baud rate (without parenthesis). 115200 is a good baud rate, but if it does not work, try 9600 0
(that's a zero, not an uppercase o) after --flash_size=detect
is crucial.(firmware)
, insert the full, absolute file location and name for the firmware you just downloaded (esp8266...bin) do not include parenthesis(firmware)
.(firmware)
like so: location\filename
. Be sure to include the file extension.esptool.py --port (port) write_flash 0 (firmware)
10. Reset the device (there's a button labeled RST on the HUZZAH). You are now running MicroPython on your board (hopefully).
Advance to the next tutorial to learn how to interact with MicroPython on your board!