Template:Networking rutos Thingsboard.io: Difference between revisions

From Teltonika Networks Wiki
No edit summary
No edit summary
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<p style="color:red">The information on this page is updated in accordance with the [https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads'''00.07.4'''] firmware version .</p>
<p style="color:red">The information on this page is updated in accordance with the [https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads'''00.07.10'''] firmware version .</p>


==Introduction==
==Introduction==
Line 16: Line 16:
     <li> Click marked "<b>+</b>" buttons to add new device to the group.</li>
     <li> Click marked "<b>+</b>" buttons to add new device to the group.</li>
</ol>
</ol>
[[File:1- overview window.png]]
[[File:1111.png]]




Line 23: Line 23:
     <li> Configure your device's <b>Label</b> (Optional)</li>
     <li> Configure your device's <b>Label</b> (Optional)</li>
</ol>
</ol>
[[File:2-Add New Device.png]]
[[File:22222222222.png]]




Line 34: Line 34:
     <li> Click <b>Add</b> button  to save changes. </li>
     <li> Click <b>Add</b> button  to save changes. </li>
</ol>
</ol>
[[File:Thingboards_io_configuring_credentials.png|border|class=tlt-border]]
[[File:33333333.png |border|class=tlt-border]]


=== Credentials type: MQTT Basic ===
=== Credentials type: MQTT Basic ===
Line 45: Line 45:
     <li>  Click <b>Add</b> button  to save changes. </li>
     <li>  Click <b>Add</b> button  to save changes. </li>
</ol>
</ol>
[[File:3- Add New Device.png]]
[[File:44444444444.png]]


==Preparing data source==
==Preparing data source==
Line 53: Line 53:


1. First, change WEBUI mode from <b>basic</b> to <b>advanced</b>.<br>
1. First, change WEBUI mode from <b>basic</b> to <b>advanced</b>.<br>
[[File:Advanced Mood.png |border|class=tlt-border]]
[[File:Networking_rutos_manual_webui_basic_advanced_mode_75.gif|border|center|class=tlt-border|1102x93px]]
2. Go to <b>Services → Modbus TCP Server</b> page.<br>
2. Go to <b>Services → Modbus → Modbus TCP Server</b> page.<br>
3. Enable <b>Modbus TCP Server</b>.<br>
3. Enable <b>Modbus TCP Server</b>.<br>
[[File:Go to Services → Modbus TCP Server page..png]]
[[File:Networking_RutOS_Thingsboard_config_example_1.png|border|class=tlt-border]]
4. Go to <b>Modbus TCP Client</b> page and add new Server device.<br>
----
[[File:Go to Modbus TCP Client page and add new Server device..png ]]
 
5. Configure <b>Modbus TCP master's Server device</b> as shown below to return device's uptime value.<br>
4. Go to <b>Services → Modbus → Modbus TCP Client</b> page and add new Server device.<br>
[[File:Modbus TCP Client Server device.png|border|class=tlt-border|1152x525px]]
[[File:Networking_RutOS_Thingsboard_config_example_2.png|border|class=tlt-border|1100px]]
 
----
 
5. Configure <b>Modbus TCP master's Server device</b>:<br>
#'''Enable''' the instance;
#Choose your desired '''Name''' for the instance;
#Choose your device's address, in this case, we are using routers address - '''192.168.11.1''';
#Choose the period on how often the data should be sent, in this case we use '''10''';
[[File:Networking_RutOS_Thingsboard_config_example_3.png|border|class=tlt-border]]
 
----
 
6. Add a new instance of request and configure it by your needs. In this example, we will get the devices uptime:
#Click on '''Add''' button;
#Choose the '''Data type''' - 32bit UINT, Byte order 1,2,3,4;
#Choose the '''Function''' - Read holding register (3);
#Write the '''First register number''' - 2;
#Write the '''Register count / Values''' - 2;
#'''Enable''' the request;
#Click on '''Test''' button, to see if the request is configured correctly as shown below;
[[File:Networking_RutOS_Thingsboard_config_example_4.png|border|class=tlt-border|1100px]]


==Configuring data to server with HTTP protocol==
==Configuring data to server with HTTP protocol==
Line 66: Line 87:
After configuring the data source, you can add a data sender configuration. Data sender functionality is located  <b>Services → Data to server</b>. You can add data sender by clicking <b>Add</b> button.
After configuring the data source, you can add a data sender configuration. Data sender functionality is located  <b>Services → Data to server</b>. You can add data sender by clicking <b>Add</b> button.


[[File:Services → Data to server.png]]
[[File:Networking_RutOS_Thingsboard_config_example_5.png|border|class=tlt-border|1100px]]
 
* Configure '''Data''':
 
