MQTT Commands
The CC2 device communicates with the backend over MQTT. All configuration, device data, UI widget updates, and housekeeping actions are sent as JSON payloads on dedicated topics.
Connections are managed through the network defined in your configuration files, with automatic reconnect and timeout handling.
// Every MQTT message (downlink or uplink) uses this top-level structure.// Include only the sections you need — empty objects can be omitted.{ "devcfg": {}, // configure device behaviour "devdata": {}, // request or report device data "devwork": [], // one-shot housekeeping actions "app": {} // widget data and UI actions}Commands sent from the backend to the device. They change settings, request data, trigger actions, and push widget updates.
Topic Description Page Device Config Set persistent parameters (devcfg) Downlink → dev-config Device Work Fire-and-forget actions (devwork) Downlink → dev-work App Widget data and UI actions (app) Downlink → app
Data sent from the device to the backend. The device reports state, sensor readings, alert status, and app/widget events.
Topic Description Page Device Data Dynamic values reported by the device (devdata) Uplink → dev-data App Widget value changes and user interactions (app) Uplink → app Related Configuration Files — how global.json, allocdata.json, and unallocdata.json define the device setup
Network Setup — WiFi, BLE, LoRa network definitions and connection order
Device States — the full state machine (allocated, unallocated, provisioning, …)
Reference Tables — enums, action shortnames, LED & audio codes, changelog