ESP8266 driven weather station with a Flask webserver frontend and Influx/Grafana plotting.
 
 
 
 
Go to file
Gabe Shaughnessy 62bf75ba16
Merge pull request #8 from gshau/dependabot/pip/app/werkzeug-2.2.3
Bump werkzeug from 0.15.3 to 2.2.3 in /app
2023-06-05 09:06:19 -05:00
Grafana Updated screenshots and documentation 2017-06-11 16:56:47 -05:00
app Merge pull request #8 from gshau/dependabot/pip/app/werkzeug-2.2.3 2023-06-05 09:06:19 -05:00
esp8266 Initial commit 2016-09-28 11:31:38 -05:00
screenshots Updated screenshots and documentation 2017-06-11 16:56:47 -05:00
.gitignore Updated screenshots and documentation 2017-06-11 16:56:47 -05:00
README.md Updated docs 2017-06-11 17:04:12 -05:00

README.md

ESP8266 driven weather station with a Flask webserver frontend and Influx/Grafana plotting.

There are two main components to this project. The device source in esp8266/ and the webserver in app/. Data on device can be accessed directly via:
http://deviceIP. Additionally, a Grafana and Influx server can be configured to display historical data and is highly configurable.

Device configuration

For debugging purposes, the device can have firmware uploaded directly from the webpage. It's recommended that after deployment, this feature be removed for security.

I'd recommend platformio for compiling and distributing the esp8266 source to devices. Alt text

Flask frontend

Flask and SocketIO frontend to weather station. It can accept multiple stations simultaneously.

To setup:

pip -r requirements

To run: Run station receiver that pushes socketIO packets to flask webserver which also posts the data to an Influx database server. You'll need to change the database server if it's not the localhost:

python stationServerInfluxDB.py

In this file, you'll need to specify the Influx server and create a database on it named StationDB.

Run flask webserver that listens for SocketIO packets:

python app.py

Webpage will be located at and will update when packet is received from stations http://localhost:5000/

Alt text

Influx and Grafana configuration

I'd recommend installing Influx and Grafana via docker for minimal headache. Install docker here: https://www.docker.com/

###InfluxDB setup: Pull down the influxdb docker images:

docker pull influxdb

Then run the image as a container named influx. The port forwarding is done from the container to your local machine.

docker run -d --name influx -p 8086:8086 -p 8083:8083 -v /local/machine/path/to/db:/var/lib/influxdb -e INFLUXDB_ADMIN_ENABLED=true influxdb

Navigate to http://localhost:8083 and create a database with name StationDB

###Grafana setup: As with Influx, pull down the docker image for grafana:

docker pull grafana/grafana
docker run -d --name grafana -p 3000:3000 grafana/grafana

Navigate to http://localhost:3000 and start creating Grafana dashboards for plotting and monitoring your data.

An example json file of a sample dashboard is given in Grafana/sample.json

Alt text