#Choose your desired '''Name''' for the instance;
#Choose Type - '''Modbus''';
#Choose Format Type - '''Custom''';
#Choose the '''data''' that you want to send;
#Once done configuring, click on '''Next: collection edit''' button;
 
[[File:Networking_RutOS_Thingsboard_config_example_6.png|border|class=tlt-border]]
 
* In Collection configuration, we can leave default settings, so we can move onto '''Server configuration''':
 
[[File:Networking_RutOS_Thingsboard_config_example_7.png|border|class=tlt-border|1100px]]
 
* Configure '''Server instance''':
 
#Type - '''HTTP''';
#Server address - '''https://thingsboard.cloud/api/v1/<your_access_token_here>/telemetry''';
#HTTP headers - '''Content-Type:application/json'''
 
[[File:Networking_RutOS_Thingsboard_config_example_8.png|border|class=tlt-border|1100px]]


[[File:DATA CONFIGURATION.png]]
[[File:SERVER CONFIGURATION.png]]


<ol>
    <li> Set name for the <b>Data sender</b>.</li>
    <li> Set desirable name for your data variable. Make sure that your chosen parameter is shown below JSON format field.</li>
    <li> Paste connection string with your own <b>Access token</b>.</li>
    <pre>https://thingsboard.cloud/api/v1/YOUR_ACCESS_TOKEN/telemetry</pre>
    <li> Add value to Custom header. </li>
    <pre>Content-Type:application/json</pre>
</ol>
==Configuring data to server with MQTT protocol==
==Configuring data to server with MQTT protocol==
After configuring the data source, you can add a data sender configuration. Data sender functionality is located  <b>Services → Data to server</b>. You can add data sender by clicking <b>Add</b> button.
After configuring the data source, you can add a data sender configuration. Data sender functionality is located  <b>Services → Data to server</b>. You can add data sender by clicking <b>Add</b> button.


[[File:Services → Data to server.png]]
[[File:Networking_RutOS_Thingsboard_config_example_5.png|border|class=tlt-border|1100px]]
[[File:2.png]]
 
[[File:3.png]]
* Configure '''Data''':
<ol>
 
    <li> Set name for the <b>Data sender</b>.</li>
#Choose your desired '''Name''' for the instance;
    <li> Choose <b>MQTT</b> protocol.</li>
#Choose Type - '''Modbus''';
    <li> Set desirable name for your data variable. Make sure that your chosen parameter is shown below JSON format field.</li>
#Choose Format Type - '''Custom''';
    <li> Enter <b>thingsboard.cloud</b> as a host.</li>
#Choose the '''data''' that you want to send;
    <li> Paste in MQTT topic. </li>
#Once done configuring, click on '''Next: collection edit''' button;
    <pre>v1/devices/me/telemetry</pre>
 
    <li> Enable <b>Use credentials</b> option. Enter configured username and password from ThingsBoard IoT platform.</li>
[[File:Networking_RutOS_Thingsboard_config_example_6.png|border|class=tlt-border]]
</ol>
 
* In Collection configuration, we can leave default settings, so we can move onto '''Server configuration''':
 
[[File:Networking_RutOS_Thingsboard_config_example_7.png|border|class=tlt-border|1100px]]
 
* Configure '''Server instance''':
 
#Type - '''MQTT;
#Server address - '''thingsboard.cloud''';
#Topic - '''/v1/devices/me/telemetry''';
#Client ID - '''Generated ID from ThingsBoard''';
#Username - '''Created Username from ThingsBoard''';
#Password - '''Created Password from ThingsBoard''';
[[File:Networking_RutOS_Thingsboard_config_example_9.png|border|class=tlt-border|1100px]]
==Adding widget to the dashboard==
==Adding widget to the dashboard==


Line 101: Line 148:
     <li> From the pop-up menu select <b>Latest telemetry </b> option. There you should see collected data.</li>
     <li> From the pop-up menu select <b>Latest telemetry </b> option. There you should see collected data.</li>
</ol>
</ol>
[[File:Latest telemetry.png]]
[[File:500.png]]




Line 110: Line 157:
     <li> Press <b>Show on  widget </b> button.</li>
     <li> Press <b>Show on  widget </b> button.</li>
</ol>
</ol>
[[File:Show on widget.png]]
[[File:600.png]]
<ol>
<ol>
     <li> Choose bundle accordingly to your data.</li>
     <li> Choose bundle accordingly to your data.</li>
Line 116: Line 163:
     <li> Add widget to dashboard.</li>
     <li> Add widget to dashboard.</li>
</ol>
</ol>
[[File:Add widget to dashboard..png]]
[[File:700.png]]
<ol>
<ol>
     <li> Create new dashboard. </li>
     <li> Create new dashboard. </li>
Line 122: Line 169:
     <li> Adds widget to dashboard.</li>
     <li> Adds widget to dashboard.</li>
