Skip to content

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
}

All MQTT communication uses the following topic patterns:

DirectionDescriptionTopic Pattern
DownlinkCommands sent to the device (devcfg, devwork, app)ife/{env}/device/msgs-down/{deviceId}
UplinkData reported by the device (devdata, app)ife/{env}/device/msgs-up/{deviceId}
  • Environment ({env}): Infrafon_dev
  • Device ID ({deviceId}): 38b8ebe10273
DirectionTopic
Downlinkife/Infrafon_dev/device/msgs-down/38b8ebe10273
Uplinkife/Infrafon_dev/device/msgs-up/38b8ebe10273

Commands sent from the backend to the device. They change settings, request data, trigger actions, and push widget updates.

TopicDescriptionPage
Device ConfigSet persistent parameters (devcfg)Downlink → dev-config
Device WorkFire-and-forget actions (devwork)Downlink → dev-work
AppWidget 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.

TopicDescriptionPage
Device DataDynamic values reported by the device (devdata)Uplink → dev-data
AppWidget value changes and user interactions (app)Uplink → app