Skip to main content

ThingsBoard Integrated(via TTS)

ThingsBoard is an open-source IoT platform that enables rapid development, management, and scaling of IoT projects. Our goal is to provide the out-of-the-box IoT cloud or on-premises solution that will enable server-side infrastructure for your IoT applications.

The content of this chapter will guide users how to connect the SenseCAP T1000 Tracker to ThingsBoard through TTN.

Get Started

Before starting the setup, please check Connect SenseCAP T1000 to TTS to connect your SenseCAP T1000 Tracker to TTS first.

Configura the ThingsBoard

To get started, create an account with ThingsBoard.

Create Converter

First, we need to create an Uplink Data Converter which will be used for receiving messages from the TTS.

Navigate to Data converters, click Create new converter.

pir

Name the converter, enable Debug mode, copy the following code and click Add.

var data = decodeToJson(payload);
var deviceName = data.end_device_ids.device_id;
var deviceType = data.end_device_ids.application_ids.application_id;

var telemetry = {};

var messages = data.uplink_message.decoded_payload.messages[0];
for (var i = 0; i < messages.length; i++) {
var measurement = messages[i];

var type = measurement.type.toLowerCase();
var typeKey = '';
for (var j = 0; j < type.length; j++) {
if (type[j] === ' ') {
typeKey += '_';
} else {
typeKey += type[j];
}
}

telemetry[typeKey] = measurement.measurementValue;
}

var result = {
deviceName: deviceName,
deviceType: deviceType,
telemetry: telemetry
};

function decodeToString(payload) {
return String.fromCharCode.apply(String, payload);
}

function decodeToJson(payload) {
var str = decodeToString(payload);
var data = JSON.parse(str);
return data;
}

return result;

pir

Add integration

Navigate to Integration, click Add Integration.

pir

Type: The Things Stack Community
Enable: Enable integration Debug mode Allow create devices or assets

pir

Choose Select existing, and select the one we create before.

pir

Skip the Downlink data converter.

pir

Region: Region where your application was registered inside TTS
Username: Username from TTS
Password: Password from TTS
Use API v3: Set Enable

tip

Info can be found in TTS MQTT integration.

pir

pir

Data view

Navigate to Entities -> Devices, here you can see that:

  • a new device was registered in Thingsboard
  • in the Latest Telemetry section you will the update data from the device.

pir

Add Dashboard

Navigate to Dashboards, Click Create new dashboard.

Enter the dashboard title, and then click Next.

pir

Add widget, select widget to add.

Location map

Select a map widget.

pir

Type: Device
Device: The device we created.
Data key: latitude, longitude

pir

Other parameters

Refer to the above steps to add other widgets.

Temperature

Device: The device we created.
Data key: air_temperature

pir

Battery

Device: The device we created.
Data key: battery

pir

Here is an basic example, you can customize your own dashboard.

pir

Loading Comments...