iot
architecture
mqtt
timescaledb
grafana
esp32
proxmox
TSI-Telemetry Application Architecture
The homelab's primary function is to serve as the backend for the TSI-Telemetry project. This document details the end-to-end data flow for that application.
(In Car) (Cloud) (Your Homelab on Proxmox)
┌───────┐ ESP-NOW ┌──────────┐ WiFi/TLS ┌────────────┐
│ ESP32 │────────►───┤ ESP32 #2 ├───────►──────┤ HiveMQ Cloud │
│ (OBD) │ │ (MQTT) │ └──────┬─────┘
└───────┘ └──────────┘ │ MQTT
│ Subscribe
┌─────────▼─────────┐
│ Python Bridge │
│ (in lxc-docker) │
└─────────┬─────────┘
│ SQL
┌─────────▼─────────┐
│ TimescaleDB │
│ (in lxc-docker) │
└─────────┬─────────┘
│ Query
┌─────────▼─────────┐
│ Grafana │
│(in lxc-monitoring)│
└───────────────────┘
- In-Car Cluster: An "OBD Sender" ESP32 reads data from the car via Bluetooth and sends it to a partner "MQTT Receiver" ESP32 using the ESP-NOW protocol. This dual-device setup avoids WiFi/BLE radio conflicts.
- Cloud Ingestion: The MQTT Receiver ESP32 connects to WiFi and publishes the data via a secure MQTT connection to HiveMQ Cloud. Using a cloud broker solves all NAT traversal issues.
- Data Ingestion Bridge: Inside the
lxc-dockercontainer on Proxmox, a Python script runs as asystemdservice. It maintains a persistent subscription to the HiveMQ Cloud topic. - Database Storage: Upon receiving a message, the Python bridge parses the JSON payload and inserts the data into the TimescaleDB database, which runs in a Docker container within the same
lxc-dockerLXC. - Visualization: The Grafana instance, running in its own
lxc-monitoringcontainer, is configured with TimescaleDB as a data source. It queries the database to populate the real-time dashboard, which is then viewed from the SRE Control Plane (Mac Mini).