The hardware is:
- Raspberry Pi
- DS18B20 for temperature (±0.1°C)
- DHT-22 for Humidity (5% RH accuracy) and temperature (±0.5°C accuracy)
API backend available here here
Check the live version https://logs.tsaklidis.gr
I use the system's cron to run the script and monitor the output. To edit the cron use
crontab -e
And run the script every 5 minutes
*/5 * * * * python ~/send_data.py >> ~/info.log 2>&1
In order to run the fan.py script on each system start, add the file located at src/system/fan.service to the lib folder
# nano /lib/systemd/system/fan.service
The flow is:
graph TD;
DS18B20-->Raspberry;
DHT11-->Raspberry;
Raspberry-->API;
API-->Browser;
I created an API system. You can use it in order to save your data. If you like sql + php version use the code on master.
TODO:
- On data loss, save all the data saved to pickle file
If you have any questions or problems running the scripts just contact me.