Cellular IoT Communication Protocol (NB-IoT / LTE-M)
The Lobaro Platform
The easiest way to work with the Lobaro Modbus Gateway is the Lobaro Platform. You can find it under https://platform.lobaro.com – Log in with the credentials provided by Lobaro.
Your Gateways should be listed under "Devices". If you have multiple devices in your account, you can distinguish them by the field "Address". The Address is printed on the box of the Gateway (it is the DevEUI that is also used for LoRaWAN).
The Industrial Gateway uses CoAP(s) to communicate with the Lobaro Platform. This documentation shows only the Payload of the CoAP messages. The data is sent using CBOR, which is a binary format that works a lot like JSON, but uses less bytes. In this documentation the messages are written as JSON, so that they can be read by humans. CBOR supports binary data. In JSON, binary data is represented by strings containing the bytes encoded in Base64.
Envelope
Each uplink is enclosed in an envelope that contains 4 values:
{
"i": "70b3d5e050010001",
"n": 19,
"q": "...",
"d": { ... }
}
| Key | Meaning | Explanation |
|---|---|---|
| "i" | Identification | The device's address (DevEUI), as printed on the device. A string. |
| "n" | Number | Uplink Frame Counter, incementing number of uplink, starting with 1 on device boot. A number. |
| "q" | Query | The type of the message sent in the uplink, e.g. "status", "mbus". A string. |
| "d" | Data | The payload of the message. An object. |
The payload (key "d") is different for each message type (key "q"). The list that follows only shows the payload for those message types.
Upload type "device"
The first uplink sent to the platform after boot. It contains information about the device that don't change during execution, like addresses and firmware names and versions. It also contains information about why and how the device booted that can help when analysing problems.
Payload for "device" uplink
{
"app": "app-hybrid-modbus v0.9.1+battery TZ2 (Jun 8 2023 11:16:53)",
"eui": "70B3D5E050010233",
"mcu": "app-mcuboot-nrf9160-sec v1.3.0+MB TZ2 (Sep 9 2021 12:28:53)",
"boot": "app-boot-nrf9160-sec v1.8.2 TZ2 (Feb 8 2023 17:03:37)",
"imei": "351358810914934",
"imsi": "901405100490897",
"board": "nrf9160-sx-gw2",
"iccid": "89882806660004908978",
"model": "nRF9160-SICA",
"modem": "mfw_nrf9160_1.3.1",
"assert": "",
"hwversion": "nRF9160 SICA B1A",
"final_words": "",
"reboot_code": 1,
"reboot_reason": "nRESET pin pulled low"
}
Upload type "config"
The second uplink sent after boot is the complete configuration of the device. Any change of the device's configuration is only applied after a reboot, so this configuration is valid for the complete runtime of the device until the next reboot (which will upload the configuration again).
Payload for "config" uplink
{
"SF": 12,
"APN": "*",
"DNS": "9.9.9.9,1.1.1.1",
"PIN": "",
"WAN": "nbiot",
"Band": "",
"Host": "coap://platform.lobaro.com",
"PlId": 0,
"MbCmd": "",
"PlFmt": 1,
"PlMax": 51,
"AppKey": "ABCDEFGHIJKLB/Fqcg51iQ==",
"DevEUI": "cLPV4FABAjM=",
"OpMode": "A",
"JoinEUI": "ABCDEFGsZeA=",
"MbusCmd": "0 0 * * * *:R,9600,8N1:010300000003",
"mFilter": "",
"verbose": false,
"Operator": "",
"ciFilter": "",
"wMbusCmd": "",
"devFilter": "",
"typFilter": "",
"DialogMode": false,
"LostReboot": 3,
"PowerOnDelay": 1000,
"maxTelegrams": 0,
"ExternalAntenna": false,
"InternalAddress": 250
}
Upload type "status"
The "status" uplink is sent at boot after the config and once every 6 hours. It contains health information about the device and information about the connection. The message is sent 4 times a day, so that problems with the devices will be noticed quickly. It also allows always reaching the device via downlink within 6 hours.
Payload for "status" uplink
{
"ci": "019C1307",
"apn": "iot.1nce.net",
"net": "NB-IoT",
"psm": "11100000",
"snr": 47,
"tac": "D71E",
"tau": "01011111",
"band": 8,
"host": "coap://platform.lobaro.com",
"rsrp": 77,
"rsrq": 28,
"time": 1686216406,
"vbat": 3547,
"monitor": "connected:1, conMode:1, reg:5, tac:D71E, ci:019C1307, psm:11100000, tau:01011111, RSRP:77(3/4), RSRQ:28(4/4), SNR:47(4/4)",
"conFails": 0,
"operator": "26201",
"conTimeNow": 1,
"temperature": 270
}
Upload type "modbus"
The "modbus" uplink is sent for each entry in MbCmd on execution of the entry, after boot and when the cron triggers. It contains a list of the executed commands (excuted in their order in the entry). For each command the command itself, the response to it, the error code (0 for no error), and the time of the execution is included. When an entry has a lot of data and the capacity of a single uplink is exceeded, entries will be split into multiple uplinks.
Payload for "modbus" uplink
{
"batch": [
{
"cmd": "AwMCvAAO",
"rsp": "A4ML",
"time": 1686216413,
"error": 11
},
{
"cmd": "BAMCvAAO",
"rsp": "BIML",
"time": 1686216413,
"error": 11
}
]
}
Upload type "wmbus"
The "wmbus" uplink sends collected wireless M-Bus telegrams as batch. The telegrams are sent raw and without CRCs along with some Metadata (time of reception, reception signal quality, and format and mode of the telegram). The Gateway will fit as many telegrams in a single uplink as possible. If there are too many telegrams for a single uplink, multiple uplinks will be sent.
Payload for "wmbus" uplink
{
"batch": [ {
"mode": "C",
"rssi": -90,
"format": "A",
"telegram": "MESXJlJVABABCHrDACCluEtjGCVlnEqVO2KfVQQ/k3BeRXtu+6vYZTQbiPQIb2Q=",
"timestamp": 1686063814
},
{
"mode": "C",
"rssi": -79,
"format": "A",
"telegram": "HkSlEUcDkGR7B3pdcxAF8KiEGiCmaYm0r0WKnBlGAQ==",
"timestamp": 1686063815
},
{
"mode": "C",
"rssi": -72,
"format": "A",
"telegram": "HkSlEQQCkGR7B3pecxAFfp1gCUAoj/oonaxNCUkrvQ==",
"timestamp": 1686063817
}
]
}
Upload type "mbus-scan"
The "mbus-scan" uplink sends the result of a wired M-Bus device scan. It is only sent once after boot, as the scan is only executed once after boot.
Payload for "mbus-scan" uplink
{
"baud": 2400,
"addresses": [1, 4, 7, 200]
}
Upload type "mbus"
The "mbus" uplink sends wired M-Bus telegrams after they have been send requested via the Bus.
Payload for "mbus" uplink
{
"batch": [
{
"time": 1686060905,
"type": "UD2",
"address": 1,
"telegram": "aFZWaAgBcheBKAKCTQMWLjwAAAx4F4EoAg18CERJIC50c3VjCjQwOTUxMCAgICAEbQYB5yYCfAllbWl0IC50YWIAAAQTXwUdAASTfwAAAABEE18FHQAPHAEfzhY="
},
{
"time": 1686060906,
"type": "UD2",
"address": 7,
"telegram": "aPT0aAgHcmKJBACnMgQEUhAAAAl0BAlwBAwGAAAAAAwUAAAAAAsuAAAACz4AAAAKWwAACl8AAEwUAAAAAEwGAAAAAAx4QGMjaYkQcWCbEC0AAADbEC0AAACbEDsAAACaEFs1AJoQXxMCDCJglQQAPCJglQQAfCIEWAQAQmwBAYwgBgAAAACMMAYAAAAAjIAQBgAAAADMIAYAAAAAzDAGAAAAAMyAEAYAAAAAmhFbJQCaEV8TApsROwAAAJsRLQAAALwBIiiUBACMAQYAAAAAjCEGAAAAAIwxBgAAAACMgRAGAAAAAIwBFAAAAAAEbQkM5iYPIQQAECG1Fg=="
}
]
}
Mobile data consumption
Uploading one Uplink with 400 bytes including all metadata(might be less, depending on the configuration).
| Telegram upload interval | Monthly NB - IoT data usage |
|---|---|
| 250 each Day | ~3 MB |
| 1 each Day | ~12 kB |
| 8 each Day(every 3h) | ~100 kB |
| 400 each Week | ~700 kB |
*All calculations are estimations and might vary depending on the configuration. *