Skip to main content

Downlink — get maximum data size

Returns how many payload bytes fit into one downlink frame for a device. The limit depends on the data rate (DR): the worse the radio link to the device, the lower the data rate and the fewer bytes fit into a frame. The server takes the DR of the device's last uplink and computes the limit from the device's frequency plan.

Request the limit before sending data: the server rejects a frame above the limit with error 4.

Request and response: max_dl_data_req → max_dl_data_resp.
Access: a low access level token sees the devices of its application and of applications that granted it access; a high access level token sees all devices of the owner.

Request​

Fields not marked as required may be omitted.

FieldTypeDescription
cmdstringmax_dl_data_req
operation_idstringAny string; the server returns it in the response to match the request and the response
devEuistringDevice DevEUI, 16 hex characters. Without it the server returns all available devices that have sent at least one uplink
{
"cmd": "max_dl_data_req",
"operation_id": "abc",
"devEui": "7AA8974136303736"
}

Response​

FieldTypeDescription
cmdstringmax_dl_data_resp
operation_idstringValue from the request
statusuint81 — success, 2 — error
devCountuint32Number of devices in the list
devListarrayDevices: devEui, devAddr and maxDataSize — payload limit, bytes
error_codeuint8Only on error, see below
{
"cmd": "max_dl_data_resp",
"operation_id": "abc",
"status": 1,
"devCount": 1,
"devList": [
{
"devEui": "7AA8974136303736",
"devAddr": "7AA89741",
"maxDataSize": 51
}
]
}

Errors​

error_codeWhat happened
1The device is not found, not available with your token, or has not sent any uplink yet

This response has no error text (error_text).

Good to know​

  • The limit is computed for the data rate of the last uplink. If the device has changed its data rate since then (for example, via ADR), the actual limit at sending time may differ.
  • When sending, you can set the data rate explicitly with the dr field of downlink_data_req — the server then checks the size against it rather than against the last uplink.
  • If the payload does not fit, split it into several frames or send it at a higher data rate.

See also​