Giter Site home page Giter Site logo

sl-he / wxserver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gshau/wxserver

0.0 1.0 0.0 572 KB

An ESP8266 weather station with a Flask webserver frontend, Influx archiving and Grafana plotting

Python 7.31% CSS 0.07% HTML 21.67% C++ 70.69% C 0.26%

wxserver's Introduction

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

wxserver's People

Contributors

dependabot[bot] avatar gshau avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.