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.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
jimmy f2419fa7aa Update Readme 1 year ago
config Move configs into folder 1 year ago
mqttinflux Copy from https://git.chch.tech/chchtech/mqtt-influx 1 year ago
uP Renamed to main.py 1 year ago
.gitignore Add config.json 1 year ago
LICENSE Initial commit 1 year ago
README.md Update Readme 1 year ago
docker-compose.yml Add mosquitto config 1 year ago
typology.png Add typology drawing 1 year ago

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.

This is a work in progress and is not suitable for production

Server Setup

This assumes you are using Ubuntu-20.04

Install packages

sudo su -

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-pip nginx mosquitto grafana influxdb python3-certbot-nginx

pip3 install pipenv

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 /