Stand with Ukraine flag
Try it now Pricing
Community Edition
How to connect reComputer R1000 to ThingsBoard?
Getting Started Documentation Devices Library Guides Installation Architecture API FAQ
On this page

How to connect reComputer R1000 to ThingsBoard?

Introduction

reComputer R1000 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

Prerequisites

To continue with this guide, we will require the following:

Step 1. Starting the ThingsBoard Edge on the reComputer R1000

Create a new Edge instance:

  • Log in to the *ThingsBoard Demo account and navigate to the Edge Management > Instances section. Click the “+” icon in the top right corner and select the “Add new edge” option.

  • Enter a name for your Edge in the “Name” field, e.g., R1000 Demo Edge, and click the “Add” button to confirm the addition of your new Edge.

  • Your new Edge instance is displayed at the top of the list, as entries are sorted by creation time by default.

Proceed with the installation of the Edge instance on the reComputer R1000:

  • To initiate an SSH (Secure Shell) connection to the reComputer R1000, open the terminal and execute the following command:
1
ssh recomputer@ip_address #Enter the actual 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

  • Once connected, you can follow the installation instructions below. Start by creating a new directory:
1
mkdir tb_edge
  • Open this directory:
1
cd /home/recomputer/tb_edge
  • Create a docker compose file for the ThingsBoard Edge service within this directory:
1
nano docker-compose.yml

To configure this file properly:

  • Go to the Edge management > Instances section of your ThingsBoard Demo account, and click on the Instance itself. Then, click the “Install & Connect Instructions” button.

  • On the “Install & Connect Instructions” pop-up window, select the “Docker” tab and copy the configuration lines.

  • Insert the copied lines into the docker-compose.yml file and press CTRL+S to save it. To close the file press CTRL+X.

  • Execute the following commands:

1
2
docker compose up -d
docker compose logs -f mytbedge
Doc info icon

The command must be executed in the same directory in which the docker-compose.yml file was saved.

  • To set up a local port forwarding via SSH, open another terminal tab and execute the following command:
1
ssh -N -L 8080:127.0.0.1:8080 recomputer@ip_address #Enter the actual IP address

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 Edge

To provision the ThingsBoard Gateway:

  • Log in to the ThingsBoard Demo account and navigate to the Edge Management > Instances section, then click the “Manage dashboards” button.

  • On the “Edge Dashboards” page, click the “+” icon to assign the “ThingsBoard IoT Gateways” dashboard to the Edge instance. Click the “Assign” button. The “ThingsBoard IoT Gateways” dashboard is one of the pre-created, out-of-the-box dashboards available.

  • Open your Edge instance, navigate to the Dashboards section and open the “ThingsBoard IoT Gateways” dashboard.

  • Click the “+” icon in the upper right corner to add a new gateway. Enter the gateway name in the “Name” field, and select the “default” device profile. Click the “Create” button.

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:

image

  • 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
Doc info icon

The command must be executed in the same directory in which the docker-compose.yml file was saved.

Visualize Incoming Data with the Dashboard

imageOnce 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.