MQTT Server Documentation
Connection, authentication, topic, payload, testing, and troubleshooting guidance for Nexxa cellular fire detectors and the Taiwan manufacturer integration team.
MQTT server overview
The Nexxa MQTT server is the authenticated message entry point for detectors. A detector sends messages through its own cellular connection; it does not send telemetry or alarms directly to Django and does not depend on household Wi-Fi.
The same MQTT contract is used over public cellular internet or a private APN. PostgreSQL is the durable source of truth; Redis holds current device state and last-seen data.
Connection information
The public Nexxa endpoint is mqtt.nexxafire.com. Configure the detector certificate trust and hostname verification for this exact domain.
- Validate the server certificate and hostname. Never disable certificate verification.
- The current client uses the MQTT 3.1.1 baseline. MQTT 5.0 is not enabled by default; confirm compatibility before enabling it in firmware.
- Port
1883is plaintext MQTT for local development/internal Docker networking only. The production overlay does not expose it publicly. - Production public availability depends on deployment DNS, firewall, certificate renewal, and cellular/APN routing. See the status section before scheduling a physical pilot.
Device authentication
Every detector has an individual Device ID and a unique password. The Device ID is the MQTT username and is also the device namespace in the topic path. Shared device credentials are not permitted.
Device identity
Username format: the provisioned Device ID, for example NX-TW-EXAMPLE-001. Client IDs should follow nexxa-<DEVICE_ID>.
Secret handling
The provisioning password is cryptographically random, shown once, stored only as a secure hash, and transferred through an approved secure channel. Never place it in firmware repositories or documentation.
Provisioning and broker authentication
- An authorized Nexxa operator registers and provisions the detector.
- Nexxa returns a one-time package containing the Device ID, username, password, and topic list through an approved secure channel.
- The broker validates the credential and device lifecycle state for every connection.
- The broker applies device-level topic authorization so each detector can use only its own namespace.
The detector connects only to the MQTT endpoint. Provisioning and operator administration are handled separately by Nexxa.
MQTT topic structure
All device topics follow nexxa/v1/devices/{device_id}/{message_type}. Replace {device_id} with the provisioned identifier exactly; do not add or remove path segments.
| Topic | Direction | Device permission | Purpose | Recommended QoS |
|---|---|---|---|---|
nexxa/v1/devices/{device_id}/heartbeat | Device → platform | Publish | Periodic liveness signal. | 0 |
nexxa/v1/devices/{device_id}/telemetry | Device → platform | Publish | Temperature, smoke, battery, and signal readings. | 0 or 1 |
nexxa/v1/devices/{device_id}/alarm | Device → platform | Publish | Fire or detector alarm event. | 1 |
nexxa/v1/devices/{device_id}/status | Device → platform | Publish | Online, offline, fault, battery, or normal state. | 1 |
nexxa/v1/devices/{device_id}/ack | Device → platform | Publish | Command acknowledgement and result. | 1 |
nexxa/v1/devices/{device_id}/command | Platform → device | Subscribe | Remote command from the command center. | 1 |
Namespace isolation: A device cannot publish to or subscribe to another device's namespace. Topic authorization is applied by the broker for every device connection.
Go ingestion subscriptions
Go subscribes to nexxa/v1/devices/+/telemetry, /alarm, /status, /heartbeat, and /ack. The Go service publishes no device telemetry; the command worker publishes commands and simulated acknowledgements only when the configured command mode permits it.
Message formats
Device-originated messages use the Nexxa v1 JSON envelope. Examples below use fake values only and are not credentials or live device records.
{
"device_id": "NX-TW-EXAMPLE-001",
"message_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-08-24T12:00:00Z",
"type": "telemetry",
"payload": {}
}Required envelope fields: device_id, unique message_id, RFC3339 UTC timestamp, topic-matching type, and an object payload. The message device ID must match the topic.
Heartbeat · device publishes
{
"device_id": "NX-TW-EXAMPLE-001",
"message_id": "550e8400-e29b-41d4-a716-446655440001",
"timestamp": "2026-08-24T12:00:00Z",
"type": "heartbeat",
"payload": {
"uptime_seconds": 86400,
"battery_voltage": 3.6
}
}Telemetry · device publishes
{
"device_id": "NX-TW-EXAMPLE-001",
"message_id": "550e8400-e29b-41d4-a716-446655440002",
"timestamp": "2026-08-24T12:00:05Z",
"type": "telemetry",
"payload": {
"temperature_c": 24.5,
"humidity_percent": 62.0,
"smoke_density": 0.02,
"battery_voltage": 3.6,
"signal_strength_dbm": -65
}
}Fire alarm · device publishes
{
"device_id": "NX-TW-EXAMPLE-001",
"message_id": "550e8400-e29b-41d4-a716-446655440003",
"timestamp": "2026-08-24T12:01:00Z",
"type": "alarm",
"payload": {
"alarm_type": "SMOKE",
"severity": "critical",
"detection_type": "smoke",
"confidence": 0.98,
"location": { "latitude": 5.6037, "longitude": -0.1870 }
}
}Alarm examples can create operational events. Send only with an approved test device and an agreed test window. Supported detection types include smoke, heat, manual, and test.
Status · device publishes
{
"device_id": "NX-TW-EXAMPLE-001",
"message_id": "550e8400-e29b-41d4-a716-446655440004",
"timestamp": "2026-08-24T12:02:00Z",
"type": "status",
"payload": {
"status": "online",
"reason": "boot_complete"
}
}The implementation accepts status or state. Accepted values are online, offline, fault, low_battery, and normal.
ACK · device publishes
{
"device_id": "NX-TW-EXAMPLE-001",
"message_id": "550e8400-e29b-41d4-a716-446655440005",
"timestamp": "2026-08-24T12:03:00Z",
"type": "ack",
"payload": {
"command_id": "cmd-example-001",
"status": "success",
"result": { "self_test": "passed" }
}
}Command · platform publishes, device subscribes
{
"command_id": "cmd-example-001",
"device_id": "NX-TW-EXAMPLE-001",
"timestamp": "2026-08-24T12:03:00Z",
"expires_at": "2026-08-24T12:13:00Z",
"type": "SET_CONFIGURATION",
"payload": {
"heartbeat_interval_seconds": 60
}
}The Go command worker uses command_id, device_id, timestamp, expires_at, type, and payload. Physical command execution is not enabled by the production template until manufacturer capability approval.
Device connection process
- Register the device. An authorized operator creates the device record using the serial number, model, country, and approved hardware details.
- Provision the device. The authenticated provisioning endpoint generates the Device ID and unique password and returns a one-time package.
- Secure the package. Deliver the Device ID, username, and password to the manufacturer through the approved encrypted channel. Never commit or email secrets in plain text.
- Configure cellular transport. Install the approved SIM/GSM/LTE profile or private APN. The detector should not require household Wi-Fi.
- Configure MQTT. Set host
mqtt.nexxafire.com, port8883, MQTT 3.1.1, TLS enabled, certificate verification enabled, username equal to Device ID, and the one-time password. - Connect and publish a heartbeat. Publish a valid v1 envelope to the device heartbeat topic. Then publish status
onlineif the firmware contract requires an explicit state update. - Verify online state. The Nexxa platform validates and persists the envelope, updates the device last-seen state, and displays the resulting state in the authenticated command center.
Manufacturer setup
For each detector, the Taiwan manufacturer needs the following configuration values from the approved provisioning package:
| Detector setting | Value to configure |
|---|---|
| Cellular network | Approved SIM/GSM/LTE profile or private APN supplied by the deployment owner. |
| MQTT host | mqtt.nexxafire.com |
| MQTT port | 8883 |
| MQTT protocol | MQTT 3.1.1 baseline |
| TLS | Enabled; TLS 1.2 or higher; validate the public certificate and hostname. |
| Username | The provisioned Device ID, for example <DEVICE_ID>. |
| Password | The unique one-time secret <DEVICE_PASSWORD>, transferred securely. |
| Client ID | nexxa-<DEVICE_ID> |
| Publish topics | nexxa/v1/devices/<DEVICE_ID>/{heartbeat|telemetry|alarm|status|ack} |
| Subscribe topic | nexxa/v1/devices/<DEVICE_ID>/command |
Coordinate physical tests with the Nexxa integration owner and use only an approved test detector.
Testing with Mosquitto
Set placeholders in a protected shell. Use the operating system trust store or the approved public CA certificate; never use --insecure.
export MQTT_HOST=mqtt.nexxafire.com
export MQTT_PORT=8883
export DEVICE_ID=<DEVICE_ID>
export DEVICE_PASSWORD=<DEVICE_PASSWORD>
export CA_CERT_PATH=<CA_CERT_PATH>
export BASE_TOPIC="nexxa/v1/devices/${DEVICE_ID}"
export CLIENT_ID="nexxa-${DEVICE_ID}"Test TLS and hostname verification
openssl s_client \
-connect "${MQTT_HOST}:${MQTT_PORT}" \
-servername "${MQTT_HOST}" \
-CAfile "${CA_CERT_PATH}" </dev/nullSubscribe to the device command topic
mosquitto_sub \
-h "${MQTT_HOST}" -p "${MQTT_PORT}" \
--cafile "${CA_CERT_PATH}" --tls-version tlsv1.2 \
-i "${CLIENT_ID}-sub" -u "${DEVICE_ID}" -P "${DEVICE_PASSWORD}" \
-q 1 -t "${BASE_TOPIC}/command"Publish a heartbeat
mosquitto_pub \
-h "${MQTT_HOST}" -p "${MQTT_PORT}" \
--cafile "${CA_CERT_PATH}" --tls-version tlsv1.2 \
-i "${CLIENT_ID}-heartbeat" -u "${DEVICE_ID}" -P "${DEVICE_PASSWORD}" \
-q 0 -t "${BASE_TOPIC}/heartbeat" \
-m '{"device_id":"<DEVICE_ID>","message_id":"<UUID>","timestamp":"2026-08-24T12:00:00Z","type":"heartbeat","payload":{"uptime_seconds":10,"battery_voltage":3.6}}'Publish telemetry
mosquitto_pub \
-h "${MQTT_HOST}" -p "${MQTT_PORT}" \
--cafile "${CA_CERT_PATH}" --tls-version tlsv1.2 \
-i "${CLIENT_ID}-telemetry" -u "${DEVICE_ID}" -P "${DEVICE_PASSWORD}" \
-q 1 -t "${BASE_TOPIC}/telemetry" \
-m '{"device_id":"<DEVICE_ID>","message_id":"<UUID>","timestamp":"2026-08-24T12:00:05Z","type":"telemetry","payload":{"temperature_c":24.5,"smoke_density":0.02,"battery_voltage":3.6,"signal_strength_dbm":-65}}'Publish a controlled test alarm
mosquitto_pub \
-h "${MQTT_HOST}" -p "${MQTT_PORT}" \
--cafile "${CA_CERT_PATH}" --tls-version tlsv1.2 \
-i "${CLIENT_ID}-alarm-test" -u "${DEVICE_ID}" -P "${DEVICE_PASSWORD}" \
-q 1 -t "${BASE_TOPIC}/alarm" \
-m '{"device_id":"<DEVICE_ID>","message_id":"<UUID>","timestamp":"2026-08-24T12:01:00Z","type":"alarm","payload":{"alarm_type":"TEST","severity":"warning","detection_type":"test","confidence":1.0}}'A valid alarm is processed as an operational event. Use this command only with an approved test detector and test window.
Security requirements
TLS required
External detectors use TLS on port 8883, with hostname verification and TLS 1.2+; plaintext 1883 is not a production device endpoint.
Credential isolation
Each device has a unique username/password pair. Passwords are hashed in Django and never returned from normal read APIs.
Topic ACLs
The broker applies device-level authorization. A device may publish its own five device topics and subscribe only to its own command topic.
Platform isolation
Ingestion, storage, and command-center services remain behind the broker and are not exposed as detector endpoints.
- Never commit passwords, integration secrets, private keys, certificate account keys, or populated production environment files to Git.
- Never copy a real device password into firmware source, tickets, screenshots, browser storage, or this documentation.
- Never use a device credential to access another device's topic namespace.
- Do not expose platform administration, databases, monitoring, or plaintext MQTT to detector networks.
Troubleshooting
| Symptom | Check first | Expected remedy |
|---|---|---|
| DNS failure | getent hosts mqtt.nexxafire.com or the carrier DNS path. | Use the canonical hostname. Confirm the deployment A/AAAA record; do not silently switch to an IP because TLS hostname verification will fail. |
| Connection timeout | Carrier/APN route, server firewall, and inbound TCP 8883. | Confirm public MQTT deployment is active. Port 1883 is not a fallback for an external device. |
| TLS certificate failure | Certificate SAN, expiry, CA trust, system clock, and SNI hostname. | Use mqtt.nexxafire.com and a trusted public CA. Never disable verification or use a private key as a CA file. |
| Authentication failure | Device is provisioned; username is exact Device ID; secret is current; device is not revoked/suspended/retired. | Request a credential check or rotation through the Nexxa integration owner. |
| ACL / not authorized | Topic path, Device ID spelling, direction, and extra path segments. | Use only the five device publish topics or the device's own command subscription. |
| Wrong topic | Compare with nexxa/v1/devices/<DEVICE_ID>/<type>. | Correct malformed paths such as nexxnexxadevices/...; Go ignores unsupported topic patterns. |
| Device shown offline | Heartbeat arrival, valid timestamp, message ID uniqueness, and ingestion logs. | Publish a valid envelope. Accepted messages update last_seen; the current default offline threshold is 300 seconds unless deployment configuration overrides it. |
| Heartbeat not received | Monitor the correct device ID and ask the Nexxa integration owner to check broker and ingestion service health. | Verify TLS and credentials first, then confirm the heartbeat type, topic, matching device_id, RFC3339 timestamp, and object payload. |
Production status
Public connection profile
- Domain:
mqtt.nexxafire.com - Secure MQTT: TCP
8883 - TLS certificate and hostname verification required
- Unique credentials for every detector
Onboarding readiness
- Provisioning package required before connection
- Approved SIM/APN profile required
- Physical detector testing coordinated with Nexxa
- Use the testing commands in this guide
Quick reference
| Domain | mqtt.nexxafire.com |
|---|---|
| Port | 8883 / TCP |
| Protocol | MQTT 3.1.1 baseline over TLS |
| TLS | Required; TLS 1.2+; validate certificate and hostname |
| Authentication | Per-device username/password validated by the Nexxa broker |
| Username format | Provisioned Device ID, e.g. NX-TW-EXAMPLE-001 |
| Main topic prefix | nexxa/v1/devices/<DEVICE_ID>/ |
| Command topic | nexxa/v1/devices/<DEVICE_ID>/command · platform → device |
| ACK topic | nexxa/v1/devices/<DEVICE_ID>/ack · device → platform |
Keep this reference with the approved Nexxa device integration package. Example values are fictional and must be replaced only by the secure provisioning process.