This page explains how to manage your devices with AirVantage when using MQTT.
You may use MQTT for application communication (pushing values to AirVantage and receiving commands or settings). Most of the time you are using one of our bit-pipe modems (HL) or a legacy 3rd party hardware.
In such case, you need to upgrade the firmware and software (Linux or MCU behind the bit-pipe modem) of your device in order to fix security issues, deploy new features … Implementing an OMA-DM or LWM2M stack is seen as overkill for what is a simple command with a URL to send to the MQTT client.
Let’s outline some simple workflows for managing the firmware/software of devices connected using MQTT.
You can use AirVantage to send install and uninstall software commands to your MQTT client. Your application model needs to have the device management actions MQTT_SW_INSTALL and MQTT_SW_UNINSTALL. To install an application you must use the application manager MQTT_SW.
<?xml version="1.0" encoding="ISO-8859-1"?>
<app:application
xmlns:app="http://www.sierrawireless.com/airvantage/application/1.0"
type="com.test.dm.airvantage.app"
name="Software Management with AirVantage"
revision="0.1">
<capabilities>
<communication>
<protocol comm-id="SERIAL" type="MQTT" />
</communication>
<dm>
<action impl="MQTT_SW_INSTALL"/>
<action impl="MQTT_SW_UNINSTALL"/>
</dm>
</capabilities>
<application-manager use="MQTT_SW"/>
</app:application>
For more details about the application model, see: Application model reference .
The AirVantage server sends installation/uninstallation tasks using the {IMEI or SN}/tasks/json topic.
Here’s an example of an install task, using the topic format:
[
{
"uid" : "e87b35c3c2e2417b902277ff9d049d70",
"timestamp" : 1416324560869,
"swinstall" : {
"type":"My Application",
"revision": "1.1",
"url":"https://eu.airvantage.net/devicev4/dl/b79e1772482b4d70a6bca18c461163d2/4e51d63280b6489a90b3a5c6c75d3189/full.bin"
}
},
...
]
The command name is swinstall, the arguments are: the application type and the download URL:
Success and error must be reported in the same way as for other tasks by publishing on {IMEI or SN}/acks/json.
The application type should be unique per device, so if an application with the same application type is already installed, it should be replaced (upgraded) by the new one.
Here’s an example of the swuninstall command:
[
{
"uid" : "e87b35c3c2e2417b902277ff9d049d70",
"timestamp" : 1416324560869,
"swuninstall" : {
"type":"My Application",
}
},
...
]
If an application of the given type is installed, you must uninstall it and report success/failure on {IMEI or SN}/asks/json.
Optionally, the device may expose some data about the installed software to the server for synchronizing.
The data DM.SW should contain the list of installed software separated by “;” like: “MYAPP;MONITORING_APP”
The data DM.SW.VER should contain the list of versions corresponding to the installed software separated by “;” like: “123.5.6;v2-beta
With the MQTT protocol you can use JSON messages to publish and subscribe to device data messages. A list of supported data Fields are listed below:
Data | Type | Description | Data | Type | Description |
---|---|---|---|---|---|
_APN | string limited to 255 char | The APN used by the device | _OPERATOR | string limited to 255 char | The network operator used by the device to communicate |
_BYTES_SENT | long | Number of bytes sent by the device | _PACKETS_SENT | long | Number of packets sent by the device |
_BYTES_RECEIVED | long | Number of bytes received by the device | _PACKETS_RECEIVED | long | Number of packets received by the device |
_CELL_ID | string limited to 255 char | Cell identifier use for the cellular communication | _RSSI | double | The Received signal strength indicator (between -70 and -100) |
_ECIO | double | The signal quality (values between -5 and -15). | _RSSI_LEVEL | string |
The level of RSSI computed from the raw value:
|
_ECIO_LEVEL | string |
The level of Ec/Io computed from the raw value:
|
_RSRP | double | (LTE only) The Reference Signal Received Power (dBm) - in 1⁄10 dBm. |
_ICCID | string limited to 30 char | _RSRP_LEVEL | string |
The level of RSRP computed from the raw value:
|
|
_IP_ADDRESS | string limited to 100 char | The IP Address used by the device to communicate with AirVantage | _RSRQ | double | (LTE only) The Reference Signal Received Quality (dB) - in 1⁄10 dB. |
_LATITUDE | double |
Format: Signed degrees format (DDD.dddd). A latitude with 8 decimal places pinpoints a location to within 1 millimeter,( 1⁄16 inch):
Example: 41.25 |
_RSRQ_LEVEL | string |
The level of RSRQ computed from the raw value:
|
_LONGITUDE | double |
Format: Signed degrees format (DDD.dddd). A longitude with 8 decimal places pinpoints a location to within 1 millimeter,( 1⁄16 inch):
Example: -120.9762 |
_SIM_OPERATOR | string limited to 50 char | The operator which provided the SIM |
_MOBILE_NUMBER | string limited to 30 char | _SIGNAL_BARS |
integer |
|
|
_NETWORK_SERVICE_TYPE | string limited to 255 char |
Type of wireless service the device uses:
|