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.
| Field | Type | Description |
|---|---|---|
cmd | string | max_dl_data_req |
operation_id | string | Any string; the server returns it in the response to match the request and the response |
devEui | string | Device 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
| Field | Type | Description |
|---|---|---|
cmd | string | max_dl_data_resp |
operation_id | string | Value from the request |
status | uint8 | 1 — success, 2 — error |
devCount | uint32 | Number of devices in the list |
devList | array | Devices: devEui, devAddr and maxDataSize — payload limit, bytes |
error_code | uint8 | Only 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_code | What happened |
|---|---|
| 1 | The 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
drfield ofdownlink_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
- Sending data to a device — how downlink works and in which order to call the commands.
- Frequency plans — channels, data rates and RX2 window parameters for each plan.