← Back to Garden
evergreen ·
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)│
                                           └───────────────────┘
  1. 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.
  2. 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.
  3. Data Ingestion Bridge: Inside the lxc-docker container on Proxmox, a Python script runs as a systemd service. It maintains a persistent subscription to the HiveMQ Cloud topic.
  4. 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-docker LXC.
  5. Visualization: The Grafana instance, running in its own lxc-monitoring container, 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).