-
Notifications
You must be signed in to change notification settings - Fork 2
Data Plane and Message Broker
GiZano edited this page Aug 31, 2026
·
2 revisions
With v1.1.0, QuakeGuard migrated its Data Plane from HTTP/local MQTT to a robust cloud infrastructure.
- Encrypted Transport: Telemetry is transmitted over port 8883 using strict TLS.
-
Authentication: Requires explicit
MQTT_USERNAMEandMQTT_PASSWORD. -
Topic Topology: Anomalies are published to
quakeguard/telemetry.
On the ESP32-C3, the networkTask handles transmission asynchronously:
- Uses
WiFiClientSecure::setInsecure()withPubSubClient. - On
SeismicEventpop, packages JSON and fire-and-forgets to the broker — milliseconds, never starvingsensorTask.
When MQTT is unreachable, the host collects [QG:FB] frames over USB CDC and forwards them to the same ingestion endpoint:
-
Tool:
firmware/tools/serial_bridge.pytails/dev/ttyACM0(or$SERIAL_PORT), filters lines starting with[QG:FB], parses JSON suffix, and POSTs to/readings/withX-API-Key— identical security gates as the MQTT bridge. -
SSRF guard:
_validate_api_url()allows onlyhttp/https, rejects credentials in URL and non-alphanumeric hostnames;parse_frame()returnsNoneon boot-log noise. -
Testability:
--stdinand--dry-runmodes plus a parser smoke test iniot-ci.ymlkeep the bridge testable without hardware.
The backend securely ingests data via mqtt_subscriber.py.
- Uses
paho.mqtt.clientwith secure TLS settings (client.tls_set(cert_reqs=ssl.CERT_REQUIRED)). - Forwards payloads to the internal FastAPI ingestion endpoint (
/readings/) via HTTP POST. - Injects the
X-API-Keyheader, acting as a trusted proxy.
- Previous: Cryptographic Security & Provisioning
- Next: Backend Services & Event Processing
- Back to: Home