国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南

本文涉及的产品
云原生数据库 PolarDB PostgreSQL 版,标准版 2核4GB 50GB
云原生数据库 PolarDB MySQL 版,通用型 2核4GB 50GB
简介: 国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南

Thingsboard支持的协议有:

  • MQTT
  • COAP
  • HTTP


1 下载


使用git进行下载Thingsboard最新源码

git clone git@github.com:thingsboard/thingsboard.git

2 软件环境及版本


2.1 系统环境


  • OS:Windows10
  • JDK:OpenJDK11(必须使用该版本,其它容易出错误)


从其镜像的Docker命令中可以看到其运行的版本

/bin/sh -c ln -svT "/usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)" /docker-java-home

2.2 数据库环境


Postgresql:11(默认用户名为:postgres,密码为:postgres)

安装链接,操作系统对应的Postgresql版本各不相同,请下载相应版本。安装完成后,创建数据库thingsboard。


2.3 前端环境


ndoe:v14.15.5

yarn:1.22.10


2.4 编译环境


Maven:3.6.3


2.5 应用环境


Thingsboard:3.3.2-SNAPSHOT


3 编译


对于刚下载的源码直接跳过监测进行安装即可


mvn install -DskipTests

安装时间稍长,笔者用了约12mins,耐心等待即可。

编译完成后的文件结构为:

1666242410836.jpg

详细目录树状结构为:


├─conf        项目配置文件
│  ├─i18n
│  └─templates
├─data        项目数据文件,内含规则链相关数据库数据,执行安装时会用到
│  ├─cassandra
│  ├─certs
│  │  └─azure
│  ├─json
│  │  ├─demo
│  │  │  └─dashboards
│  │  ├─system        系统文件夹
│  │  │  ├─oauth2_config_templates
│  │  │  └─widget_bundles
│  │  └─tenant        租户文件夹
│  │      ├─device_profile
│  │      ├─edge_management
│  │      │  └─rule_chains
│  │      └─rule_chains         
│  ├─sql              postgresql数据库文件,初始化数据库使用
│  └─upgrade          postgresql数据库文件,升级数据库使用(笔者还没体验过)
│      ├─1.3.0
│      ├─1.3.1
│      ├─1.4.0
│      ├─2.0.0
│      ├─2.1.1
│      ├─2.1.2
│      ├─2.2.0
│      ├─2.3.1
│      ├─2.4.0
│      ├─2.4.2
│      ├─2.4.3
│      ├─3.0.1
│      ├─3.1.0
│      ├─3.1.1
│      ├─3.2.1
│      └─3.2.2
├─install      安装项目时日志配置文件
├─lib          项目jar包       
└─logs         各种日志文件

4 运行


1666242441625.jpg

1.双击上图中序号为1的批处理文件,执行Thingsboard软件的安装及数据库的初始化,本质就是将thingsboard.exe其注册为一个服务,详细指令如下所示。


@ECHO OFF
setlocal ENABLEEXTENSIONS
@ECHO Detecting Java version installed.
:CHECK_JAVA
for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "jver=%%j%%k"
@ECHO CurrentVersion %jver%
if %jver% NEQ 110 GOTO JAVA_NOT_INSTALLED
:JAVA_INSTALLED
@ECHO Java 11 found!
@ECHO Installing thingsboard ...
SET loadDemo=false
if "%1" == "--loadDemo" (
    SET loadDemo=true
)
SET BASE=%~dp0
SET LOADER_PATH=%BASE%\conf,%BASE%\extensions
SET SQL_DATA_FOLDER=%BASE%\data\sql
SET jarfile=%BASE%\lib\thingsboard.jar
SET installDir=%BASE%\data
PUSHD "%BASE%\conf"
java -cp "%jarfile%" -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication^
                    -Dinstall.data_dir="%installDir%"^
                    -Dinstall.load_demo=%loadDemo%^
                    -Dspring.jpa.hibernate.ddl-auto=none^
                    -Dinstall.upgrade=false^
                    -Dlogging.config="%BASE%\install\logback.xml"^
                    org.springframework.boot.loader.PropertiesLauncher
