Copyright Micropelt

MTCAP gateway and access through REST API

 

The Multi-tech MTCAP gateway has a HTTPS REST API available to access the LoRaWAN network server device whitelist (device address including device data and timestamp).

Accessing the Gateway

Requires the respective device credentials, which then gives a token.

Note: The token eventually expires.

Example: https://192.168.10.73/api/login?username=MTCAP4&password=MVA-LoRa

{ "code" : 200, "result" : { "address" : "192.168.10.51", "isipcuser" : false, "isremoteuser" : false, "permission" : "admin", "port" : "49623", "timestamp" : "14:13:48:323", "token" : "F073732291A5C26BF912E80267780A", "user" : "MTCAP4" }, "status" : "success" }

 

Device whitelist

View of all devices that are enabled in the gateway

Example: https://192.168.10.73/api/loraNetwork/whitelist

{    "code" : 200,    "result" : {       "devices" : [          {             "appeui" : "31c209e170312003",             "appkey" : "f9d446b18f7af0431381af028c98998c",             "class" : "A",             "deveui" : "3335313568318a10",             "device_profile_id" : "LW102-OTA-EU868",             "network_profile_id" : "DEFAULT-CLASS-A"          },          {         …          },       ],       "enabled" : true    },    "status" : "success" }

 

Packets view

These include uplink and downlink packets.

Each packet contains the moment at which it was created (timestamp).

Each packet contains a "deveui" field; this matches the label on the back of the device.

For the uplink packets, the contents of the "data" field can be deserialized to be read.

For the downlink packets, the contents of the "data" field can be deserialized to be read.

Example: https://192.168.10.73/api/lora/packets

Result:

{    "code" : 200,    "result" : [       {          "appeui" : "31-c2-09-e1-70-31-20-03",          "coderate" : "4/5",          "commands" : "",          "control" : "00",          "counter" : "00004621",          "created_at" : "2022-01-10T16:38:38Z",          "data" : "ATQ2WkUgiwUGEA==",        "data_size" : 23,          "datarate" : "SF7BW125",          "dev_addr" : "0072a566",          "deveui" : "33-35-31-35-5a-31-87-10",          "direction" : "up",          "frequency" : 868.29998779296875,          "gweui" : "00-80-00-00-00-01-e4-08",          "major_version" : 0,          "message_type" : 4,          "mic" : "f56a347f",          "port" : 1,          "rssi" : -67,          "snr" : 10,          "tmst" : 2338127923,          "trx_time" : "2022-01-10T16:38:38Z"       },      {       …       },    ],    "status" : "success" }

Packet “data” ATQ2WkUgiwUGEA== , from DEVEUI 33-35-31-35-5a-31-87-10 converted with Micropelt Payload Decoder Excel:

 

 

Clear the Queue

To clear the Downlink queue for a particular device, send the following downlink to the gateway:

-t lora/<device EUI>/clear -m ""