Downlink Data
When adding an MQTT topic for Downlink Data type, the gateway forwards the downlink commands from the MQTT broker to devices or IO interfaces. The downlink format must be JSON and varies based on the wildcard type in the downlink topic.
- Downlink Example for the Topic without Wildcard
-
Example for sending a downlink message to a LoRaWAN® device:
{ "devEUI": "24E124406F079198", //Target device EUI "fPort": 85, //Device application port "data": "/xD/", //Base64 format "confirmed": false //Whether to ask device to send downlink confirmed packet }Example for sending a downlink message to a LoRaWAN® device object:{ "devEUI": "24E124406F079198", //Target device EUI "fPort": 85, //Device application port "object":{"history_enable":1}, //JSON format "confirmed": false //Whether to ask device to send downlink confirmed packet }Example for sending a downlink message to any device object:{ "gatewaySN": "6438F39254820003", //Optional "objectInfo": [ { "objectID": 5, //The ID from Data Forwarding page "objectValue": "1123" } ] }
- Downlink Format for the Topic with Wildcard
- If the MQTT topic contains wildcards, replace these wildcards with actual
values when subscribing to this topic.
Example 1: The topic has wildcard $objectID
Topic example:
If the object ID is 5, send downlink command to topic/eg/downlink/$objectID//eg/downlink/5/:{ "objectValue": "1123" }Example 2: The topic has wildcard $gatewaySN, $devEUI, $deveui, or $deviceIDTopic example:
/eg/downlink/$deviceID/If the device ID is 5, send downlink command to topicExample 3: The topic has wildcard $devEUI or $deveui/eg/downlink/5/:{ "objectInfo": [ { "objectID": 5, //The ID from Data Forwarding page "objectValue": "1123" } ] }Topic example:
/eg/downlink/$deveui/If the device EUI is 24E124527F418093, send downlink command to topic/eg/downlink/24E124527F418093/:{ "fPort": 85, //Device application port "object":{"history_enable":1}, //JSON format "confirmed": false //Whether to ask device to send downlink confirmed packet }