立即试用 商务报价
Edge
安装 > 安装说明 > Windows

本页目录

Installing ThingsBoard Edge on Windows

请使用Linux安装选项因为它是运行ThingsBoard的最稳定的平台,Windows安装将在未来被弃用可以在安装指南页面上找到Linux安装指南

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

ThingsBoard Cloud server

To start using ThingsBoard Edge you need to have ThingsBoard server that supports edge functionality up and running.

The easiest way is to use Live Demo server.
The alternative option is to install ThingsBoard Community Edition server that supports edge functionality on-premise. Please visit Install CE to install 3.3 version or higher of server that supports edge functionality.

Edge provision on cloud

Additionally, you will need to provision ThingsBoard Edge on cloud server. Please follow Step 1 first if you skipped it.

Once ThingsBoard Edge provisioned on cloud server please follow installation steps below.

Edge hardware requirements

Hardware requirements depend on an amount of devices connected to the edge and GUI usage locally.

To run ThingsBoard Edge without heavily usage of GUI (local dashboards, device management etc.) and relatively small amount of devices (under 100) on a single machine you will need at least 1GB of RAM.

To run ThingsBoard Edge with heavily usage of GUI (local dashboards, device management etc.) and with 100+ devices on a single machine we recommend having at least 4GB of RAM.

Step 1. Install Java 11 (OpenJDK)

ThingsBoard基于Java11运行按照以下说明安装OpenJDK 11。

  • 访问Open JDK页面下载最新的OpenJDK 11(LTS) MSI软件包
  • 运行下载的MSI软件包勾选”Add to PATH“和”Set JAVA_HOME variable“选项进行安装
  • 访问PostgreSQL JDBC页面下载驱动程序
  • 复制C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot\jre\lib\ext路径添加CLASSPATH变量值为“C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot\jre\lib\ext\postgresql-42.2.18.jar”
  • 如果jre路径不存在“C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot”请创建文件夹

可以使用以下命令(使用命令提示符)检查安装:

1
java -version

命令输出结果:

1
2
3
4
C:\Users\User>java -version
openjdk version "11.0.xx"
OpenJDK Runtime Environment (AdoptOpenJDK)(...)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(...)

Step 2. Configure PostgreSQL

ThingsBoard Edge uses PostgreSQL database as a local storage.

PostgreSQL Installation

Download the installation file (PostgreSQL 11.7 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://github.com/thingsboard/thingsboard-edge/releases/download/v3.5.1/tb-edge-windows-3.5.1.zip

Note: We assume you have unzipped package to default location: C:\Program Files (x86)\tb-edge

Step 4. Configure ThingsBoard Edge

以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标,然后选择“以管理员身份运行”)。
打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”,编码为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

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 version is running:

  • Use demo.thingsboard.io if you are connecting edge to ThingsBoard Live Demo for evaluation.

  • 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
# 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}"

If ThingsBoard Edge is going to be running on the same machine where ThingsBoard ThingsBoard server is running you’ll need to update additional configuration parameters to avoid port collision.

Please locate and change next parameters in ThingsBoard Edge configuration file (C:\Program Files (x86)\tb-edge\conf\tb-edge.yml):


port: “${HTTP_BIND_PORT:18080}”

bind_port: “${MQTT_BIND_PORT:11883}”

bind_port: “${COAP_BIND_PORT:15683}”

bind_port: “${LWM2M_ENABLED:false}”

Please make sure ports above are not used by any other application.

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! 以管理员身份打开命令提示符并执行以下命令:

1
net start tb-edge

执行输出结果:

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.

Use next Edge UI URL if during installation process you set HTTP_BIND_PORT to 18080:

http://localhost:18080

Please use your tenant credentials from local cloud instance or ThingsBoard Live Demo 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”:

image

  • Click “Advanced settings” on the left panel:

image

  • Select “Inbound Rules” on the left panel, then click “New Rule…” on the right “Actions” panel:

image

  • Now new “New Inbound Rule Wizard” window will open. On the first step “Rule Type” select “Port” option:

image

  • On the “Protocol and Ports” step select “TCP” protocol and enter port list 8080, 1883, 5683 in the “Specific local ports” field:

image

  • On the “Action” step leave “Allow the connection” option selected:

image

  • On the “Profile” step select Windows network profiles when to apply this rule:

image

  • Finally, give the name to this rule (for ex. “ThingsBoard Service Networking”) and click “Finish”.

image

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: