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.
Go to file
jimmy 7e780fdf81 Move configs into folder 2021-05-29 08:57:19 +00:00
config Move configs into folder 2021-05-29 08:57:19 +00:00
mqttinflux Copy from https://git.chch.tech/chchtech/mqtt-influx 2021-05-29 03:13:32 +00:00
uP Renamed to main.py 2021-05-29 14:59:36 +12:00
.gitignore Add config.json 2021-05-29 14:57:40 +12:00
LICENSE Initial commit 2021-02-16 09:34:03 +00:00
README.md Add install instruction. WIP 2021-05-29 08:56:41 +00:00
docker-compose.yml Add mosquitto config 2021-03-28 22:03:30 +13:00
mosquitto.conf Add mosquitto config 2021-03-28 22:03:30 +13:00
typology.png Add typology drawing 2021-05-11 21:26:39 +12:00

README.md

Datalogger

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.

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

https://micropython.org/resources/firmware/esp8266-20210418-v1.15.bin

Install firmware

esptool.py --port <port> erase_flash

esptool.py --port <port> --baud 1000000 write_flash --flash_size=4MB -fm dio 0 <download_folder>/esp8266-20210418-v1.15.bin

Edit config file

cp uP/config.json.sample config.json

Copy libraries, config and code to esp8266

ampy -p <port> put uP /