martabal / DHT-Raspberry-Docker

Monitor temperature and humidity with your Raspberry and Grafana

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DHT_Raspberry

Monitor temperature and humidity with your Raspberry, dockers and Grafana

1. Connect your DHT with your Raspberry pi with GPIO

Connect gnd, 3.3V and GPIO4

2. Edit temperatureloop.sh

Edit temperatureloop.sh with sudo nano temperatureloop.sh and change /YOUR/PATH/

3. Execute python script on your Raspberry pi

Copy temperature.py and temperatureloops.sh on your raspberry pi and execute temperatureloop.sh on background.

(Edit DHT11 h,t = adht.read_retry(adht.DHT11, 4) if you use another DHT).

You can also use script/temp/notelegraf.py where telegraf is not required. You have to edit notelegraf.py to match your influxdb settings. You have to create a databse in influxdb.

4. Create a docker-compose.yml file

Copy docker-compose.yml change paths with yours and start docker-compose with sudo docker-compose up

5. Configure a data-source in grafana

Click on "Add data source" put your Raspberry pi URL and your Database name (temperature in appadata/Telegraf/telegraf.conf)

6. Import my Grafana dashboard

Go on the side menu on Grafana, then Create and click on import. Copy dashboard.json and paste it in the "Import via panel json" section then Load

7. Enjoy!

Use MQTT

1. Edit script/mqtt.py

Edit USERNAME, PASSWORD, PORT with the right informations of your mqtt server

Add script/mqtt.py to your crontab

About

Monitor temperature and humidity with your Raspberry and Grafana

License:GNU General Public License v3.0


Languages

Language:Python 91.8%Language:Shell 8.2%