This guide contains step-by-step instructions on how to connect your Nettra RTU device to ThingsBoard Community Edition through ethernet, using as sample, one of the many applications that the Nettra RTU has. In particular, this sample application will allow you to monitor temperature using ThingsBoard web UI to display the data coming from the sensor.
Nettra RTU called “RTU+” is a powerful IoT electronic device that has digital and analog inputs and outputs, as well as several integrated communication interfaces as modem, ethernet, 802.15.4, RS485, RS232 and GPS. It is an ideal product to implement monitoring, acquisition and control applications over a distributed data network.
The RTU+ is easly configurable via a RTU+ Configuration Interface. To adapt the RTU+ to each application, it runs a fully customizable script, accessible and editable from the Configuration Interface. In this guide we will provide one as an example quite simple and easy to understand.
Once you complete this sample/tutorial, you will see your sensor data on a dashboard like the following on the right.
The following picture summarizes the connections for this simple project:
This step contains instructions that are necessary to connect your device to ThingsBoard.
Sign up ThingsBoard Web UI as live-demo. See Live Demo page for more details how to get your account.
Download the dashboard file (.json) using this link. Use import/export instructions to import the dashboard to your ThingsBoard instance.
Download and install last version of RTU+ Configuration Interface.
Once you have the RTU+ connected to the temperature sensor and the 12VDC power supply as shown in Connection Diagram section, connect the RTU+ to the PC using the USB-Serial cable (make sure you have all the necessary drivers installed for that).
Open the RTU+ Configuration Interface.
Once you are connected you should see this icon :
Once you have your RTU+ connected to the PC, we can proceed with its configuration.
Save clicking “Aplicar cambios”.
demo.thingsboard.io
if you are using live demo server.Fill the Time Synchronization boxes as follow:
Interfaz : NTP Ethernet
Servidor : ThingsBoard HOST/IP address that is accessible within your local network. Specify demo.thingsboard.io
if you are using live demo server.
Frecuencia : 10
Huso : Write your time zone
Click “Aplicar cambios” to save.
You should see in “Estado”: “Conectado” (MQTT status: Connected) (It could take some minutes the first time)
Go to “Inicio”
Click “Configurar Hora”.
Go to “Escalado de Entradas Analógicas”.
Here we have two possibles configurations, depending on your temperature sensor.
If your temperature sensor output range is between 4-20mA :
Select “Corriente” in “Entrada Analógica 0: “. Fill “X0” with “819” and “X1” with “4096”. Fill “Y0” with minimum sensor temperature and “Y1” with maximum sensor temperature.
Example: Sensor Range: -10°C to 100°C. “X0” = 819, “Y0” = -10, “X1” = 4096 and “Y1” = 100
If your temperature sensor output range is between 0-20V :
Select “Tensión” in “Entrada Analógica 0: “. Fill “X0” with “0” and “X1” with “4096”. Fill “Y0” with minimum sensor temperature and “Y1” with maximum sensor temperature.
Example: Sensor Range: -10°C to 100°C. “X0” = 0, “Y0” = -10, “X1” = 4096 and “Y1” = 100
Click “Aplicar cambios” to save.
/*
* DESCRIPTION :
* - Monitor temperature each 20 seconds.
*
* INPUTS:
* - Temperature sensor : Analog Input 0
*/
// Constants
const TLOG = 20000; // [Miliseconds]
// Variables definition
loggable float temperature; // [ºC]
ulong logTimer;
<span style="color: green"> Some green text </span>
// Alias
alias sensorTemperature as AInEscalado[0];
// Variables initialization
logTimer = ConfigurarTimeout(0);
// Code
while(1)
{
if (Timeout(logTimer))
{
logTimer = ConfigurarTimeout(TLOG);
temperature = sensorTemperature;
Log(temperature);
}
}
Import the script clicking “Cargar”. If you want to make your own script, you can see the Nettra C user manual.
Compile and save the script in the RTU+ by clicking “Compilar y Aplicar”.
Finally, open ThingsBoard Web UI in the Live Demo server with same user and password as ThingsBoard configuration section.
Go to “Devices” section and locate “RTU+ Device”, open device details and switch to “Latest telemetry” tab.
If all is configured correctly you should be able to see latest values of “temperature” in the table.
After, open “Dashboards” section then locate and open “RTU+” dashboard.
As a result, you will see a time-series chart displaying temperature level (similar to dashboard image in the introduction).
Browse other samples or explore guides related to main ThingsBoard features:
Don’t hesitate to star ThingsBoard on github to help us spread the word. If you have any questions about this sample - post it on the issues.
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.