MQTT Device Connectivity
How devices connect to Beacon Tower via MQTT — from first boot to live telemetry.
Architecture
Devices connect to the tenant's MQTT broker. The broker handles the transport: TLS, authentication, and which topics each device may use. Behind it, the platform takes telemetry and reported properties into the ingress pipeline, and sends desired properties and commands back to the device through the broker.
Connection Lifecycle
A device goes through these stages to start sending data:
1. Credentials
Before a device can connect, it needs its broker host, port and credentials. How it gets them depends on its onboarding tier:
- Tier 0 — the operator loads them onto the device.
- Tier 1 and 2 — the device fetches them from onboarding. See Onboarding flows.
2. MQTT Connection
With credentials in hand, the device connects to the MQTT broker over TLS, by the broker's host name. Every tenant on an environment shares one public IP and the same ports, and the TLS server name (SNI) is what routes a connection to this tenant's broker.
The parameters (host, port, SNI, keepalive, username, password, client id, clean session) are in Connection Parameters.
3. Publish and Subscribe
Once connected, the device publishes telemetry and reported properties, and subscribes to desired
properties and command invocations, all under device/{deviceId}/. It may use only its own five
topics.
The topic tree, payloads and QoS are in Topic Structure, and the topic permissions in Access Control.
What Happens to Telemetry
When a device publishes to device/{deviceId}/telemetry, the broker authenticates the device and
delivers the message to the platform. The ingress pipeline parses the payload and routes each signal
to its asset, which passes it to flows and stores it as time series.
This pipeline is described in detail in Telemetry Ingestion.
Connection Status
Whether a device is connected, and why it last disconnected, is read from its provider:
curl "https://api.beacontower.ai/providers/mqtt/clients/temp-sensor-001/diagnostics" \
-H "Authorization: Bearer $TOKEN"
{
"providerClientId": "temp-sensor-001",
"tracksConnections": true,
"isConnected": false,
"lastConnectedAt": "2026-11-29T17:00:24.9478736Z",
"lastDisconnectedAt": "2026-11-29T17:01:29.1609697Z",
"lastDisconnectReason": "connection-lost",
"lastRejectedAt": "2026-11-20T00:41:13.0844942Z",
"lastRejectionReason": "auth backend unavailable",
"lastSeenAt": "2026-11-29T17:01:29.1609697Z",
"flapping": false,
"remoteAddress": "10.42.0.29",
"protocolVersion": "4",
"providerSpecific": { "broker": "mosquitto" }
}
| Field | Description |
|---|---|
tracksConnections | Whether the provider knows connections at all. false for a provider without connections (for example HTTP); the connection fields are then not meaningful. |
isConnected | Whether the device is connected now. |
lastConnectedAt, lastDisconnectedAt | When the device last connected and disconnected. |
lastDisconnectReason | Why the last connection ended, for example connection-lost. |
lastRejectedAt, lastRejectionReason | When and why the broker last refused a login from the device. |
lastSeenAt | The last activity the provider recorded for the device. |
flapping | true while the device keeps reconnecting: 5 disconnects within 5 minutes; it clears after 10 minutes without one. |
remoteAddress, protocolVersion | The address the device connected from and its MQTT protocol version. |
providerSpecific | Fields that only this provider reports. |
The call answers 404 when the device does not exist and 409 when it exists but is not
provisioned. The web interface shows the same data as the connection status of an asset bound to the
device.
Next Steps
- MQTT Protocol Reference — Connection details, topic formats, payload structure, QoS
- Device Twins — Desired and reported properties via MQTT
- Commands — Invoke commands on connected devices
- Device Onboarding — Enrollment, provisioning, and bootstrap key management
- Onboarding flows — How a device gets its credentials, by tier
- Telemetry Ingestion — How telemetry is parsed and routed inside the platform