Collection of articles for working with Multitech devices in LoRaWAN networks.
Default mPower™ LoRaWAN® application and server API implementation for a distributed LoRaWAN network. The application will communicate with the embedded LoRaWAN network server on a MultiTech Conduit® and forward messages to the configured HTTP(S) or MQTT(S) servers. Configuration for a single server can be provided via the mPower WebUI or for multiple servers using the MultiTech Lens® cloud service.
The default application feature allows last mile bi-directional connectivity from the gateway to a cloud application without needing to deploy custom code on each gateway. An existing API can add compatible end-points allowing LoRaWAN uplinks and downlinks to be consumed and produced by the cloud application. MQTT and HTTP are able to push data to remote servers.
It also provides a starting point for those wanting to bring intelligence to the edge by customizing the default application.
The diagram below show the components for a distributed LoRaWAN network using MultiTech hardware and cloud services with a 3rd Party API. The Conduit can be one of server models such as MTCAP, MTCDT or MTCDTIP running the mPower firmware version 5.3.0 or later.
The diagram below shows the messages passed between a LoRaWAN end-device (Dot), LoRaWAN Network Server (Conduit), LoRaWAN Join Server and Application/Network Management Server (Lens) and a 3rd Party API.
In the diagram the Class A Rx1 Offset has been increased to five seconds to allow the HTTPS request to be returned in time for a possible Class A downlink to be scheduled to the end-device. The HTTPS connection adds latency that can extend beyond the default one second Rx1 Delay.
The example API projected should be installed and run on a PC with node.js support installed.
$ npm install
$ node app.js
The application source is located in the mPower file system at /opt/lora/app-connect.py. A custom application can be created and deployed via DeviceHQ to install and run the python script.
A default application can be configured using mPower 5.3.x firmware.
url: server URL
eui: application identifier
options:
server_cert: server certificate
clent_cert: client certicate
apikey: client private key
check_hostname: boolean to verifiy the server hostname
{ "gateways_euis": [ "00-80-00-00-a0-00-0f-4d" ] }
{
"timeout": 20,
"queue_size": 10,
"downlink_query_interval": 30
}
POST /api/v1/lorawan/<APP-EUI>/<GW-UUID>/close
{
"tmst": 2450008103,
"time": "2020-09-16T18:29:35.263610Z",
"tmms": 1284316193263,
"chan": 8,
"rfch": 0,
"freq": 904.6,
"stat": 1,
"modu": "LORA",
"datr": "SF8BW500",
"codr": "4/5",
"lsnr": 10,
"rssi": -66,
"opts": "",
"size": 7,
"fcnt": 27,
"cls": 0,
"port": 1,
"mhdr": "4012233112801b00",
"data": "bWVzc2FnZQ==",
"appeui": "16-ea-76-f6-ab-66-3d-80",
"deveui": "00-80-00-00-00-01-58-34",
"devaddr": "12312312",
"ack": false,
"adr": true,
"gweui": "00-80-00-00-a0-00-0f-4d",
"seqn": 27
}
[
{"deveui":"00-11-22-33-44-55-66-77", "data": "AQ=="}
]
[
{
"tmst": 2450008103,
"time": "2020-09-16T18:29:35.263610Z",
"tmms": 1284316193263,
"chan": 8,
"rfch": 0,
"freq": 904.6,
"stat": 1,
"modu": "LORA",
"datr": "SF8BW500",
"codr": "4/5",
"lsnr": 10,
"rssi": -66,
"opts": "",
"size": 7,
"fcnt": 27,
"cls": 0,
"port": 1,
"mhdr": "4012233112801b00",
"data": "bWVzc2FnZQ==",
"appeui": "16-ea-76-f6-ab-66-3d-80",
"deveui": "00-80-00-00-00-01-58-34",
"devaddr": "12312312",
"ack": false,
"adr": true,
"gweui": "00-80-00-00-a0-00-0f-4d",
"seqn": 27
},
{
"tmst": 2451008103,
"time": "2020-09-16T18:29:36.263610Z",
...
"deveui": "00-80-00-00-00-03-33-34",
"devaddr": "0013FABE",
"ack": false,
"adr": true,
"gweui": "00-80-00-00-a0-00-0f-4d",
"seqn": 894
}
]
[
{"deveui":"00-11-22-33-44-55-66-77", "data": "AQ=="}
]
{
"appeui": "16-ea-76-f6-ab-66-3d-80",
"gweui": "00-80-00-00-a0-00-0f-4d",
"remote": false
}
[
{"deveui":"00-11-22-33-44-55-66-77", "data": "AQ=="}
]