if errorlevel 1 (
   @echo ThingsBoard installation failed!
   POPD
   exit /b %errorlevel%
)
POPD
"%BASE%"thingsboard.exe install
@ECHO ThingsBoard installed successfully!
GOTO END
:JAVA_NOT_INSTALLED
@ECHO Java 11 is not installed. Only Java 11 is supported
@ECHO Please go to https://adoptopenjdk.net/index.html and install Java 11. Then retry installation.
PAUSE
GOTO END
:END

数据库结果为:共计40个表

1666242483153.jpg

2. 上图中序号为3的批处理文件作用是将服务删除,但是数据库没有删掉,所以要想再次安装程序时,需要将数据库删掉,否则会报错。

3. 通过命令行启动服务时,发现出错,如下图所示,

1666242497973.jpg

原因是找不到类路径。(TODO:后续解决)

因此就是用java命令进行运行,去掉不能识别的参数-Dinstall.data_dir=F:\respository\thingsboard\application\target\thingsboard-windows\thingsboard\data,命令是:


java -Dplatform=windows  -Xlog:gc*,heap*,age*,safepoint=debug:file=F:\respository\thingsboard\application\target\thingsboard-windows\thingsboard\logs\gc.log:time,uptime,level,tags:filecount=10,filesize=10M -XX:+HeapDumpOnOutOfMemoryError -XX:-UseBiasedLocking -XX:+UseTLAB -XX:+ResizeTLAB -XX:+PerfDisableSharedMem -XX:+UseCondCardMark -XX:+UseG1GC -XX:MaxGCPauseMillis=500 -XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled -XX:MaxTenuringThreshold=10 -Xms512m -Xmx1024m -jar F:\respository\thingsboard\application\target\thingsboard-windows\thingsboard\lib\thingsboard.jar

运行日志部分为;


