Device data and configuration

The schemas referenced on this page define the data format used by the device to encode data. Currently, JSON is the only supported encoding format.

While the schemas mark properties as required, the device can always send partial updates. For example, the device might initially report the full roaming information after boot, but later only send the changed values, for example Reference Signal Received Power (RSRP), to the cloud to conserve data and power. It is the responsibility of the cloud to store the updates in a way that full objects can be constructed from partial updates.

Sending and receiving data is different for each cloud operator.

AWS

The data published by the device and the configuration options are described in detail in the state JSON schema file for AWS. See the state JSON document for an AWS example.

See AWS IoT Device Shadow service and MQTT topics for the implementation details for AWS.

Azure

The data published by the device and the configuration options are described in detail in the state JSON schema file for Azure. See the state JSON document for an Azure example.

See Azure IoT Shadow and topics for the implementation details for AWS.

Comparing state with messages

Most of the data is stored in the digital twin of the device. This is useful for a quick query of the last known data from the device. However, some data does not fit well into this model because of its ephemeral nature. For example, button pushes are sent as messages and are not stored in the digital twin. Button is a UI element and in the case of push buttons, there is no state, which could be restored on the device or a state that persists over a longer time.

The messages published by the device are described in detail in the messages JSON schema file. See the messages JSON document for an example message.

The network survey is another piece of data that is not stored in the digital twin of the device. It is published through a separate topic, because depending on the cloud platform, its size can exceed the allowed size of the digital twin document. The network survey published by the device is described in detail in the network survey JSON schema file. See the network survey JSON document for an example report.

A-GNSS and P-GPS data

Using nRF Cloud Location Services, the device can request A-GNSS and P-GPS data through MQTT.

The A-GNSS message published by the device is described in detail in the A-GNSS JSON schema file. See the A-GNSS request JSON document for an example request. The cloud publishes the requested types as binary to the <device Id>/agnss topic. If the device requests ephemerides (type 2), this message is too large to combine with other types and will be published in a separate message.

The P-GPS message published by the device is described in the P-GPS request JSON schema file. See the P-GPS request JSON document for an example request. The cloud publishes a link to the data to the <device Id>/pgps topic in the format described in detail in the P-GPS response JSON schema file. See the P-GPS response JSON document for an example response. The device can then use HTTP or HTTPS to download the P-GPS data.

Batch data

The firmware may send data as batch, using the schema that is described in the JSON schema file. See the JSON document for an example batch message.

For sending batched data from the device, the topic <deviceId>/batch is used.