MQTT Device Connectivity
How devices connect to Beacon Tower via MQTT — from first boot to live telemetry.
Architecture
The MQTT Provider (beacontower-mqttprovider) is the bridge between MQTT devices and the Beacon Tower platform. It accepts MQTT connections from devices, forwards telemetry to the message queue for processing, manages device twins, and relays commands.
The MQTT Broker handles the MQTT transport (TLS, authentication, ACLs). The MQTT Provider service subscribes to all device topics and bridges messages into the platform.
Connection Lifecycle
A device goes through these stages to start sending data:
1. Onboarding
Before a device can connect, it must be provisioned. Beacon Tower supports two onboarding paths:
- Shared-secret onboarding — Devices receive MQTT username/password credentials via the Onboarding Service
- Certificate-based onboarding — Devices receive X.509 certificates via EST and the Glaze CA, enabling mTLS connections
For shared-secret onboarding:
- An administrator creates an enrollment group with a routing target pointing to the MQTT broker
- The device is registered in the enrollment group
- The device calls
GET /get_settingsto receive its MQTT credentials - The device is provisioned with
POST /provision_device
Provisioning creates four records in the provider database:
- Provider client — device identity with encrypted credentials
- MQTT user — username/password for broker authentication
- MQTT ACL — topic access permissions (
devices/{deviceId}/#) - Device twin — initial empty twin with version counters
2. MQTT Connection
With credentials in hand, the device connects to the MQTT broker:
| Parameter | Value |
|---|---|
| Host | From onboarding response (mqtt_host) |
| Port | From onboarding response (mqtt_port), typically 1883 (TCP) or 8883 (TLS) |
| Username | The device ID |
| Password | The primary key from onboarding |
| Client ID | Any unique string (conventionally the device ID) |
| Clean Session | true |
3. Publish and Subscribe
Once connected, the device communicates via four topic families:
| Topic | Direction | Purpose |
|---|---|---|
devices/{deviceId}/telemetry | Device → Cloud | Sensor readings and metrics |
devices/{deviceId}/twin/reported | Device → Cloud | Device state (firmware version, config) |
devices/{deviceId}/twin/desired | Cloud → Device | Desired configuration from operators |
devices/{deviceId}/methods/{name}/invoke | Cloud → Device | Command invocations |
Each device is ACL-restricted to devices/{deviceId}/# — it cannot see or publish to other devices' topics.
What Happens to Telemetry
When a device publishes to devices/{deviceId}/telemetry:
- The MQTT Broker authenticates and delivers the message
- MQTT Provider receives it via its wildcard subscription
- The message is published to the message queue on topic
telemetry.{providerId}::{deviceId}with headers (messageType,providerId,providerClientId,enqueuedTime) - The ingress pipeline consumes from the queue, parses the payload, and routes individual signals to the corresponding assets
- Assets forward data to flows and persist to the time-series database
This pipeline is described in detail in Telemetry Ingestion.
Performance Characteristics
The MQTT Provider is designed for high-throughput IoT workloads:
- Batched publishing — Messages are batched (256 messages or 50ms window) before publishing to the queue
- Backpressure — A bounded channel (10,000 capacity) drops messages under extreme load rather than consuming unbounded memory
- Pipelined delivery — Queue publishes use fire-all-then-collect-acks for throughput
- Concurrent twin updates — Up to 16 parallel database writes for reported properties
Next Steps
- MQTT Protocol Reference — Connection details, topic formats, payload structure, QoS
- Device Twins — Desired and reported properties via MQTT
- Direct Methods — Invoke commands on connected devices
- Device Onboarding — Enrollment, provisioning, and bootstrap key management
- Certificate Onboarding — EST-based onboarding with X.509 certificates and mTLS
- Telemetry Ingestion — How telemetry is parsed and routed inside the platform