|
ThingsBoard PE Feature Only Professional Edition supports Platform Integrations feature. Use ThingsBoard Cloud or install your own platform instance. |
This guide provides step-by-step instructions for connecting the Abeeway Micro Tracker and Abeeway Industrial Tracker to ThingsBoard Professional Edition (PE). The connection is through the IoT network in the new global standard LoRaWAN and ThingPark Wireless OSS intelligent logger (Actility). In this guide, we will use the free ThingsBoard PE demo server thingsboard.cloud in this guide. This guide will be useful to anyone who wants to connect their trackers manufactured by Abeeway or another industrial IoT application to the LoRaWAN network.
We assume:
ThingsBoard Platform Integrations feature allows to push data from various platforms and connectivity solutions to ThingsBoard. We will use platform ThingPark Wireless company Actility to consume data from LoRaWAN networks and automatically register devices in ThingsBoard. Besides configuring the integration, we will also set ThingsBoard up to decode incoming data, store it in the database, visualize on the dashboard and generate alarms based on configurable thresholds.
Few things to notice:
The DevEUI from the incoming message will become the Device Name in ThingsBoard;
ThingsBoard will automatically create device with type “tracker” and name equal to DevEUI;
Therefore, when creating a new device, in the Name field, enter the value DevEUI: from the Device Information (ThingPark Wireless OSS intelligent logger (Actility)) section
The device must be active!!! In the example, DevUi = "20635F010800105C"
The device must be attached to the application.In our example: to Application "NoAS21"
In order to create an Integration, we should create the Uplink Data Converter and the Downlink Data Converter first. The converters will decode incoming telemetry payload data from global standard LoRaWAN that contains in encoded hex string to human readable, simplified ThingsBoard data format.
When creating an Uplink Converter, a default decoder is added to the Decoder section.
After creating the Uplink Converter to the Decoder section, you need to update the Decoder code to the following code.
It is necessary to edit the Uplink decoder
{
"DevEUI_uplink": {
"Time": "2019-11-06T09:54:46.342+01:00",
"DevEUI": "20635F00C5000660",
"FPort": 17,
"FCntUp": 1796,
"ADRbit": 1,
"MType": 2,
"FCntDn": 94,
"payload_hex": "0500997d3040",
"mic_hex": "304d48f9",
"Lrcid": "00000211",
"LrrRSSI": -63.0,
"LrrSNR": 7.5,
"SpFact": 7,
"SubBand": "G1",
"Channel": "LC2",
"DevLrrCnt": 1,
"Lrrid": "10000329",
"Late": 0,
"Lrrs": {
"Lrr": [{
"Lrrid": "10000329",
"Chain": 0,
"LrrRSSI": -63.0,
"LrrSNR": 7.5,
"LrrESP": -63.710819
}]
},
"CustomerID": "100038328",
"CustomerData": {
"alr": {
"pro": "ABEE/APY",
"ver": "1"
}
},
"ModelCfg": "0",
"InstantPER": 0.0,
"MeanPER": 0.001706,
"DevAddr": "05C1704A",
"TxPower": 9.5,
"NbTrans": 1
}
}
{
"deviceName": "20635F00C5000660",
"deviceType": "Abeeway Micro/Industrial Tracker",
"telemetry": {
"ts": 1573030486342,
"values": {
"batteryVoltage": 8.388,
"temperature": 18.5,
"ph_type": "Heartbeat message",
"ph_status": "Standby",
"ph_alert_SOS_bit4": 0,
"ph_tracking/idle_state_bit3": 0,
"ph_tracker_is_moving_bit2": 0,
"ph_periodic_position_message_bit1": 0,
"ph_POD_message_bit0": 0,
"m_type": "Unconfirmed Data Up",
"m_port": 17,
"m_customerID": "100038328",
"m_LrrRSSI": -63,
"m_LrrSNR": 7.5,
"m_Lrrid": "10000329",
"ack": 3
},
"last_reset_cause": 64
}
}
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Data Variable |
Type | Status | Battery | Temperature | Ack/opt | Data |
Field | First Byte | Byte length | Value | Description |
Type | 0 | 1 | 0x05 | Heartbeat message |
Status | 1 | 1 | 0x00 | Standby |
Battery | 2 | 1 | 0x99 | 8.388 |
Temperature | 3 | 1 | 0x7d | 18.5 |
Ack/opt | 4 | 1 | 0x30 | 3/Optional data (depending on message type. Currently used only for position messages) |
Data | 5 | 1-22 | 0x40 | last_reset_cause |
Message type | Id | Content |
Frame pending | 0x00 | This uplink message is sent to trigger the sending. (and speed up the configuration of the tracker) if downlink messages are available on gateway and no other uplink message is on the queue |
Position message | 0x03 | GPS, low power GPS, WIFI or BLE position data |
Energy status message | 0x04 | Used by the server to estimate the battery level. Contain information related to the power consumption |
Heartbeat message | 0x05 | Notify the server the tracker is operational and under LoRa coverage |
Activity Status message (1) | 0x07 | Reports the activity counter. Used only by the activity tracking operating mode |
Configuration message (1) | 0x07 | Reports the partial or whole configuration of the trackers |
Shutdown message | 0x09 | Sent when the tracker is set off |
Geolocation start message (2) | 0x0A | Sent when the tracker starts a geolocation |
Debug message | 0xFF | Internal use only |
Alternatively, you can import it from this file
When creating an Downlink Converter, a default decoder is added to the Decoder section.
After creating the Downlink Converter to the Decoder section, you need to update the Decoder code to the following code.
It is necessary to edit the Downlink decoder
Open Downlink Converter, editor mode, click “test decoder function” and replace the default code with a new code:
{
{
/** Encoder **/
var data = {};
// Process data from incoming message and metadata
data.payload = msg.sentPayloadHex;
data.DevEUI = metadata['DevEUI'];
data.deviceType = metadata['deviceType'];
data.ContentType = "application/json";
data.Accept = "application/json";
data.urlPrefix = "/core/latest/api/devices/";
data.urlSufix = "/downlinkMessages";
data.urlSufixToken = "/admin/latest/api/oauth/token";
data.firstParamToken = "client_credentials";
data.urlSufixGetDevices = "/core/latest/api/devices";
// Result object with encoded downlink payload
var result = {
// downlink data content type: JSON, TEXT or BINARY (base64 format)
contentType: "JSON",
// downlink data
data: JSON.stringify(data),
msg: msg,
metadata: metadata
};
return result;
}
}
Alternatively, you can import it from this file
WARNING !!! After creation of the Integration…
After creating and configuring the integration and connecting it to platform ThingPark Wireless company Actility, ThingsBoard will begin receiving the first reports of the telemetry from your devices.
On the basis of these first messages ThingsBoard system will automatically create devices with type and name under which devices were registered in the ThingPark Actility Enterprise.
That’s why after creating and configuring the integration and before starting the Dashboard setup you need to check that all your devices are detected and visible in ThingsBoard.
Example: Dashboard in json format
- Creation of the Dashboard
- Add to the Dashboard new widgets:
-Note:
If your devices are active and you do everything correctly when you connect the ThingPark Wireless OSS intelligent
logger (Actility) Platform, then you will see incoming messages on the dashboard you created.
After adding widget number 5, it must be associated with the downlink decoder.
To do this, go to the “Rule Chain” tab and open the “Root Rule Chain”.
Editing the “Root Rule Chain”:
Before sending a message:
Message type | ID | Description |
POD | 0x01 | Position on demand |
Set Mode | 0x02 | hange the tracker operational mode |
Request configuration | 0x03 | Request the actual configuration of the tracker |
Start SOS mode | 0x04 | Turn on SOS mode |
Stop SOS mode | 0x05 | Turn off SOS mode |
Set Param | 0x0B | Modify parameter(s) |
Debug command | 0xFF | Remove BLE bonding. Reset the tracker |
Mode | Value |
Standby | 0 |
Motion tracking | 1 |
Permanent tracking | 2 |
Motion start/end tracking | 3 |
Activity tracking | 4 |
Off mode | 5 |
{...
payloadHex: "0203", ...
}
{...
payloadHex: "030605090C01", ...
* "05" - geoloc_sensor,
* "09" - gps_timeout,
* "0C" - gps_convergence,
* "01" - lora_period,
Special parameter Id:
* "0xFD": get the BLE version.
* "0xFE": get the firmware version.
}
{...
payloadHex: "0B 0A 0C00000078 1100000E10", ...
* "0C00000078" - 0C - gps_convergence, 0x78 - value (sec),
* 1100000E10 - 11 - gps_standby_timeout. 0xE10 - value (sec).
}
{...
payloadHex: "03020001020305",
...}
{...
Byte 0 Byte 1 Byte 2-21
"0x03" "ACK" Byte "2-21" Parameter ID list (optional)
Special parameter Id:
➢ 0xFD: get the BLE version.
➢ 0xFE: get the firmware version.
Byte 2-21 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12
13 fd fe
00 01 02 03 05 06 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 fe
...}
Getting started guides - These guides provide quick overview of main ThingsBoard features. Designed to be completed in 15-30 minutes.
Installation guides - Learn how to setup ThingsBoard on various available operating systems.
Connect your device - Learn how to connect devices based on your connectivity technology or solution.
Data visualization - These guides contain instructions how to configure complex ThingsBoard dashboards.
Data processing & actions - Learn how to use ThingsBoard Rule Engine.
IoT Data analytics - Learn how to use rule engine to perform basic analytics tasks.
Advanced features - Learn about advanced ThingsBoard features.
Contribution and Development - Learn about contribution and development in ThingsBoard.