LEAPSサーバー

LEAPSサーバーはUWBネットワークの中央データハブです。すべての LEAPSゲートウェイ デバイスを、MQTT Broker を介して世界と相互接続します。


主な機能

  • アップリンクデータコンセントレータ、ダウンリンクデータルータ、データプロセッサ、位置情報エンジン、デバイス管理、デバイスアクセス制御、そしてQoS(Quality of Service)として機能します。

  • コネクタを介して世界と通信します。現在サポートされているコネクタは、AWSを含むMQTTです。

  • LEAPSサーバー は、Linuxプラットフォーム上でデーモンサービスとして動作します。


インストール

システム要件

注釈

Dockerのシステム要件は、オペレーティングシステムによって異なります。

  • Linuxの場合、64ビットアーキテクチャ、互換性のあるカーネルバージョン、および特定のカーネル機能が必要です。

  • Windowsでは、仮想化を有効にしたWindows 10でDocker Desktopを使用してください。

  • macOSでは、macOS 10.13以降でDocker Desktopを使用してください。ハードウェアに関しては、最低2GBのRAMに加え、十分なCPUとディスク容量が推奨されます。

最新の詳細については、Docker 公式ドキュメントを参照してください。


使用方法

  1. PCにDockerをインストールする

LinuxにDocker Desktopをインストールする

さらに、以下のコマンドを参考にしてインストールすることもできる:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh
sudo usermod -aG docker $USER
  1. leaps_server_hub フォルダとサブフォルダ data を作成します。次に、leaps_server_hub/dataleaps-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
  1. PCでコマンドプロンプトまたはターミナルウィンドウを開く。

  • 設定ファイルを作成したフォルダに移動します。

たとえば、Ubuntu (Linux) の場合:

cd leaps_server_hub/
  1. Install the LEAPS Server Docker packages, run:

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 インスタンスは、LEAPSゲートウェイ との TCP および UDP 通信にポート 7777 を使用しているため、コマンド -p 7777:7777/tcp -p 7777:7777/udp を使用して、これらのポートをホストから leaps_server インスタンスに再マッピングする必要があります。

必要がない限り、ポート番号を変更することは推奨されません。変更が必要な場合は、LEAPSゲートウェイ のポート設定を適宜調整してください。

  • 推奨される走行オプション

    • --user $(id -u):$(id -g) 特定のユーザーとグループの下でインスタンスを実行する。

    • --restart unless-stopped は、サーバーがクラッシュした場合に備えて、インスタンスを自動的に再起動します。

  1. 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
  1. インストールが成功したことを確認し、実行する:

たとえば、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 です。

トラブルシューティング

  • LEAPSサーバーを再起動するには、以下のコマンド docker restart leaps_server を使用します。

  • LEAPSサーバー 実行中のログを確認し、Docker デスクトップを開いて leaps_server コンテナを選択します。