Downlink using MQTT

Prev Next

If connected to our MQ Broker, a downlink can be sent to a sensor using MQTT and response will be sent back over MQTT. If a request times out, the message will be dropped.

Topics

The request should be sent to the topic “downlink” (just that, nothing more). The response will be received on a topic similar to the payload:

Format

Downlink Request

{
	"devEui": "string (mandatory)",
	"payloadHex": "string (hex, mandatory)",
	"fPort": "string (integer, mandatory)",
	"requestId": "string (optional)",
    "validity": "string (seconds, ttl, mandatory on some LNS)",
}

 if validity is set the downlink will be discarded after this number of seconds.

Examples

Downlink Request

{
	"devEui": "70B3D52A1FF00001",
	"payloadHex": "8303",
	"fPort": "1",
	"requestId": "MyRequestId-123",
    "validity": "300"
}

Downlink Response 1a – queued for sending to the sensor

{
	"requestId": "MyRequestId-123",
	"deliveryStatus": "QUEUED",
	"devEui": "70B3D52A1FF00001"
}

Downlink Response 1b – invalid request

{
	"requestId": "MyRequestId-123",
	"deliveryStatus": "ERROR_SENDING",
	"devEui": "70B3D52A1FF00001",
	"errorCode": "PAYLOAD_MISSING",
	"errorDescription": "Payload can't be empty"
}

Downlink Response 2 – downlink is sent over the air

{
	"requestId": "MyRequestId-123",
	"deliveryStatus": "DOWNLINK_SENT",
	"devEui": "70B3D52A1FF00001"
}

Types

Delivery Statuses

Code

QUEUED

ERROR_SENDING

DOWNLINK_SENT

Error Codes

Code

Explanation

FPORT_MISSING

FPort can't be empty

FPORT_INVALID

FPort must be an integer

PAYLOAD_MISSING

Payload can't be empty

SENSOR_NOT_PROVISIONED

Sensor not provisioned

VALIDITY_MISSING

Validity can't be empty for this LNS

VALIDITY_INVALID

Validity must be an integer