2021-09-30 17:21:13.524  INFO 41488 --- [           main] o.t.s.a.service.DefaultActorService      : Initializing actor system.
2021-09-30 17:21:13.576  INFO 41488 --- [           main] o.t.s.a.service.DefaultActorService      : Actor system initialized.
2021-09-30 17:21:13.976  INFO 41488 --- [           main] o.t.s.c.t.adaptor.JsonConverterConfig    : JSON type cast enabled = true
2021-09-30 17:21:13.977  INFO 41488 --- [           main] o.t.s.c.t.adaptor.JsonConverterConfig    : JSON max string value length = 0
2021-09-30 17:21:14.059  INFO 41488 --- [           main] o.t.s.t.mqtt.MqttTransportService        : Setting resource leak detector level to DISABLED
2021-09-30 17:21:14.060  INFO 41488 --- [           main] o.t.s.t.mqtt.MqttTransportService        : Starting MQTT transport...
2021-09-30 17:21:15.141  INFO 41488 --- [           main] o.t.s.t.mqtt.MqttTransportService        : Mqtt transport started!
2021-09-30 17:21:15.197  INFO 41488 --- [           main] o.e.c.core.network.RandomTokenGenerator  : using tokens of 8 bytes in length
2021-09-30 17:21:15.217  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : coap CoapEndpoint uses udp plain
2021-09-30 17:21:15.229  INFO 41488 --- [           main] o.e.c.core.network.stack.BlockwiseLayer  : BlockwiseLayer uses MAX_MESSAGE_SIZE=1024, PREFERRED_BLOCK_SIZE=1024, BLOCKWISE_STATUS_LIFETIME=300000, MAX_RESOURCE_BODY_SIZE=268435456, BLOCKWISE_STRICT_BLOCK2_OPTION=true
2021-09-30 17:21:15.233  INFO 41488 --- [           main] o.e.c.c.network.stack.ReliabilityLayer   : ReliabilityLayer uses ACK_TIMEOUT=2000, ACK_RANDOM_FACTOR=1.5, and ACK_TIMEOUT_SCALE=2.0 as default
2021-09-30 17:21:15.239  INFO 41488 --- [           main] org.eclipse.californium.core.CoapServer  : Starting server
2021-09-30 17:21:15.254  INFO 41488 --- [           main] o.e.californium.elements.UDPConnector    : UDPConnector starts up 8 sender threads and 8 receiver threads
2021-09-30 17:21:15.260  INFO 41488 --- [           main] o.e.californium.elements.UDPConnector    : UDPConnector listening on 0.0.0.0/0.0.0.0:5683, recv buf = 65536, send buf = 65536, recv packet size = 2048
2021-09-30 17:21:15.260  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : coap Started endpoint at coap://0.0.0.0:5683
2021-09-30 17:21:15.282  INFO 41488 --- [           main] o.t.s.t.coap.CoapTransportService        : Starting CoAP transport...
2021-09-30 17:21:15.290  INFO 41488 --- [           main] o.t.s.t.coap.CoapTransportService        : CoAP transport started!
2021-09-30 17:21:15.454  INFO 41488 --- [           main] t.s.t.l.b.LwM2MTransportBootstrapService : Starting LwM2M transport bootstrap server...
2021-09-30 17:21:16.004  INFO 41488 --- [           main] o.e.c.core.network.RandomTokenGenerator  : using tokens of 8 bytes in length
2021-09-30 17:21:16.005  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : [LWM2M BS Server-coap://] CoapEndpoint uses udp plain
2021-09-30 17:21:16.007  INFO 41488 --- [           main] o.e.c.core.network.stack.BlockwiseLayer  : BlockwiseLayer uses MAX_MESSAGE_SIZE=1024, PREFERRED_BLOCK_SIZE=1024, BLOCKWISE_STATUS_LIFETIME=300000, MAX_RESOURCE_BODY_SIZE=268435456, BLOCKWISE_STRICT_BLOCK2_OPTION=true
2021-09-30 17:21:16.007  INFO 41488 --- [           main] o.e.c.c.network.stack.ReliabilityLayer   : ReliabilityLayer uses ACK_TIMEOUT=2000, ACK_RANDOM_FACTOR=1.5, and ACK_TIMEOUT_SCALE=2.0 as default
2021-09-30 17:21:16.036  INFO 41488 --- [           main] o.e.c.s.dtls.InMemoryConnectionStore     : Created new InMemoryConnectionStore [capacity: 150000, connection expiration threshold: 600s]
2021-09-30 17:21:16.040  INFO 41488 --- [           main] o.e.c.core.network.RandomTokenGenerator  : using tokens of 8 bytes in length
2021-09-30 17:21:16.040  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : [LWM2M BS Server-coaps://] CoapEndpoint uses lwm2m correlation
2021-09-30 17:21:16.041  INFO 41488 --- [           main] o.e.c.core.network.stack.BlockwiseLayer  : BlockwiseLayer uses MAX_MESSAGE_SIZE=1024, PREFERRED_BLOCK_SIZE=1024, BLOCKWISE_STATUS_LIFETIME=300000, MAX_RESOURCE_BODY_SIZE=268435456, BLOCKWISE_STRICT_BLOCK2_OPTION=true
2021-09-30 17:21:16.041  INFO 41488 --- [           main] o.e.c.c.network.stack.ReliabilityLayer   : ReliabilityLayer uses ACK_TIMEOUT=2000, ACK_RANDOM_FACTOR=1.5, and ACK_TIMEOUT_SCALE=2.0 as default
2021-09-30 17:21:16.057  INFO 41488 --- [           main] org.eclipse.californium.core.CoapServer  : Starting server
2021-09-30 17:21:16.059  INFO 41488 --- [           main] o.e.californium.elements.UDPConnector    : UDPConnector starts up 1 sender threads and 1 receiver threads
2021-09-30 17:21:16.059  INFO 41488 --- [           main] o.e.californium.elements.UDPConnector    : UDPConnector listening on 0.0.0.0/0.0.0.0:5687, recv buf = 65536, send buf = 65536, recv packet size = 2048
2021-09-30 17:21:16.060  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : [LWM2M BS Server-coap://] Started endpoint at coap://0.0.0.0:5687
2021-09-30 17:21:16.706  INFO 41488 --- [           main] o.e.californium.scandium.DTLSConnector   : multiple network interfaces, using smallest MTU [IPv4 1400, IPv6 1400]
2021-09-30 17:21:16.708  INFO 41488 --- [           main] o.e.californium.scandium.DTLSConnector   : DTLSConnector listening on 0.0.0.0/0.0.0.0:5688, recv buf = 65536, send buf = 65536, recv packet size = 16490, MTU = IPv4 1400 / IPv6 1400
2021-09-30 17:21:16.708  INFO 41488 --- [.0/0.0.0.0:5688] o.e.californium.scandium.DTLSConnector   : Starting worker thread [DTLS-Receiver-0-0.0.0.0/0.0.0.0:5688]
2021-09-30 17:21:16.708  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : [LWM2M BS Server-coaps://] Started endpoint at coaps://0.0.0.0:5688
2021-09-30 17:21:16.708  INFO 41488 --- [.0/0.0.0.0:5688] o.e.californium.scandium.DTLSConnector   : Starting worker thread [DTLS-Receiver-2-0.0.0.0/0.0.0.0:5688]
2021-09-30 17:21:16.708  INFO 41488 --- [.0/0.0.0.0:5688] o.e.californium.scandium.DTLSConnector   : Starting worker thread [DTLS-Receiver-1-0.0.0.0/0.0.0.0:5688]
2021-09-30 17:21:16.708  INFO 41488 --- [.0/0.0.0.0:5688] o.e.californium.scandium.DTLSConnector   : Starting worker thread [DTLS-Receiver-3-0.0.0.0/0.0.0.0:5688]
2021-09-30 17:21:16.708  INFO 41488 --- [           main] o.e.l.s.c.b.LeshanBootstrapServer        : Bootstrap server started at coap://0.0.0.0/0.0.0.0:5687 coaps://0.0.0.0/0.0.0.0:5688
2021-09-30 17:21:16.708  INFO 41488 --- [           main] t.s.t.l.b.LwM2MTransportBootstrapService : Started LwM2M transport bootstrap server.
2021-09-30 17:21:16.781  INFO 41488 --- [           main] o.e.c.core.network.RandomTokenGenerator  : using tokens of 8 bytes in length
2021-09-30 17:21:16.781  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : [LWM2M Server-coap://] CoapEndpoint uses udp plain
2021-09-30 17:21:16.782  INFO 41488 --- [           main] o.e.c.core.network.stack.BlockwiseLayer  : BlockwiseLayer uses MAX_MESSAGE_SIZE=1024, PREFERRED_BLOCK_SIZE=1024, BLOCKWISE_STATUS_LIFETIME=300000, MAX_RESOURCE_BODY_SIZE=268435456, BLOCKWISE_STRICT_BLOCK2_OPTION=true
2021-09-30 17:21:16.782  INFO 41488 --- [           main] o.e.c.c.network.stack.ReliabilityLayer   : ReliabilityLayer uses ACK_TIMEOUT=2000, ACK_RANDOM_FACTOR=1.5, and ACK_TIMEOUT_SCALE=2.0 as default
2021-09-30 17:21:16.782  INFO 41488 --- [           main] o.e.c.s.dtls.InMemoryConnectionStore     : Created new InMemoryConnectionStore [capacity: 150000, connection expiration threshold: 600s]
2021-09-30 17:21:16.783  INFO 41488 --- [           main] o.e.c.core.network.RandomTokenGenerator  : using tokens of 8 bytes in length
2021-09-30 17:21:16.783  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : [LWM2M Server-coaps://] CoapEndpoint uses lwm2m correlation
2021-09-30 17:21:16.783  INFO 41488 --- [           main] o.e.c.core.network.stack.BlockwiseLayer  : BlockwiseLayer uses MAX_MESSAGE_SIZE=1024, PREFERRED_BLOCK_SIZE=1024, BLOCKWISE_STATUS_LIFETIME=300000, MAX_RESOURCE_BODY_SIZE=268435456, BLOCKWISE_STRICT_BLOCK2_OPTION=true
2021-09-30 17:21:16.783  INFO 41488 --- [           main] o.e.c.c.network.stack.ReliabilityLayer   : ReliabilityLayer uses ACK_TIMEOUT=2000, ACK_RANDOM_FACTOR=1.5, and ACK_TIMEOUT_SCALE=2.0 as default
2021-09-30 17:21:16.805  INFO 41488 --- [           main] o.t.s.t.l.s.DefaultLwM2mTransportService : Starting LwM2M transport server...
2021-09-30 17:21:16.809  INFO 41488 --- [           main] org.eclipse.californium.core.CoapServer  : Starting server
2021-09-30 17:21:16.811  INFO 41488 --- [           main] o.e.californium.elements.UDPConnector    : UDPConnector starts up 1 sender threads and 1 receiver threads
2021-09-30 17:21:16.812  INFO 41488 --- [           main] o.e.californium.elements.UDPConnector    : UDPConnector listening on 0.0.0.0/0.0.0.0:5685, recv buf = 65536, send buf = 65536, recv packet size = 2048
2021-09-30 17:21:16.813  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : [LWM2M Server-coap://] Started endpoint at coap://0.0.0.0:5685
2021-09-30 17:21:16.813  INFO 41488 --- [           main] o.e.californium.scandium.DTLSConnector   : multiple network interfaces, using smallest MTU [IPv4 1400, IPv6 1400]
2021-09-30 17:21:16.815  INFO 41488 --- [.0/0.0.0.0:5686] o.e.californium.scandium.DTLSConnector   : Starting worker thread [DTLS-Receiver-0-0.0.0.0/0.0.0.0:5686]
2021-09-30 17:21:16.815  INFO 41488 --- [.0/0.0.0.0:5686] o.e.californium.scandium.DTLSConnector   : Starting worker thread [DTLS-Receiver-3-0.0.0.0/0.0.0.0:5686]
2021-09-30 17:21:16.815  INFO 41488 --- [.0/0.0.0.0:5686] o.e.californium.scandium.DTLSConnector   : Starting worker thread [DTLS-Receiver-1-0.0.0.0/0.0.0.0:5686]
2021-09-30 17:21:16.815  INFO 41488 --- [.0/0.0.0.0:5686] o.e.californium.scandium.DTLSConnector   : Starting worker thread [DTLS-Receiver-2-0.0.0.0/0.0.0.0:5686]
2021-09-30 17:21:16.815  INFO 41488 --- [           main] o.e.californium.scandium.DTLSConnector   : DTLSConnector listening on 0.0.0.0/0.0.0.0:5686, recv buf = 65536, send buf = 65536, recv packet size = 16490, MTU = IPv4 1400 / IPv6 1400
2021-09-30 17:21:16.816  INFO 41488 --- [           main] o.e.c.core.network.CoapEndpoint          : [LWM2M Server-coaps://] Started endpoint at coaps://0.0.0.0:5686
2021-09-30 17:21:16.816  INFO 41488 --- [           main] o.e.l.server.californium.LeshanServer    : LWM2M server started at coap://0.0.0.0/0.0.0.0:5685 coaps://0.0.0.0/0.0.0.0:5686
2021-09-30 17:21:16.818  INFO 41488 --- [           main] o.t.s.t.l.s.DefaultLwM2mTransportService : Started LwM2M transport server.
2021-09-30 17:21:17.281  INFO 41488 --- [           main] o.t.s.t.s.service.SnmpTransportService   : SNMP transport service initialized
2021-09-30 17:21:17.313  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: zookeeper.version=3.5.5-390fe37ea45dee01bf87dc1c042b5e3dcce88653, built on 05/03/2019 12:07 GMT
2021-09-30 17:21:17.313  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: host.name=host.docker.internal
2021-09-30 17:21:17.313  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: java.version=11.0.12
2021-09-30 17:21:17.313  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: java.vendor=Eclipse Foundation
2021-09-30 17:21:17.313  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: java.home=D:\jdk11open
2021-09-30 17:21:17.313  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: java.class.path=F:\respository\thingsboard\application\target\thingsboard-windows\thingsboard\lib\thingsboard.jar
2021-09-30 17:21:17.313  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: java.library.path=D:\jdk11open\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\VMware\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Git\cmd;D:\xshell7\;D:\mysql5.7.31\bin;D:\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Yarn\bin\;D:\curl-7.76.0-win64-mingw\bin;D:\mingw64\mingw64\bin;D:\python3.7.0;D:\python3.7.0\Scripts;D:\jdk11open\bin;D:\gradle-6.8.2\bin;D:\scala\bin;D:\sbt\bin;%KE_HOME\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;D:\apache-maven-3.6.3\bin;C:\Users\86134\AppData\Local\Microsoft\WindowsApps;D:\bandzip7\;C:\Users\86134\AppData\Roaming\npm;C:\Users\86134\AppData\Local\gitkraken\bin;.
2021-09-30 17:21:17.314  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: java.io.tmpdir=C:\Users\86134\AppData\Local\Temp\
2021-09-30 17:21:17.314  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: java.compiler=<NA>
2021-09-30 17:21:17.314  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: os.name=Windows 10
2021-09-30 17:21:17.314  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: os.arch=amd64
2021-09-30 17:21:17.314  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: os.version=10.0
2021-09-30 17:21:17.314  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: user.name=张博康
2021-09-30 17:21:17.315  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: user.home=C:\Users\86134
2021-09-30 17:21:17.315  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: user.dir=C:\WINDOWS\system32
2021-09-30 17:21:17.315  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: os.memory.free=208MB
2021-09-30 17:21:17.315  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: os.memory.max=1024MB
2021-09-30 17:21:17.315  INFO 41488 --- [           main] o.t.s.q.e.EnvironmentLogService          : ThingsBoard server environment: os.memory.total=512MB
2021-09-30 17:21:17.903  INFO 41488 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint(s) beneath base path '/actuator'
2021-09-30 17:21:18.437  INFO 41488 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/*.js'], []
2021-09-30 17:21:18.437  INFO 41488 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/*.css'], []
2021-09-30 17:21:18.438  INFO 41488 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/*.ico'], []
2021-09-30 17:21:18.439  INFO 41488 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/assets/**'], []
2021-09-30 17:21:18.439  INFO 41488 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/static/**'], []
2021-09-30 17:21:18.687  INFO 41488 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@3d1703f8, org.springframework.security.web.context.SecurityContextPersistenceFilter@55880c, org.springframework.security.web.header.HeaderWriterFilter@241861bc, org.springframework.web.filter.CorsFilter@48928b57, org.springframework.security.web.authentication.logout.LogoutFilter@2197990b, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter@4973fb7d, org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter@34c3e307, org.thingsboard.server.service.security.auth.rest.RestLoginProcessingFilter@3986b9e9, org.thingsboard.server.service.security.auth.rest.RestPublicLoginProcessingFilter@6ddbbfbb, org.thingsboard.server.service.security.auth.jwt.JwtTokenAuthenticationProcessingFilter@2d492d46, org.thingsboard.server.service.security.auth.jwt.RefreshTokenProcessingFilter@4f629aa4, org.thingsboard.server.service.security.auth.jwt.JwtTokenAuthenticationProcessingFilter@f348e10, org.thingsboard.server.config.RateLimitProcessingFilter@22d47f09, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@1ac9c3cc, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@6cf47d05, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@7bb78381, org.springframework.security.web.session.SessionManagementFilter@2045a469, org.springframework.security.web.access.ExceptionTranslationFilter@74ee07e, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@36d8ddc5]
2021-09-30 17:21:18.757  INFO 41488 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService 'taskScheduler'
2021-09-30 17:21:19.378  INFO 41488 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page: class path resource [public/index.html]
2021-09-30 17:21:21.043  INFO 41488 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2021-09-30 17:21:21.043  INFO 41488 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'application.errorChannel' has 1 subscriber(s).
2021-09-30 17:21:21.043  INFO 41488 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started bean '_org.springframework.integration.errorLogger'
2021-09-30 17:21:21.094  INFO 41488 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2021-09-30 17:21:21.095  INFO 41488 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed

5 访问Thingsboard


5.1 登录


登录页面URL为:http://127.0.0.1:8080/login

界面是:

1666242600344.jpg


5.2 输入账户名及密码


Thingsboard提供了一个系统管理员账号。

用户名为:sysadmin@thingsboard.org

密码为:sysadmin

1666242619062.jpg


5.3 创建租户账号


5.3.1 创建租户

1666242637468.jpg


5.3.2 创建租户管理员

1666242652542.jpg

5.4 租户登录

1666242668476.jpg



5.5 导入规则引擎


不导入,解析数据时出错。


5.5.1 导入规则链

1666242710898.jpg


5.5.2 选择规则链文件

规则链如图所示:

1666242750709.jpg


5.6 设备配置

1666242765312.jpg

规则链详情为:

1666242780572.jpg


5.7 MQTT测试


使用工具MQTTX软件测试MQTT消息上传至Thingsboard平台。

访问URL为:127.0.0.1:1883

访问TOPIC为:v1/devices/me/telemetry

1666242797159.jpg

在设备详情页中能看到上传的遥测数据表示上传成功。

1666242809689.jpg

相关实践学习
通过Ingress进行灰度发布
本场景您将运行一个简单的应用,部署一个新的应用用于新的发布,并通过Ingress能力实现灰度发布。
容器应用与集群管理
欢迎来到《容器应用与集群管理》课程,本课程是“云原生容器Clouder认证“系列中的第二阶段。课程将向您介绍与容器集群相关的概念和技术,这些概念和技术可以帮助您了解阿里云容器服务ACK/ACK Serverless的使用。同时,本课程也会向您介绍可以采取的工具、方法和可操作步骤,以帮助您了解如何基于容器服务ACK Serverless构建和管理企业级应用。 学习完本课程后,您将能够: 掌握容器集群、容器编排的基本概念 掌握Kubernetes的基础概念及核心思想 掌握阿里云容器服务ACK/ACK Serverless概念及使用方法 基于容器服务ACK Serverless搭建和管理企业级网站应用
相关文章
|
3月前
|
XML 网络协议 物联网
基于surging的木舟IOT平台如何添加网络组件
【8月更文挑战第30天】在基于 Surging 的木舟 IOT 平台中添加网络组件需经历八个步骤:首先理解 Surging 及平台架构;其次明确组件需求,选择合适技术库;接着创建项目并配置;然后设计实现网络功能;再将组件集成至平台;接着进行详尽测试;最后根据反馈持续优化与维护。具体实施时应参照最新文档调整。
70 10
|
数据采集 小程序 前端开发
IoT小程序在展示中央空调采集数据和实时运行状态上的应用
IoT小程序框架在跨系统平台(AliOS Things、Ubuntu、Linux、MacOS、Window等)方面提供了非常优秀的基础能力,应用的更新升级提供了多种方式,在实际业务开发过程中可以灵活选择。IoT小程序框架通过JSAPI提供了调用系统底层应用的能力,同时提供了自定义JSAPI扩展封装的方法,这样就足够业务开发通过自定义的方式满足特殊的业务需求。 IoT小程序在前端框架能力、应用框架能力、图形框架能力都进行了适配和优化。那么接下来,我们按照其官方步骤搭建开发环境,然后结合中央空调数据采集和状态显示的实际应用场景开发物联网小程序应用。
23926 63
IoT小程序在展示中央空调采集数据和实时运行状态上的应用
|
小程序 JavaScript 物联网
搭建IoT小程序开发环境,创建一个应用
通过实验,了解阿里云IoT小程序应用的开发调试环境,以及如何创建新的应用并在PC模拟器上进行预览调试。
|
边缘计算 数据可视化 物联网
IOT 3000平台生态
IOT 3000平台生态
129 0
|
消息中间件 运维 监控
存量设备零改动,迁移阿里云IoT平台开发实战
存量设备零改动,迁移阿里云IoT平台开发实战
311 15
存量设备零改动,迁移阿里云IoT平台开发实战
|
JSON JavaScript 物联网
阿里云物联网IOT平台使用案例教程(模拟智能设备)
阿里云物联网IOT平台使用案例教程(模拟智能设备)
|
开发框架 物联网 云栖大会
阿里云IoT | HaaS开源百校科技助力计划 —— 开源大使招募
阿里云IoT | HaaS开源百校科技助力计划 —— 开源大使招募
241 0
|
物联网
《阿里云IoT – 平台赋能生态,加速企业智能升级》电子版地址
阿里云IoT – 平台赋能生态,加速企业智能升级
116 0
《阿里云IoT – 平台赋能生态,加速企业智能升级》电子版地址
|
边缘计算 人工智能 编解码
平头哥 YoC 平台——支持从芯片到云全链路高效设计的 IoT 全栈技术平台(四)| 学习笔记
快速学习平头哥 YoC 平台——支持从芯片到云全链路高效设计的 IoT 全栈技术平台
|
28天前
|
传感器 存储 物联网
在物联网(IoT)快速发展的今天,C语言作为物联网开发中的关键工具,以其高效、灵活、可移植的特点
在物联网(IoT)快速发展的今天,C语言作为物联网开发中的关键工具,以其高效、灵活、可移植的特点,广泛应用于嵌入式系统开发、通信协议实现及后端服务构建等领域,成为推动物联网技术进步的重要力量。
38 1