https://github.com/razielar/raspberrypi_dht22_tig
RasperryPi: DHT22 and vcgencmd using the TIG stack (Telegraf-Influxdb-Grafana) and Docker
https://github.com/razielar/raspberrypi_dht22_tig
Last synced: 3 months ago
JSON representation
RasperryPi: DHT22 and vcgencmd using the TIG stack (Telegraf-Influxdb-Grafana) and Docker
- Host: GitHub
- URL: https://github.com/razielar/raspberrypi_dht22_tig
- Owner: razielar
- License: mit
- Created: 2023-10-28T09:17:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-23T15:21:15.000Z (over 1 year ago)
- Last Synced: 2025-01-11T14:48:36.227Z (4 months ago)
- Language: Python
- Homepage: https://medium.com/@razielar/dockerizing-climate-telemetry-ac453891196d
- Size: 1.56 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# RaspberryPi: dht22, vcgencmd, TIG stack, and Docker
1. [Description](#ds)
2. [Getting Started](#gs)
1. [DHT22](#dht22)
2. [Grafana](#grafana)
3. [Contributing](#contributions)Monitor the temperature and humidity through the *DHT22 sensor* and Raspberry pi, using the TIG stack (Telegraf, Influxdb, Grafana) all with Docker and Docker-compose. Additionally, monitor telemetry data, and custom Raspberry Pi data using the stdout of `vcgencmd`.
Further description can be found on my [Medium post](https://medium.com/@razielar/dockerizing-climate-telemetry-ac453891196d).
Clone the repo
```bash
git clone https://github.com/razielar/raspberrypi_dht22_tig.git
```You must change the environment variables placed in `.env`, replace all **** with your desired variables
```bash
├── vcgencmd/
├── .env <---
├── .gitignore
├── LICENSE
└── ...
```Start the service
```bash
docker-compose up --build -d
```To capture temperature (by default Celsius, but you can change it on the `.env` file) and humidity readings from the Raspberry Pi, we need to connect the DHT22 sensor (with 3 pins) to the Pi, as shown in the following image:
![]()
If you want to use the GPIO 4 of the Raspberry Pi, you will need to modify the script: `dht22/dht22_vcgencmd.py` as follows:
```python
dhtDevice = adafruit_dht.DHT22(board.D2, use_pulseio=False) # from board.D2 to board.D4
```By default, the username and password for Grafana are `admin` for both cases.
When you connect, Grafana with Influxdb you need to consider two things:
* Query language: `Flux` (optional) but the Grafana dashboards (`grafana_dashboards/`) uses Flux.
* HTTP-URL: `http://influxdb:8086` defined within the `.env` file.Grafana Dashboard for **DHT22 sensor**:
![]()
Grafana Dashboard for **Raspberry Pi Telemetry**:
![]()