Collection of articles for working with Multitech devices in LoRaWAN networks.
url: mqtts://test.mosquitto.org:8883
eui: filter end-devices joined to AppNet EUI
encodeHex: encode payloads to and from hex instead of default base64
options:
check_hostname: enable hostname check for tls connection
client_id: client id
server_cert: server certificate
client_cert: client certicate
apikey: client private key
username: MQTT username
password: MQTT password
uplinkTopic: override topic for uplinks to publish to
downlinkTopic: override topic to subscribe to for downlinks
overrideTopicsForAllApps: use custom topics for all apps
requestOptions:
api: enable api requests
log: enable log requests
lora: enable lora query requests
backhaulDetect:
enabled: turn backhaul detect messages on/off
payload: hex payload of downlink packet to send to end-device when backhaul is down
port: port to send downlink packet to end-device
timeout: scheduling timeout limit the number of downlinks scheduled, default one per 5 minutes
AWS provides configuration for MQTT connections and topic based security and routing. The following MQTT topics can be configured in AWS policies. TLS Certificates and Keys are used to authenticate the AWS connection.
lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/init
{
"gateways_euis": ["00-80-00-00-d0-00-01-1a", "00-80-00-00-d0-00-01-ff"],
"time": "2023-03-04T23:08:26.021832Z",
"api_version": "1.0"
}
or
{
"gateways_euis": ["00-80-00-00-d0-00-01-1a", "00-80-00-00-d0-00-01-ff"],
"time": "2023-03-04T23:08:26.021832Z"
}
lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/close (null)
lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/disconnected (null)
lorawan/8b-6c-f0-8e-ee-df-1b-b6/00-80-00-ff-ff-00-00-03/up
{
"jver": 1,
"tmst": 561224395,
"time": "2023-03-04T23:14:39.522787Z",
"tmms": 1362006897523,
"chan": 6,
"rfch": 1,
"freq": 903.5,
"mid": 8,
"stat": 1,
"modu": "LORA",
"datr": "SF9BW125",
"codr": "4/5",
"rssis": -14,
"lsnr": 9.2,
"foff": -2769,
"rssi": -13,
"opts": "03070307",
"size": 8,
"fcnt": 1,
"cls": 0,
"port": 33,
"mhdr": "80cb80d000840100",
"data": "dGVzdGRhdGE=",
"appeui": "8b-6c-f0-8e-ee-df-1b-b6",
"deveui": "00-80-00-ff-ff-00-00-03",
"joineui": "16-ea-76-f6-ab-66-3d-80",
"name": "JSR-DEBIAN-PC-DOT2",
"devaddr": "00d080cb",
"ack": false,
"adr": true,
"gweui": "00-80-00-00-d0-00-01-ff",
"seqn": 1
}
lorawan/8b-6c-f0-8e-ee-df-1b-b6/00-80-00-ff-ff-00-00-03/joined
{
"joineui": "16-ea-76-f6-ab-66-3d-80",
"name": "JSR-DEBIAN-PC-DOT2",
"appeui": "8b-6c-f0-8e-ee-df-1b-b6",
"gweui": "00-80-00-00-d0-00-01-ff",
"remote": true,
"time": "2023-03-04T23:07:11.360064Z"
}
lorawan/029998E06156CDD44523264B523115C1/00-80-00-ff-ff-00-00-03/joined
{
"joineui": "16-ea-76-f6-ab-66-3d-80",
"name": "JSR-DEBIAN-PC-DOT2",
"appeui": "8b-6c-f0-8e-ee-df-1b-b6",
"gweui": "00-80-00-00-d0-00-01-ff",
"remote": true,
"time": "2023-03-04T23:07:11.360064Z"
}
["00-80-00-0d-00-00-00-01"]
Subscribed topics allow communication to the gateway to issue downlinks, clear a downlink queue or request info.
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/00-80-00-ff-ff-00-00-03/clear -m ""
Request ID
The “rid” field can be added to app-connnect lora_query, api_query and log_query requests and will be added to the response json to correlate the response to the request message in releases after mPower 6.3.0.
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/lora_req -m '{"command":"device count"}'
or in releases after mPower 6.3.0 “rid” is an optional field
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/lora_req -m '{"command":"device count","rid":1}'
lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/lora_res
{
"count" : 9
}
or in releases after mPower 6.3.0
{
"rid": 1,
"result":
{
"count" : 9
}
}
or
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/lora_req -m $'{"command": "packet queue add \'{\\\"deveui\\\":\\\"00-80-00-ff-00-00-00-03\\\",\\\"data\\\": \\\"QA==\\\"}\'", "rid": 4}'
lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/lora_res
{
"id":470,
"status":"success"
}
or in releases after mPower 6.3.0 with optional “rid” field, command is moved to “result” field to be consistent with other message responses.
{
"rid": 4,
"result":
{
"id":470,
"status":"success"
}
}
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/lora_req -m '{"command":"device list json page 0"}'
lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/lora_res
[{
"class" : "A",
"created_at" : "2022-12-27T19:40:37Z",
"deveui" : "00-80-00-00-04-00-59-04",
"device_profile_id" : 0,
"device_profile_updated_at" : "2022-12-27T19:40:37Z",
"firmware_version" : "",
"hardware_version" : "",
"last_app_nonce" : 9,
"last_nonce" : 14,
"last_seen" : "",
"name" : "",
"network_profile_id" : 1,
"network_profile_updated_at" : "2022-12-27T19:40:37Z",
"product_id" : "",
"rejoin_count" : 0,
"serial_number" : "",
"tags" : ""
}]
or in releases after mPower 6.3.0 with optional “rid” field, response is moved to “result” field to be consistent with other message responses.
{
"rid": 1,
"result":
[{
"class" : "A",
"created_at" : "2022-12-27T19:40:37Z",
"deveui" : "00-80-00-00-04-00-59-04",
"device_profile_id" : 0,
"device_profile_updated_at" : "2022-12-27T19:40:37Z",
"firmware_version" : "",
"hardware_version" : "",
"last_app_nonce" : 9,
"last_nonce" : 14,
"last_seen" : "",
"name" : "",
"network_profile_id" : 1,
"network_profile_updated_at" : "2022-12-27T19:40:37Z",
"product_id" : "",
"rejoin_count" : 0,
"serial_number" : "",
"tags" : ""
}]
}
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/log_req -m '{"file":"/var/log/messages","lines":100}'
or in releases after mPower 6.3.0 “rid” is an optional field
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/log_req -m '{"file":"/var/log/messages","lines":100,"rid":1}'
lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/log_res
{
"result": "2023-03-05T19:55:56.913366+00:00 mtcdt lora-app-connect: Call setup MQTT App\n2023-03-05T19:55:56.934340+00:00 mtcdt lora-app-connect: Setup MQTT App\n2023-03-05T19:55:57.014137+00:00 mtcdt lora-app-connect: MQTT connect mqtt://172.16.0.222:1883\n2023-03-05T19:55:59.985408+00:00 mtcdt lora-app-connect: Start client\n2023-03-05T19:56:00.039355+00:00 mtcdt lora-app..."
}
or in releases after mPower 6.3.0 with optional “rid” field
{
"rid": 1,
"result": "2023-03-05T19:55:56.913366+00:00 mtcdt lora-app-connect: Call setup MQTT App\n2023-03-05T19:55:56.934340+00:00 mtcdt lora-app-connect: Setup MQTT App\n2023-03-05T19:55:57.014137+00:00 mtcdt lora-app-connect: MQTT connect mqtt://172.16.0.222:1883\n2023-03-05T19:55:59.985408+00:00 mtcdt lora-app-connect: Start client\n2023-03-05T19:56:00.039355+00:00 mtcdt lora-app..."
}
API Requests can get or change any configuration settings, restart services or reboot the gateway
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/api_req -m '{"method":"GET","path":"/api/loraNetwork","body":""}'
or in releases after mPower 6.3.0 “rid” is an optional field
$ mosquitto_pub -t lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/api_req -m '{"method":"GET","path":"/api/loraNetwork","body":"","rid":1}'
lorawan/8b-6c-f0-8e-ee-df-1b-b6/029998E06156CDD44523264B523115C1/api_res
{
"code" : 200,
"result" :
{
"__v" : 1,
"addressRange" :
{
"end" : "FF:FF:FF:FE",
…
},
…
}
}
or in releases after mPower 6.3.0 with optional “rid” field
{
"rid": 1,
"code" : 200,
"result" :
{
"__v" : 1,
"addressRange" :
{
"end" : "FF:FF:FF:FE",
…
},
…
}
}
{
"method": "PUT",
"path": "/api/loraNetwork/lora",
"body": "{\"channelPlan\":\"US915\"}"
}
{
"method": "GET",
"path": "/api/loraNetwork/whitelist/devices",
"body": ""
}
{
"method": "POST",
"path": "/api/loraNetwork/whitelist/devices",
"body": "{\"deveui\": \"00800000FFFF0001\",\"appeui\": \"0080000000000017\",\"appkey\": \"00800000FFFF000100800000FFFF0001\",\"class\": \"A\"}"
}
{
"method": "DELETE",
"path": "/api/loraNetwork/whitelist/devices/0",
"body": ""
}
Or
{
"method": "DELETE",
"path": "/api/loraNetwork/whitelist/devices/00800000FFFF0001",
"body": ""
}
{
"method":"POST",
"path":"/api/lora/restart",
"body":""
}
Enable - enable/disable the local app settings