- Introduction
- Integration with ThingsBoard
- Configuring the ModBus Connector
- Installing the ThingsBoard IoT Gateway on the reComputer R1000
- Visualize Incoming Data with the Dashboard
Introduction
The reComputer R1000 edge IoT controller is built on the high-performance Raspberry Pi CM4 platform, featuring a quad-core A72 processor with a maximum support of 8GB RAM and 32GB eMMC. Equipped with dual Ethernet interfaces that can be flexibly configured, it also includes 3 isolated RS485 channels supporting BACnet, Modbus RTU, Modbus TCP/IP protocols. With robust IoT network communication capabilities, the R1000 series supports multiple wireless communication options including 4G, LoRa®, Wi-Fi/BLE, allowing for flexible configurations to serve as corresponding wireless gateways. This controller is well-suited for remote device management, energy management, and various other scenarios in the field of smart buildings.
Integration with ThingsBoard
PrerequisitesTo continue with this guide, we will require the following:
Step 1. Starting the ThingsBoard Edge on the reComputer R1000Create a new Edge instance:
Proceed with the installation of the Edge instance on the reComputer R1000:
ip_address: The IP address of the reComputer R1000. Enter the actual IP address instead of ip_address.
To configure this file properly:
Any connection to localhost:8080 on your local machine will be forwarded to 127.0.0.1:8080 on the reComputer R1000.
Step 2. Provisioning the ThingsBoard IoT Gateway on EdgeTo provision the ThingsBoard Gateway:
|
PrerequisitesTo continue with this guide, we will require the following:
Step 1. Starting the ThingsBoard Edge on the reComputer R1000Create a new Edge instance:
Proceed with the installation of the Edge instance on the reComputer R1000:
ip_address: The IP address of the reComputer R1000. Enter the actual IP address instead of ip_address.
To configure this file properly:
Any connection to localhost:8080 on your local machine will be forwarded to 127.0.0.1:8080 on the reComputer R1000.
Step 2. Provisioning the ThingsBoard IoT Gateway on EdgeTo provision the ThingsBoard Gateway:
|
Configuring the ModBus Connector
The new IoT Gateway device will be featured at the top of the “ThingsBoard IoT Gateways” dashboard list, allowing us to add a ModBus Connector. For example, we can use the ModBus Connector to fetch temperature data from the to fetch temperature data from the Siemens LOGO! device:
-
On the “ThingsBoard IoT Gateways” dashboards page, click the “Connectors” button.
-
To add a Connector, click the “+” button. In the pop-up window, select the MODBUS option in the “Type” field and enter thename of the connector in the “Name” field. Click the “Add” button to proceed.
-
To make further adjustments, click on the newly added Connector and select the “Advanced” tab and the “Configuration” sub-tab on the right side of the “MODBUS Configuration” screen.
- Then, please insert the following configuration code. Then, click the “Save” button.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
"master": {
"slaves": [
{
"host": "192.168.1.200",
"port": 510,
"type": "tcp",
"method": "socket",
"timeout": 35,
"byteOrder": "BIG",
"wordOrder": "BIG",
"retries": true,
"retryOnEmpty": true,
"retryOnInvalid": true,
"pollPeriod": 3000,
"unitId": 1,
"deviceName": "LOGO!",
"deviceType": "siemens",
"connectAttemptTimeMs": 5000,
"connectAttemptCount": 5,
"waitAfterFailedAttemptsMs": 300000,
"attributes": [],
"timeseries": [
{
"tag": "temp",
"type": "16int",
"functionCode": 4,
"objectsCount": 1,
"address": 2,
"divider": 10
},
{
"tag": "Q1",
"type": "bit",
"functionCode": 1,
"objectsCount": 1,
"address": 8193
},
{
"tag": "Q2",
"type": "16int",
"functionCode": 3,
"objectsCount": 2,
"address": 507
}
],
"rpc": [
{
"tag": "getTemp",
"type": "16int",
"functionCode": 4,
"objectsCount": 1,
"address": 2
}
],
"attributeUpdates": [
{
"tag": "randNumber",
"type": "16int",
"functionCode": 6,
"objectsCount": 1,
"address": 507
}
],
"reportStrategy": {
"type": "ON_REPORT_PERIOD",
"reportPeriod": 3000
}
}
]
},
"slave": {}
}
Installing the ThingsBoard IoT Gateway on the reComputer R1000
Start installation of the IoT Gateway on the reComputer R1000:
-
Go back to the “ThingsBoard IoT Gateways” dashboard page and click on the newly added Gateway device (reComputer R1000).
-
On the Gateway device page, click the “Launch command” button and download docker-compose.yml for your gateway.
- Then, open another tab in the terminal and initiate the SSH connection to the reComputer R1000:
1
ssh recomputer@ip_address
ip_address: The IP address of the reComputer R1000. Enter the actual IP address instead of ip_address.
Password: Terminal requests the password. The default password for the reComputer R1000 is: 12345678
- Create the directory for the Gateway service:
1
mkdir gateway_service
- Open this directory:
1
cd /home/recomputer/gateway_service
- Create the docker compose file for your IoT Gateway:
1
nano docker-compose.yml
- Copy the content of the previously downloaded docker-compose.yml file, and paste it into the new one via the terminal:
-
Save the docker-compose.yml file and press CTRL+S to save it. To close the file press CTRL+X.
-
Start the Gateway by executing the following command in the terminal:
1
2
docker compose up -d
docker compose logs -f
Visualize Incoming Data with the Dashboard
Once the ThingsBoard Edge and IoT Gateway are running on the Computer R1000 and the ModBus connector transfers data, you can visualize it on the Dashboard on your Edge instance:
-
Go to the Dashboards section, click the “+” icon and select “Create new dashboard” option.
-
In the pop-up window, enter the dashboard title. Other fields are optional. Click the “Add” button to proceed.
-
Once you have created the dashboard, it will be automatically opened. Click the “Add widget” button and select the widget you require. For example, open the “Charts” widget bundle and elect the Line chart.
-
In the “Add Widget” pop-up window, select the Device (in our case, Siemens LOGO!) as the Datasource. Please verify that the Series Key is the same as the one entered in the Advanced Configuration settings of the connector. As an example, we have utilized the designation “temp”. Consequently, the series key must be “temp” as well. Click the “Add” button.
-
You will now be able to see the real-time data on the dashboard.