Raspberry Pi monitoring stack with InfluxDB, Telegraf, and Grafana. Includes temperature-based GPIO control with heartbeat monitoring.
flowchart LR
RPI["Raspberry Pi"]
TEL["Telegraf<br/>Metrics Agent"]
INFLUX[("InfluxDB<br/>TSDB")]
GRAF["Grafana<br/>Dashboard"]
TEMP["Temperature<br/>Control"]
GPIO["GPIO 24/23"]
RPI --> TEL
TEL --> INFLUX
INFLUX --> GRAF
RPI --> TEMP
TEMP --> GPIO
TEMP -.health check.-> GRAF
- InfluxDB 2.7 - Time-series database
- Telegraf 1.36 - Metrics collection agent
- Grafana 12.3 - Visualization (Dashboard source)
# Start monitoring stack
docker compose up -d
# Install systemd services (optional)
sudo ./install-services.sh
sudo systemctl start pimon-docker.service
sudo systemctl start pimon-heartbeat.serviceAccess Grafana at http://<pi-ip>:3000 (admin/admin)
python3 temperature_control.py \
--threshold 40.0 \
--pin 24 \
--heartbeat-pin 23 \
--grafana-url http://localhost:3000GPIO 24 activates when CPU exceeds threshold. GPIO 23 provides heartbeat signal.
Default credentials in docker-compose.yaml:
- InfluxDB: admin/adminadmin
- InfluxDB Token:
my-super-secret-auth-token - Grafana: admin/admin
Change these for production use.
# Status
sudo systemctl status pimon-docker.service
sudo systemctl status pimon-heartbeat.service
# Logs
sudo journalctl -u pimon-docker.service -f
sudo journalctl -u pimon-heartbeat.service -f