From ed26bdc591ea45870fe9cec4e9e11f21b07ae579 Mon Sep 17 00:00:00 2001 From: jimmy Date: Sat, 29 May 2021 08:56:41 +0000 Subject: [PATCH] Add install instruction. WIP --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b372cb1..6e8d245 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,52 @@ ESP8266 running Micropython collecting temperature humidity and light level. Pushing data to a Mosquito server. A python script to ingest the data into an influx database. Grafana to display the data. -## Install tools +## Server Setup + +This assumes you are using Ubuntu-20.04 + +### Install packages + +`wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -` + +`echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list` + +`wget -qO- https://repos.influxdata.com/influxdb.key | gpg --dearmor > /etc/apt/trusted.gpg.d/influxdb.gpg` + +`export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc)` + +`echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" > /etc/apt/sources.list.d/influxdb.list` + +`sudo apt update` + +`sudo apt install python3-pipenv nginx mosquitto grafana influxdb python3-certbot-nginx` + +### Setup Nginx + + + + + +## Esp8266 Setup + +### Install tools ```pip3 install esptool adafruit-ampy``` -## Download Esp8266 Firmware +### Download Esp8266 Firmware -https://micropython.org/resources/firmware/esp8266-20210418-v1.15.bin \ No newline at end of file +https://micropython.org/resources/firmware/esp8266-20210418-v1.15.bin + +### Install firmware + +```esptool.py --port erase_flash``` + +```esptool.py --port --baud 1000000 write_flash --flash_size=4MB -fm dio 0 /esp8266-20210418-v1.15.bin``` + +### Edit config file + +```cp uP/config.json.sample config.json``` + +### Copy libraries, config and code to esp8266 + +```ampy -p put uP /``` \ No newline at end of file