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

国外开源IoT平台Thingsboard社区版本源码编译及运行指南

    • 1 下载
    • 2 软件环境及版本
      • 2.1 系统环境
      • 2.2 数据库环境
      • 2.3 前端环境
      • 2.4 编译环境
      • 2.5 应用环境
    • 3 编译
    • 4 运行
    • 5 访问Thingsboard
      • 5.1 登录
      • 5.2 输入账户名及密码
      • 5.3 创建租户账号
        • 5.3.1 创建租户
        • 5.3.2 创建租户管理员
      • 5.4 租户登录
      • 5.5 导入规则引擎
        • 5.5.1 导入规则链
        • 5.5.1 选择规则链文件
      • 5.6 设备配置
      • 5.7 MQTT测试
    • 6 博主其它相关博客

Thingsboard支持的协议有:

  • MQTT
  • COAP
  • HTTP

1 下载

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

git clone [email protected]: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,耐心等待即可。
编译完成后的文件结构为:
国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第1张图片
详细目录树状结构为:

├─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 运行

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

  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个表
    国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第3张图片
    2. 上图中序号为3的批处理文件作用是将服务删除,但是数据库没有删掉,所以要想再次安装程序时,需要将数据库删掉,否则会报错。
    3. 通过命令行启动服务时,发现出错,如下图所示,
    在这里插入图片描述
    原因是找不到类路径。(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
界面是:
国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第4张图片

5.2 输入账户名及密码

Thingsboard提供了一个系统管理员账号。
用户名为:[email protected]
密码为:sysadmin
国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第5张图片

5.3 创建租户账号

5.3.1 创建租户

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

5.3.2 创建租户管理员

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

5.4 租户登录

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

5.5 导入规则引擎

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

5.5.1 导入规则链

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

5.5.1 选择规则链文件

国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第10张图片
规则链如图所示:
国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第11张图片

5.6 设备配置

国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第12张图片
规则链详情为:
国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第13张图片

5.7 MQTT测试

使用工具MQTTX软件测试MQTT消息上传至Thingsboard平台。
访问URL为:127.0.0.1:1883
访问TOPIC为:v1/devices/me/telemetry
国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第14张图片
在设备详情页中能看到上传的遥测数据表示上传成功。
国外开源IoT平台Thingsboard社区版本(V3.3.2)在Win10环境下进行源码编译及运行指南_第15张图片

6 博主其它相关博客

【1】基于开源物联网软件Thingsboard设计的气象六要素展示界面
【2】开源物联网平台ThingsBoard数据库设计一览

你可能感兴趣的:(#,Java,iot,postgresql,thingsboard,mqtt,coap)