- Prerequisites
- Installation and Configuration
- Troubleshooting
- Windows firewall settings
- Next Steps
This guide describes how to install ThingsBoard Edge on Windows machine. Instructions below are provided for Windows 10/8.1/8/7 32-bit/64-bit.
Prerequisites
To start utilizing the ThingsBoard Edge, it is essential to have an operational ThingsBoard server that supports Edge functionality.
The easiest way is to use ThingsBoard Cloud server.
Alternatively, you can install the ThingsBoard Professional Edition server on-premise. For this, please refer to the ThingsBoard Professional Edition installation guide.
Edge Hardware Requirements
The hardware specifications needed for ThingsBoard Edge are determined by both the number of devices connected locally and the extent of GUI interaction:
-
Light Usage: If you intend to operate ThingsBoard Edge with minimal GUI interactions (such as local dashboards and device management) and anticipate connecting fewer than 100 devices to a single machine, a minimum of 1GB of RAM should suffice.
-
Heavy Usage: Conversely, for heavy GUI interactions and connections to 100+ devices on a single machine, we recommend allocating at least 4GB of RAM to ensure optimal performance.
Provisioning a new Edge instance on the ThingsBoard server
Additionally, you will need to provision Edge on the ThingsBoard server.
-
Sign in to your ThingsBoard PE instance and navigate to the “Edge Management” section -> “Instances” page. Click the “+” icon in the top right corner and select “Add new edge”.
-
Enter a name for your edge. For instance, “My New Edge”. If necessary, update the cloud endpoint. This URL should be accessible from the edge. If the edge is running in a Docker container, using “localhost” is incorrect. It must be the IP address of the machine where ThingsBoard PE is running and accessible by the edge container. If you are using the ThingsBoard Cloud server to evaluate the edge, leave this setting as it is. Click “Add” to confirm adding your new Edge.
-
Your new edge should now appear at the top of the list, as entries are sorted by creation time by default.
Installation and Configuration
Step 1. Install Java 17 (OpenJDK)
ThingsBoard service is running on Java 17. Follow this instructions to install OpenJDK 17.
- Visit Open JDK Download Page. Go to “Other platforms and versions”, select “Operating System” as “Windows”, “Architecture” as “x64”, “Version” as “17 - LTS” and download JDK .msi package.
- Run the downloaded MSI package and follow the instructions. Make sure you have selected “Add to PATH” and “Set JAVA_HOME variable” options to “Will be installed on local hard drive” state.
- Visit PostgreSQL JDBC Download Page to download PostgreSQL JDBC Driver. Choose the latest available option.
- Create the folder C:\Program Files\JDBC and copy downloaded file there. Then, add a new global variable - run PowerShell as an administrator and execute the following command. Do not forget to change “postgresql-42.2.18.jar” in the command to match the downloaded version.
1
[System.Environment]::SetEnvironmentVariable("CLASSPATH", '.;"C:\Program Files\JDBC\postgresql-42.2.18.jar"', [System.EnvironmentVariableTarget]::Machine)
You can check the installation using the following command (using Command Prompt):
1
java -version
Expected command output is:
1
2
3
4
C:\Users\User>java -version
openjdk version "17.x.xx"
OpenJDK Runtime Environment Temurin-17.x.xx (...)
OpenJDK 64-Bit Server VM Temurin-17.x.xx (...)
Step 2. Configure PostgreSQL
ThingsBoard Edge uses PostgreSQL database as a local storage.
PostgreSQL Installation
Download the installation file (PostgreSQL 12.17 or newer releases) here and follow the installation instructions.
During PostgreSQL installation, you will be prompted for superuser (postgres) password. Don’t forget this password. It will be used later. For simplicity, we will substitute it with “postgres”.
Create ThingsBoard Edge Database
Once installed, launch the “pgAdmin” software and login as superuser (postgres). Open your server and create database tb_edge with owner “postgres”.
Step 3. ThingsBoard Edge service installation
Download and extract the package.
1
https://dist.thingsboard.io/tb-edge-windows-3.8pe.zip
Note: We assume you have unzipped package to default location: C:\Program Files (x86)\tb-edge
Step 4. Configure ThingsBoard Edge
Open the Notepad or other editor as administrator user (right click on the app icon and select “Run as administrator”).
Open the following file for editing (select “All Files” instead of “Text Documents” in file choosing dialog, the encoding is UTF-8):
1
C:\Program Files (x86)\tb-edge\conf\tb-edge.yml
Database configuration
In the file “tb-edge.yml” from the previous step locate “# SQL DAO Configuration” block.
Don’t forget to replace YOUR_POSTGRES_PASSWORD_HERE with your real postgres user password:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# SQL DAO Configuration
spring:
data:
jpa:
repositories:
enabled: "true"
jpa:
hibernate:
ddl-auto: "none"
datasource:
driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.postgresql.Driver}"
url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/tb_edge}"
username: "${SPRING_DATASOURCE_USERNAME:postgres}"
password: "${SPRING_DATASOURCE_PASSWORD:YOUR_POSTGRES_PASSWORD_HERE}"
Configure cloud connectivity
Click on Copy Edge Key and Copy Edge Secret in the edge details section. This will copy your edge credentials to your clipboard. Be sure to store them in a secure location, as these values will be needed in the following steps.
Locate “# Cloud configuration” block and replace PUT_YOUR_EDGE_KEY_HERE and PUT_YOUR_EDGE_SECRET_HERE with Edge key and secret respectively.
Please replace PUT_YOUR_CLOUD_IP with an IP address of the machine where ThingsBoard PE version is running:
- Use thingsboard.cloud in case you are connecting edge to ThingsBoard Cloud.
NOTE: thingsboard.cloud uses SSL protocol for edge communication. Please change CLOUD_RPC_SSL_ENABLED to true as well.
- Use localhost in case edge is running on the same machine where cloud instance is running.
- Use X.X.X.X IP address in case edge is connecting to the cloud instance in the same network or in the docker.
1
2
3
4
5
6
7
8
9
# Cloud configuration
cloud:
routingKey: "${CLOUD_ROUTING_KEY:PUT_YOUR_EDGE_KEY_HERE}"
secret: "${CLOUD_ROUTING_SECRET:PUT_YOUR_EDGE_SECRET_HERE}"
rpc:
host: "${CLOUD_RPC_HOST:PUT_YOUR_CLOUD_IP}"
ssl:
# Set to 'true' if using thingsboard.cloud or if you have configured a TLS connection on your Server; set to 'false' otherwise.
enabled: "${CLOUD_RPC_SSL_ENABLED:true/false}"
Step 5. Run installation script
Launch windows shell (Command Prompt) as Administrator. Change directory to your ThingsBoard Edge installation directory.
Execute install.bat script to install ThingsBoard Edge as a Windows service. This means it will be automatically started on system startup. Similar, uninstall.bat will remove ThingsBoard Edge from Windows services. The output should be similar to this one:
1
2
3
4
5
6
7
C:\Program Files (x86)\tb-edge\install.bat
Detecting Java version installed.
CurrentVersion 110
Java 11 found!
Installing Thingsboard Edge...
...
ThingsBoard Edge installed successfully!
Step 6. Start ThingsBoard Edge service
Now let’s start the ThingsBoard Edge service! Open the command prompt as an Administrator and execute the following command:
1
net start tb-edge
Expected output:
1
2
The ThingsBoard Edge Server Application service is starting.
The ThingsBoard Edge Server Application service was started successfully.
In order to restart the ThingsBoard Edge service you can execute following commands:
1
2
net stop tb-edge
net start tb-edge
Step 7. Open ThingsBoard Edge UI
Once started, you will be able to open ThingsBoard Edge UI using the following link http://localhost:8080
.
Please use your tenant credentials from local Server instance or ThingsBoard Cloud to log in to the ThingsBoard Edge.
Troubleshooting
The log files are located in logs folder (“C:\Program Files (x86)\tb-edge\logs” in our case).
The tb-edge.log file should contain following line:
1
YYYY-MM-DD HH:mm:ss,sss [main] INFO o.t.server.TbEdgeApplication - Started TbEdgeApplication in x.xxx seconds (JVM running for x.xxx)
In case of any unclear errors, use general troubleshooting guide or contact us.
Windows firewall settings
In order to have external access to ThingsBoard Web UI and device connectivity (HTTP, MQTT, CoAP) you need to create a new inbound rule with Windows Firewall with Advanced Security.
- Open “Windows Firewall” from “Control Panel”:
- Click “Advanced settings” on the left panel:
- Select “Inbound Rules” on the left panel, then click “New Rule…” on the right “Actions” panel:
- Now new “New Inbound Rule Wizard” window will open. On the first step “Rule Type” select “Port” option:
- On the “Protocol and Ports” step select “TCP” protocol and enter port list 8080, 1883, 5683 in the “Specific local ports” field:
- On the “Action” step leave “Allow the connection” option selected:
- On the “Profile” step select Windows network profiles when to apply this rule:
- Finally, give the name to this rule (for ex. “ThingsBoard Service Networking”) and click “Finish”.
Next Steps
Congratulations! You have successfully provisioned, installed and connected ThingsBoard Edge to ThingsBoard server.
You can continue with Getting started guide to get the basic knowledge of ThingsBoard Edge or you can jump directly to more advanced topics:
-
Getting started guide - Provide quick overview of main ThingsBoard Edge features. Designed to be completed in 15-30 minutes:
-
Edge Rule Engine:
-
Rule Chain Templates - Learn how to use ThingsBoard Edge Rule Chain Templates.
-
Provision Rule Chains from cloud to edge - Learn how to provision edge rule chains from cloud to edge.
-
- Security:
- gRPC over SSL/TLS - Learn how to configure gRPC over SSL/TLS for communication between edge and cloud.
-
Features:
-
Edge Status - Learn about Edge Status page on ThingsBoard Edge.
-
Cloud Events - Learn about Cloud Events page on ThingsBoard Edge.
-
-
Use cases:
-
Manage alarms and RPC requests on edge devices - This guide will show how to generate local alarms on the edge and send RPC requests to devices connected to edge:
-
Data filtering and traffic reduce - This guide will show how to send to cloud from edge only filterd amount of device data:
-
- Roadmap - ThingsBoard Edge roadmap.