An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        


logo

# RaspberryPi: dht22, vcgencmd, TIG stack, and Docker

1. [Description](#ds)
2. [Getting Started](#gs)
1. [DHT22](#dht22)
2. [Grafana](#grafana)
3. [Contributing](#contributions)

## 1) Description

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).

## 2) Getting Started

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
```

### DHT22

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:


logo

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
```

### Grafana

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**:


logo

Grafana Dashboard for **Raspberry Pi Telemetry**:


logo

## 3) Contributing
Contributions are always welcome!