Status Request / Status Response
Messages of types status_request
and status_response
are intended to be used as information messages about device battery status and RF parameters.
Status messages are implementing LoRaWAN MAC-command DevStatusReq
/ DevStatusAns
functionality.
To retrieve device status using DevStatusReq, you should perform the following steps:
- The AS sends a
status_request
message to the NS. - The NS retrieves information from the device and sends it through a
status_response
message to the AS.
Let's walk through the sequence diagram to understand how the status message flow works:
This is what the sequence looks like:
- The AS sends a
status_request
message to the NS. - The NS sends a downlink with
DevStatusReq
a MAC command to the device. - The NS receives an uplink with
DevStatusAns
a MAC command from the device. - The NS creates a
status_response
message for the AS and sends it.
Status Request
Status request - this is a message of type status_request
, that was sent from the AS to the NS.
Metadata
You should specify the following fields of status_request
message metadata before sending it:
device
- device identifier (dev_eui)network
- network identifier that this device belongs to
It is possible to specify a gateway
as an option to ask the NS downlink optimization engine to use a specific gateway to send downlink message. If this gateway is not active, then the request will not be sent.
Params
There are no parameters in this message.
Example
{
"meta": {
"network": "1a3f34a3",
"device": "ba27356cb8a25961"
},
"type": "status_request"
}
Status Response
Status response - this is a message of type status_response
, that is sent form the NS to the AS.
Params
Name | Description |
---|---|
battery | float, Device battery level: 1-254 (0=external power source, 255=unknown), required |
snr | float, Signal-to-noise ratio in dB rounded to the nearest integer value for the last successfully received packet, required |
rx_time | float, time in unixtime, when gateway received this packet, required |
Example
{
"meta": {
"network": "1a3f34a3",
"packet_hash": "5e99eb9640ea76257911d3ebeb525b07",
"application": "64649e06824532c7",
"device_addr": "ac1ffea9",
"time": 1504638907.180523,
"device": "ba27356cb8a25961",
"packet_id": "1c87b507b5fa4ef0f610d7f1befd593d",
"gateway": "4adc2ea8e5a8fc8f"
},
"params": {
"battery": 254.0,
"snr": 20.0,
"rx_time": 1504638907.171101
},
"type": "status_response"
}