Status
Message of type status
are intended to be used as an information messages about device battery status and RF parameters.
Status message is implementing LoRaWAN MAC-command DevStatusReq functionality.
To retrieve a device status using DevStatusReq you should perform the following steps:
AS sends
status_request
to NS.NS retreive information from device and send it through
status_response
to AS.
Let's walk through the sequence diagram to understand how status
message works:
This is a sequence:
AS sends status message to NS
NS sends status_request to end device and get status_response
NS creates status message for AS and sends it
Status Request
Status request - this is a message of type status
, that was sent from AS to NS.
Metadata
You should specify the following fields of status
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 NS downlink optimization engine to use a specific gateway to send downlink message. If this gateway is not active then request will not be sent.
Params
There are no parameters in this message.
Example
{
"meta": {
"network": "1a3f34a3",
"device": "ba27356cb8a25961"
},
"type": "status"
}
Status Response
Status response - this is a message of type status
, that is sent form NS to 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"
}