Note: This is an obsolete legacy page, superseded by content at Using MQTT with AirVantage
When using the MQTT protocol to connect an embedded application to AirVantage, developers can subscribe to the {IMEI or SN}/errors
MQTT topic, to get notified when a message contains an invalid payload.
Suppose you publish a message on topic {IMEI or SN}/messages/json
with an invalid JSON format:
// Invalid JSON - timestamp should be a string
{ 12346013564 : { "temperature" : 42 } }
The JSON payload is invalid because the timestamp is expected to be a JSON string (format described in AirVantage Reserved topics page).
You can subscribe to {IMEI or SN}/errors
to receive a message, with a payload containing 3 lines in text format (separated by \n
):
With the previous request, you would receive:
{IMEI or SN}/messages/json
{ 12346013564 : { "temperature" : 42 } }
invalid character '1' looking for beginning of object key string
Suppose you publish on {IMEI or SN}/messages/ts
the CBOR corresponding to the following JSON message:
// Invalid CBOR, a timestamp is missing in the sample
{
"h" : [ "x", "y", "z", "lat", "long", , "speed" ],
"f" : [ 0.01, 1, 1 , 1, 1000000, 1000000, 1 ],
"s" : [ 0, 2, 0, 49455177, 537743, 100 ]
}
Format described in MQTT compressed format for time series page.
You can subscribe to {IMEI or SN}/errors
to receive a message, with a payload containing 3 lines of text (separated by \n
):
With the previous request, you would receive:
{IMEI or SN}/messages/tz
[Encoded payload]
Not enough CBOR samples at line 0 ; found 6, expected 7.
See https://doc.airvantage.net/av/reference/hardware/protocols/mqtt-ts/