Introduction
Firmware management:
LoRa network management
Interfaces:
Gateway administration
Support and resources:
Introduction
Firmware management:
LoRa network management
Interfaces:
Gateway administration
Support and resources:
This is an old revision of the document!
An HTTP client is installed on the gateway. It can be used to send frames from end-devices in real time (packets are send as soon as they are received).
Its configuration is available in the Remote HTTP REST tab under the Services menu.
All data transmitted between client and server are encoded in JSON format.
If transmission fails, frames not sent are stored to be send later on. The 100 most recent frames are saved in RAM, the other ones are discarded. Frames are deleted from the RAM once successfully transmitted.
Enable the feature and complete the configuration fields.
Host: Hostname or IP address.
Port: Port.
Path: Destination directory.
rx_data suffix is no more added in URL since version 2.2. You have add it in path if used in your HTTP server configuration.
The examples featured in this guide use the program ncat to simulate an HTTP server.
For testing purposes, you could also use mockable.io.
The gateway will send a POST requests when it receives frames from an end-device. The body of this request will contain the data of the received frames as a JSON string.
The HTTP headers indicate:
Content-Type is set to application/json, meaning that the body of the HTTP POST contains a JSON string.
Accept is also set to application/json, meaning that the server can reply with a JSON string.
The HTTP body contains an rx_data JSON object.
Here is the structure of an RX packet sent over HTTP:
rx_data_id: integer. RX data unique identifier.
end_device_id: string. The mote EUI or DevAddr depending on the activation procedure.
received_time: integer. Unix timestamp.
sequence_number: integer. Sequence number sent by the mote.
port: integer. LoRaWAN port to be used.
radio_id: integer. Radio identifier (range [0;1]).
channel: integer. Channel identifier (range [0;9]).
rssi_dbm: integer. RSSI in dBm.
snr_db: float. LoRa SNR ratio in dB.
frequency_hz: integer. TX central frequency in Hz.
modulation_type: string. Modulation type, either LoRa or FSK.
data_rate: string. Data rate. LoRa, datr is SFxBWy where x represents the spreading. factor (range 7-12 inclusive), and y is the bandwidth in kHz FSK, datr is the FSK bit rate in bps.
coding_rate: string. ECC coding rate. Example: 4/5.
adr: boolean. Adaptative Data rate enable.
payload: string. Base64-encoded payload data.
Here is an example of one RX packet sent by the SPN gateway.ncat, awk and jq are used to illustrate this example:
ncat -lp 12345 | awk '/^\r$/ { body=NR } body && NR > body { print $0 }' | jq -r .
ncat to listen on the TCP port 12345.
awk script discards the HTTP headers and prints the HTTP body.
jq will prettyprint the JSON string on the console.
Output:
$ ncat -lp 8000 | awk '/^\r$/ { body=NR } body && NR > body { print $0 }' | jq -r .
{
"rx_data": {
"rxdata_id": 77,
"end_device_id": "0018B20000000BAA",
"received_time": 1510669226,
"sequence_number": 1,
"port": 1,
"radio_id": 0,
"channel": 1,
"rssi_dbm": -45,
"snr_db": 9.2,
"frequency_hz": 868300000,
"modulation_type": "LORA",
"data_rate": "SF12BW125",
"coding_rate": "4/5",
"adr": 1,
"payload": "nhxICQcQABNRUSYAAA53"
}
}