LEAPS 服务器
LEAPS服务器是UWB网络的中央数据中心。它通过 MQTT代理 将所有 LEAPS 网关 设备与世界互连.
主要功能
它作为上行链路数据集中器、下行链路数据路由器、数据处理器、位置引擎、设备管理、设备访问控制和服务质量。
它通过连接器与世界通信。目前,支持的连接器是MQTT,包括对AWS的支持。
LEAPS 服务器 在Linux平台上作为守护进程服务运行。
安装
系统要求
注解
Docker的系统要求因操作系统而异.
对于Linux,您需要一个64位架构、兼容的内核版本和特定的内核功能。
在Windows上,在启用虚拟化的Windows 10上使用Docker Desktop。
在macOS上,将Docker Desktop与macOS 10.13或更高版本一起使用。在硬件方面,建议至少有2GB的RAM,以及足够的CPU和磁盘空间。
请参考 Docker 官方文件,了解最新细节。
说明
在电脑上安装 Docker
此外,您还可以参考以下命令进行安装:
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh ./get-docker.sh sudo usermod -aG docker $USER
创建文件夹
leaps_server_hub
和子文件夹data
。然后,在leaps_server_hub/data
中添加leaps-server.conf
配置文件。
####################################################################### # LEAPS Server settings # # ----------------------------------------------------------------- # Logging # ----------------------------------------------------------------- log_level = 0 # Logging level, default is 0 (0=none, 1=fatal, 2=error, 3=warning, 4=info, 5=debug, 6=verbose) # Path to log file. Comment out to disable logging to file (log to stdio instead). # log = leaps-server.log # ----------------------------------------------------------------- # Certificate based SSL/TLS support # ----------------------------------------------------------------- # # cafile - Authority certificates that have signed your server certificate. # certfile - Path to the PEM encoded server certificate. # keyfile - Path to the PEM encoded keyfile. # gw_auth - When using TLS on the interface with the gateways, this parameter configures TLS authentication between server and the gateway (0=server 1=mutual). # # cafile = /etc/leaps-server/cacert.pem # certfile = /etc/leaps-server/servercert.pem # keyfile = /etc/leaps-server/serverkey.pem # gw_auth = 0 # Optional AES 128-bit private key as hexadecimal number. If specified, the key is used to encrypt sensitive data # for example the WiFi password published on the MQTT interface. # aes_128_key = 00112233445566778899aabbccddeeff # ----------------------------------------------------------------- # MQTT Broker # ----------------------------------------------------------------- # MQTT API variant "pans" or "leaps" mqtt_api = leaps # include network ID (panid) in the MQTT topics mqtt_with_panid = true # Specifies an alias for particular UWB network that is then used in the MQTT topic instead of the network ID (pan ID) . # Parameter can be used multiple times and there might be multiple definitions separated by spaces which are then added to the list of known aliases. # Alias definitions must follow format <ID>:<ALIAS_STRING>. Multiple definitions must be separated with spaces. # Network ID (PAN ID) can be hexadecimal number (withe prefix \"0x\") or decimal number. # mqtt_panid_alias = [123:NetworkA] [0x0002:Net B] # mqtt_panid_alias = [0XABCD:Network_C] mqtt_clid = 1 mqtt_port = 1883 mqtt_host = localhost # Or your Computer's IP Address # For LEAPS RTLS mqtt_user = leaps mqtt_password = leapspass mqtt_topic_prefix = leaps # For PANS PRO RTLS # mqtt_user = dwmuser # mqtt_password = dwmpass # mqtt_topic_prefix = dwm # Certificates used on MQTT interface # mqtt_cafile = /etc/leaps-server/cacert.pem # mqtt_certfile = /etc/leaps-server/servercert.pem # mqtt_keyfile = /etc/leaps-server/serverkey.pem # Period in seconds after which all retained topics are published regardless # whether the content has changed or not. Disabled when set to 0. Disabled by default. #mqtt_refresh = 0 # ----------------------------------------------------------------- # Secondary MQTT Broker # ----------------------------------------------------------------- # # mqtt_clid_sec = 2 # mqtt_port_sec = 1883 # mqtt_host_sec = # For PANS PRO RTLS # mqtt_user_sec = dwmuser # mqtt_password_sec = dwmpass # Certificates used on MQTT interface # mqtt_cafile_sec = /etc/leaps-server/cacert.pem # mqtt_certfile_sec = /etc/leaps-server/servercert.pem # mqtt_keyfile_sec = /etc/leaps-server/serverkey.pem # ----------------------------------------------------------------- # TCP # ----------------------------------------------------------------- # tcp_port = 7777 # ----------------------------------------------------------------- # Tag location statistics # ----------------------------------------------------------------- # Enable calculation of tag location statistics. Default is false. # loc_stats_enable = true # History window for calculation of tag location statistics. Default is 100. # loc_stats_history_window = 100 # ----------------------------------------------------------------- # Other # ----------------------------------------------------------------- # maximum number of attempts of configuration and service commands # cmd_att = 3
在电脑上打开命令提示符或终端窗口.
导航到创建配置文件的文件夹。
例如,在 Ubuntu (Linux) 上:
cd leaps_server_hub/
安装 LEAPS 服务器 Docker 软件包并运行:
docker run -d -p 7777:7777/tcp -p 7777:7777/udp --name some_name -v /path/to/data/data/:/app/data/ leapslabs/leaps_server:tag /app/leaps-server --cfg /app/data/leaps-server.conf
其中
some_name
是您要分配给容器的名称,tag
是指定您想要的leaps-server
版本的标签。leaps_server实例正在使用端口“7777”与 LEAPS 网关 进行
TCP
和UDP
通信,因此需要使用命令-p 777777:7777/TCP-p 77779/UDP
将这些端口从主机重新映射到leaps_server实例。除非需要,否则不建议更改端口号。如果需要修改,请相应地调整 LEAPS 网关 上的端口设置。
推荐的运行选项
--user $(id -u):$(id -g)
在特定用户和组下运行实例.
--除非停止否则重新启动
自动重新启动实例,以防服务器崩溃。
LEAPS服务器安装过程将开始。
例如,在 Ubuntu (Linux) 上:
docker run -d -p 7777:7777/tcp -p 7777:7777/udp --name leaps_server -v "$(pwd)"/data/:/app/data leapslabs/leaps_server:latest /app/leaps-server --cfg /app/data/leaps-server.conf Unable to find image 'leapslabs/lc_server:latest' locally latest: Pulling from leapslabs/lc_server a458657ccc71: Pull complete Digest: sha256:a19b127656d41d8607f043c2c83924e5b9a5cbd4dc23cfbed070be3b9cfc6b9a Status: Downloaded newer image for leapslabs/lc_server:latest 320d3768289874e063619f75faca7a24dd75a08884df8cd8fb2cc9b54c6f0a46
确认安装成功,运行:
例如,在 Ubuntu (Linux) 上:
docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b1145b72db35 leapslabs/lc_server:latest "sh -c 'cd /app && …" 37 seconds ago 11 seconds ago lc_server
因此,您已经在PC上成功安装并启动了LEAPS服务器。
开始
LEAPS 服务器 Docker
启动LEAPS服务器,运行:
docker Start lc_Server
停止LEAPS服务器,运行:
docker Stop lc_Server
重启LEAPS服务器,运行:
docker Restart lc_Server
删除LEAPS服务器,运行
docker rm--force lc_Server
网络配置
MQTT API变体 “pans” 或 “leaps”
将LEAPS ID添加到已发布的主题中
mqtt_with_panid = true mqtt_clid = 1 mqtt_port = 1883 mqtt_host = localhost # Or your Computer's IP Address
LEAPS RTLS帐户配置
mqtt_user = leapsuser mqtt_password = leapspass mqtt_topic_prefix = leaps
TCP端口为7777