A simple IoT weather station built with a wemos d1 mini.
The wemos d1 mini is connected to a HYT939 humidity and temperature sensor. It will connect to a WiFi network, measure, and send data to the web server every couple minutes. The webserver accepts HTTP POST request on /api/entry in the following format:
temp=xx&humidity=xx
The web server stores the entries in a sqlite database. You can use the api at /api/entry or /api/entries to get data in json format or use the web interface.
Example request:
$ curl http://localhost:8080/api/entries
[{"time": 1569840382.546, "temp": 26.03, "humidity": 47.02}, {"time": 1569841008.17, "temp": 27.31, "humidity": 48.04}]| wemos d1 mini | HYT939 |
|---|---|
| 5V | VCC |
| GND | GND |
| D1 | SCL |
| D2 | SDA |
| D0 <-> RST | - |
Make sure you have python2.7 and pip installed and install them by running the following command:
$ cd web
$ pip install -r requirements.txtThe sketches for the microcontroller have some dependencies.
Please install them first:
- ESP8266WiFi - https://github.com/esp8266/Arduino
- ESP8266HTTPClient - https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266HTTPClient
If you are using Platformio you can simply install them with the library manager.
- web.py - Web framework
- axios - Promise based HTTP client for the browser and node.js
- Chart.js - Javascript library for charts
If you have a feature suggestion or a bug to report, feel free to open a pull request or open a new issue.
This project is licensed under the MIT License - see the LICENSE file for details