</ol>
</ol>
[[File:Dashbord.png]]
[[File:1000000.png]]





Latest revision as of 13:29, 22 October 2024

The information on this page is updated in accordance with the 00.07.10 firmware version .

Introduction

This article contains instructions on how to configure ThingsBoard IoT platform and connect Teltonika-Networks devices. ThingsBoard IoT platform is an open-source IoT platform for data collection, processing, visualization, and device management. It enables device connectivity via industry standard IoT protocols - MQTT, CoAP and HTTP and supports both cloud and on-premises deployments. ThingsBoard combines scalability, fault-tolerance and performance so you will never lose your data.

Configuring ThingsBoard IoT platform

The goal of this tutorial is to demonstrate the basic usage of the most popular ThingsBoard features which helps monitor Teltonika-Networks devices.

First, you need to login into the platform. Next, you will see an overview window, scroll down to Entities section and simply click on the Device in the navigation menu.

  1. Click on one of the marked in red buttons in the overview page Entities → Devices. In this page you can also add additional device in order to distinguish different devices with unique data flows.
  2. Click marked "+" buttons to add new device to the group.


  1. In the pop up window set name for your device.
  2. Configure your device's Label (Optional)


Credentials type: Access token (HTTP protocol)


  1. Enable Add credentials option.
  2. Set desirable Access token.
  3. Click Add button to save changes.

Credentials type: MQTT Basic


  1. Enable Add credentials option.
  2. Choose Credentials type:MQTT Basic.
  3. Set username which will be used in MQTT authorization.
  4. Set password which will be used in MQTT authorization.
  5. Click Add button to save changes.

Preparing data source

Different data streams can be selected depending on the device's supported functionality's. In this example we will be using Modbus TCP Server with native Modbus TCP Client functionality.

1. First, change WEBUI mode from basic to advanced.

2. Go to Services → Modbus → Modbus TCP Server page.
3. Enable Modbus TCP Server.


4. Go to Services → Modbus → Modbus TCP Client page and add new Server device.


5. Configure Modbus TCP master's Server device:

  1. Enable the instance;
  2. Choose your desired Name for the instance;
  3. Choose your device's address, in this case, we are using routers address - 192.168.11.1;
  4. Choose the period on how often the data should be sent, in this case we use 10;


6. Add a new instance of request and configure it by your needs. In this example, we will get the devices uptime:

  1. Click on Add button;
  2. Choose the Data type - 32bit UINT, Byte order 1,2,3,4;
  3. Choose the Function - Read holding register (3);
  4. Write the First register number - 2;
  5. Write the Register count / Values - 2;
  6. Enable the request;
  7. Click on Test button, to see if the request is configured correctly as shown below;

Configuring data to server with HTTP protocol

After configuring the data source, you can add a data sender configuration. Data sender functionality is located Services → Data to server. You can add data sender by clicking Add button.

  • Configure Data:
  1. Choose your desired Name for the instance;
  2. Choose Type - Modbus;
  3. Choose Format Type - Custom;
  4. Choose the data that you want to send;
  5. Once done configuring, click on Next: collection edit button;

  • In Collection configuration, we can leave default settings, so we can move onto Server configuration:

  • Configure Server instance:
  1. Type - HTTP;
  2. Server address - https://thingsboard.cloud/api/v1/<your_access_token_here>/telemetry;
  3. HTTP headers - Content-Type:application/json


Configuring data to server with MQTT protocol

After configuring the data source, you can add a data sender configuration. Data sender functionality is located Services → Data to server. You can add data sender by clicking Add button.

  • Configure Data:
  1. Choose your desired Name for the instance;
  2. Choose Type - Modbus;
  3. Choose Format Type - Custom;
  4. Choose the data that you want to send;
  5. Once done configuring, click on Next: collection edit button;

  • In Collection configuration, we can leave default settings, so we can move onto Server configuration:

  • Configure Server instance:
  1. Type - MQTT;
  2. Server address - thingsboard.cloud;
  3. Topic - /v1/devices/me/telemetry;
  4. Client ID - Generated ID from ThingsBoard;
  5. Username - Created Username from ThingsBoard;
  6. Password - Created Password from ThingsBoard;

Adding widget to the dashboard

The collected data can be displayed using various a widgets. To create one you should be able to see gathered data in the Latest telemetry section. To access it you should follow these steps:

  1. Click on the configured device.
  2. From the pop-up menu select Latest telemetry option. There you should see collected data.


In order to display data in the widget you should:

  1. Click on the gathered data row.
  2. Press Show on widget button.

  1. Choose bundle accordingly to your data.
  2. Choose suitable chart for your data visualization.
  3. Add widget to dashboard.

  1. Create new dashboard.
  2. With this option enabled after addition you will be redirected to newly created dashboard
  3. Adds widget to dashboard.


See also