From d50081010b1c1a32ee5cc1bd3b58a73e1af1f6fd Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sat, 17 Aug 2019 11:02:19 +0200 Subject: [PATCH] Updated with setup, install and configure instructions --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index a409156..6889238 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,35 @@ # esp-stereo-api Using micropython on a esp8266 to create an api endpoint for controlling my stereo + + +# Setup +> Setup is done on MacOS 10.14.3 + +### Flashing the chip with micropython +We need to start by flashing micropython to our esp8266. Download micropython from [http://micropython.org/download#esp8266](http://micropython.org/download#esp8266). +Next we need to install esptool from espressif. This is a python-based, platform independent, utility to communicate with the ORM bootloader in the Espressif ESP8266 & ESP32 chips. There might be other great tools for flashing these chips out there aswell. Check out their [github page](https://github.com/espressif/esptool) for updated installation instructions. + +Now we can flash our chip with the downloaded binary file. First find your esp chip: +`ls /dev/tty.usb*` + +I run esp8266 tool from the source files in a virtualenv, your command might veary slightly: +`env/bin/python3 esptool.py -p /dev/tty.usbserial-1460 write_flash -z 0x0000 ~/firmware-combined.bin` + +Note the `tty.usbserial-1460` device name and the path `../firmware-combined.bin` for the micropython binary. + + +### Install + +Requirements: + - ampy [https://github.com/pycampers/ampy](https://github.com/pycampers/ampy) / `pip install adafruit-ampy` + +Transfer boot script: +``` +$ ampy -p /dev/tty.usbserial-1460 put boot.py +``` + +Again note the `tty.usbeserial-1460` device name. + +### Configure + +Temperary requirement - set PSID and password for network to connect to. Fill in the empty strings `sta_if.connect('', '')` on line 44 in boot.py.