NX NEXXAFire Command Center · MQTT Integration
Technical reference · v1 topic contract
Prepared for device engineering and pilot operations
Nexxa platform reference

MQTT Server Documentation

Connection, authentication, topic, payload, testing, and troubleshooting guidance for Nexxa cellular fire detectors and the Taiwan manufacturer integration team.

MQTT v1 contract TLS 1.2+ Port 8883 Per-device credentials
01 · System path

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.

Fire detectorsensor + modem
SIM / GSM / LTEcellular transport
Internet or private APNnetwork path
MQTT over TLSTCP 8883
EMQXauth + ACL
Go ingestionvalidate + persist
Django / PostgreSQL / RedisAPI + state

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.

02 · Transport

Connection information

The public Nexxa endpoint is mqtt.nexxafire.com. Configure the detector certificate trust and hostname verification for this exact domain.

Canonical domain
mqtt.nexxafire.com
Secure port
8883 / TCP
Protocol
MQTT over TLS
MQTT version
3.1.1 client baseline
TLS minimum
TLS 1.2
Anonymous access
Disabled
  • 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 1883 is 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.
03 · Identity

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

  1. An authorized Nexxa operator registers and provisions the detector.
  2. Nexxa returns a one-time package containing the Device ID, username, password, and topic list through an approved secure channel.
  3. The broker validates the credential and device lifecycle state for every connection.
  4. 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.

04 · Contract

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.

TopicDirectionDevice permissionPurposeRecommended QoS
nexxa/v1/devices/{device_id}/heartbeatDevice → platformPublishPeriodic liveness signal.0
nexxa/v1/devices/{device_id}/telemetryDevice → platformPublishTemperature, smoke, battery, and signal readings.0 or 1
nexxa/v1/devices/{device_id}/alarmDevice → platformPublishFire or detector alarm event.1
nexxa/v1/devices/{device_id}/statusDevice → platformPublishOnline, offline, fault, battery, or normal state.1
nexxa/v1/devices/{device_id}/ackDevice → platformPublishCommand acknowledgement and result.1
nexxa/v1/devices/{device_id}/commandPlatform → deviceSubscribeRemote 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.

05 · Payloads

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.

Envelope
{
  "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

Example only
{
  "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

Example only
{
  "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

Example only · approved test device
{
  "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

Example only
{
  "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

Example only
{
  "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

Implementation envelope · example only
{
  "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.

06 · Onboarding

Device connection process

  1. Register the device. An authorized operator creates the device record using the serial number, model, country, and approved hardware details.
  2. Provision the device. The authenticated provisioning endpoint generates the Device ID and unique password and returns a one-time package.
  3. 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.
  4. Configure cellular transport. Install the approved SIM/GSM/LTE profile or private APN. The detector should not require household Wi-Fi.
  5. Configure MQTT. Set host mqtt.nexxafire.com, port 8883, MQTT 3.1.1, TLS enabled, certificate verification enabled, username equal to Device ID, and the one-time password.
  6. Connect and publish a heartbeat. Publish a valid v1 envelope to the device heartbeat topic. Then publish status online if the firmware contract requires an explicit state update.
  7. 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.
07 · Taiwan integration

Manufacturer setup

For each detector, the Taiwan manufacturer needs the following configuration values from the approved provisioning package:

Detector settingValue to configure
Cellular networkApproved SIM/GSM/LTE profile or private APN supplied by the deployment owner.
MQTT hostmqtt.nexxafire.com
MQTT port8883
MQTT protocolMQTT 3.1.1 baseline
TLSEnabled; TLS 1.2 or higher; validate the public certificate and hostname.
UsernameThe provisioned Device ID, for example <DEVICE_ID>.
PasswordThe unique one-time secret <DEVICE_PASSWORD>, transferred securely.
Client IDnexxa-<DEVICE_ID>
Publish topicsnexxa/v1/devices/<DEVICE_ID>/{heartbeat|telemetry|alarm|status|ack}
Subscribe topicnexxa/v1/devices/<DEVICE_ID>/command

Coordinate physical tests with the Nexxa integration owner and use only an approved test detector.

08 · Smoke tests

Testing with Mosquitto

Set placeholders in a protected shell. Use the operating system trust store or the approved public CA certificate; never use --insecure.

Shell variables
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
openssl s_client \
  -connect "${MQTT_HOST}:${MQTT_PORT}" \
  -servername "${MQTT_HOST}" \
  -CAfile "${CA_CERT_PATH}" </dev/null

Subscribe to the device command topic

Mosquitto
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
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
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

Approved test device only
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.

09 · Controls

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.
10 · Operations

Troubleshooting

SymptomCheck firstExpected remedy
DNS failuregetent 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 timeoutCarrier/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 failureCertificate 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 failureDevice 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 authorizedTopic path, Device ID spelling, direction, and extra path segments.Use only the five device publish topics or the device's own command subscription.
Wrong topicCompare with nexxa/v1/devices/<DEVICE_ID>/<type>.Correct malformed paths such as nexxnexxadevices/...; Go ignores unsupported topic patterns.
Device shown offlineHeartbeat 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 receivedMonitor 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.
11 · Readiness

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
12 · One-minute reference

Quick reference

Domainmqtt.nexxafire.com
Port8883 / TCP
ProtocolMQTT 3.1.1 baseline over TLS
TLSRequired; TLS 1.2+; validate certificate and hostname
AuthenticationPer-device username/password validated by the Nexxa broker
Username formatProvisioned Device ID, e.g. NX-TW-EXAMPLE-001
Main topic prefixnexxa/v1/devices/<DEVICE_ID>/
Command topicnexxa/v1/devices/<DEVICE_ID>/command · platform → device
ACK topicnexxa/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.