LEAPS ゲートウェイ
LEAPS GatewayはUWBとTCP/IPネットワーク間のブリッジとして機能します。
主な機能
The LEAPS Gateway communicates on one side with the LEAPS UWBS via the generic LEAPS API, SPI, or USB and on the other side with the LEAPS Server via the TCP/IP.
Depending on the LEAPS UWB networking profile, it provides a medium for transferring the uplink and downlink location and telemetry data of the Anchors and Tags to and from the MQTT Broker.
UWBSとの相互接続は、専用のLEAPS Gateway組み込みデバイス上のSPIを介して行われます。LEAPS UWBSとの相互接続がUDK1デバイスのようにUSB経由で行われる場合、LEAPS GatewayはデーモンサービスとしてLinuxプラットフォーム上で動作します。
インストール
システム要件
Dockerのシステム要件はOSによって異なります。
For Linux, you need a 64-bit architecture, a compatible kernel version, and specific kernel features.
On Windows, use Docker Desktop on Windows 10 with virtualization enabled.
macOSの場合は、macOS 10.13以降のDocker Desktopを使用してください。ハードウェアに関しては、最低2GBのRAMと十分なCPUとディスク容量を推奨します。
注釈
最新の詳細については`Docker <https://docs.docker.com/>`_公式ドキュメントを参照してください。
使用方法
PCにDockerをインストールする
さらに、以下のコマンドを参考にしてインストールすることもできる:
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh ./get-docker.sh sudo usermod -aG docker $USER
Create folder
leaps_gateway_hub
and subfolderdata
. Then, add theleaps-gateway.conf
configuration file inleaps_gateway_hub/data
.
####################################################################### # LEAPS Gateway 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-file = leaps-gateway.log # LEAPS Server host # Default: localhost leaps-server-host = localhost # Or your Computer's IP Address # LEAPS Server port # Default: 7777 leaps-server-port = 7777 # ----------------------------------------------------------------- # UWBS USB Device VID/PID # ----------------------------------------------------------------- # # Vendor ID, default is 0x1915, possible values are (0x1915-Nordic, 0x04d8-Microchip) # Allowed values: 16-bit number in decimal, hexadecimal or octal format # uwbs-usb-dev-vid = 0x04d8 uwbs-usb-dev-vid = 0x1915 # Product ID, default is 0xe8e3 for LEAPS RTLS devices # Allowed values: 16-bit number in decimal, hexadecimal or octal format uwbs-usb-dev-pid = 0xe8e3 # ----------------------------------------------------------------- # UWBS device configurations # ----------------------------------------------------------------- # # Bridge mode # Allowed values: 0=Disable 1=Enable # Default: (keep-current) # uwbs-bridge = 0 # Initiator mode # Allowed values: 0=Disable 1=Enable # Default: (keep-current) # uwbs-initiator = 0 # UWBMAC Profile ID # Default: (keep-current) # uwbs-profile-id = 0 # LEDs mode # Allowed values: 0=Disable 1=Enable # Default: (keep-current) # uwbs-led = 1 # UWB encryption # Allowed values: 0=Disable 1=Enable # Default: (keep-current) # uwbs-enc = 0 # UWB firmware update # Allowed values: 0=Disable 1=Enable # Default: (keep-current) # uwbs-fwup = 0 # UWB mode # Allowed values: 0=Off 1=Passive 2=Active # Default: (keep-current) # uwbs-uwb = 2 # UWB Backhaul Routing # Allowed values: 0=Off 1=On 2=Auto # Default: (keep-current) uwbs-bh = 1 # BLE # Allowed values: 0=Off 1=On # Default: (keep-current) # uwbs-ble = 1 # UWB encryption key # Allowed values: 128-bit number in hexadecimal format # Default: (keep-current) # uwbs-enc-key = 11111111222222223333333344444444 # UWB network PANID # Allowed values: 16-bit number in decimal, hexadecimal or octal format # Default: (keep-current) # uwbs-panid = 0x0000 # Device label # Default: (keep-current) # uwbs-label = gw-uwbs # Device position in mm [x, y, z] # Default: (keep-current) # uwbs-pos-x = 0 # uwbs-pos-y = 0 # uwbs-pos-z = 0
PCでコマンドプロンプトまたはターミナルウィンドウを開く。
Navigate to the folder where you created the configuration file.
たとえば、Ubuntu (Linux) の場合:
cd leaps_gateway_hub/
Install the LEAPS Gateway Docker packages, run:
注釈
LEAPS Gateway requires the use of a USB port. Therefore, users need to run with admin rights to mount and use USB on the docker container.
sudo docker run -d -it --name some_name --privileged -v /dev/bus/usb:/dev/bus/usb -v /path/to/data/data/:/app/data/ leapslabs/leaps_gateway:tag /app/leaps_gateway --cfg /app/data/leaps_gateway.conf
Where
some_name
is the name you want to assign to your container, and thetag
specifies theleaps-gateway
version you want.
推奨される走行オプション
--user $(id -u):$(id -g)
特定のユーザーとグループの下でインスタンスを実行する。
--restart unless-stopped
Restart automatically the instance in case the server would crash.
The LEAPS Gateway installation process will begin.
たとえば、Ubuntu (Linux) の場合:
sudo docker run -d -it --name leaps_gateway --privileged -v /dev/bus/usb:/dev/bus/usb -v "$(pwd)"/data/:/app/data leapslabs/leaps_gateway:latest /app/leaps-gateway -c /app/data/leaps-gateway.conf Unable to find image 'leapslabs/leaps_gateway:latest' locally latest: Pulling from leapslabs/leaps_gateway a458657ccc71: Pull complete Digest: sha256:a19b127656d41d8607f043c2c83924e5b9a5cbd4dc23cfbed070be3b9cfc6b9a Status: Downloaded newer image for leapslabs/leaps_gateway:latest 320d3768289874e063619f75faca7a24dd75a08884df8cd8fb2cc9b54c6f0a46
インストールが成功したことを確認し、実行する:
たとえば、Ubuntu (Linux) の場合:
sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b1145b72db35 leapslabs/leaps_gateway:latest "sh -c 'cd /app && …" 37 seconds ago 11 seconds ago leaps_gateway
So, you have successfully installed and started LEAPS Gateway on PC.
Getting started
LEAPS Gateway Docker
Start LEAPS Gateway, run:
sudo docker start leaps_gateway
Stop LEAPS Gateway, run:
sudo docker stop leaps_gateway
Restart LEAPS Gateway, run:
sudo docker restart leaps_gateway
Remove LEAPS Gateway, run
sudo docker rm --force leaps_gateway
ネットワーク構成
ログ記録
# Logging level, default is 3 (0=none, 1=error, 2=warning, 3=info, 4=debug, 5=verbose). log-level = 0 # Path to log file. Comment out to disable logging to file (log to stdio instead). log-file = leaps-gateway.log
LEAPS Server host
# Default: localhost leaps-server-host = 192.168.1.1 # Your Computer's IP Address # LEAPS Server port # Default: 7777 leaps-server-port = 7777
UWBS USB Device VID/PID
# Vendor ID, default is 0x1915, possible values are (0x1915-Nordic, 0x04d8-Microchip) # Allowed values: 16-bit number in decimal, hexadecimal or octal format # uwbs-usb-dev-vid = 0x04d8 uwbs-usb-dev-vid = 0x1915 # Product ID, default is 0xe8e3 for LEAPS RTLS devices # Allowed values: 16-bit number in decimal, hexadecimal or octal format uwbs-usb-dev-pid = 0xe8e3
UWBS device configurations
# Bridge mode # Allowed values: 0=Disable 1=Enable # Default: (keep-current) uwbs-bridge = 0 # Initiator mode # Allowed values: 0=Disable 1=Enable # Default: (keep-current) uwbs-initiator = 0 # UWBMAC Profile ID # Default: (keep-current) uwbs-profile-id = 0 # LEDs mode # Allowed values: 0=Disable 1=Enable # Default: (keep-current) uwbs-led = 1 # UWB encryption # Allowed values: 0=Disable 1=Enable # Default: (keep-current) uwbs-enc = 0 # UWB firmware update # Allowed values: 0=Disable 1=Enable # Default: (keep-current) uwbs-fwup = 0 # UWB mode # Allowed values: 0=Off 1=Passive 2=Active # Default: (keep-current) uwbs-uwb = 2 # UWB Backhaul Routing # Allowed values: 0=Off 1=On 2=Auto # Default: (keep-current) uwbs-bh = 1 # BLE # Allowed values: 0=Off 1=On # Default: (keep-current) uwbs-ble = 1 # UWB encryption key # Allowed values: 128-bit number in hexadecimal format # Default: (keep-current) uwbs-enc-key = 11111111222222223333333344444444 # UWB network PANID # Allowed values: 16-bit number in decimal, hexadecimal or octal format # Default: (keep-current) uwbs-panid = 0x0000 # Device label # Default: (keep-current) uwbs-label = gw-uwbs # Device position in mm [x, y, z] # Default: (keep-current) uwbs-pos-x = 0 uwbs-pos-y = 0 uwbs-pos-z = 0
トラブルシューティング
Use the following command
sudo docker restart leaps_gateway
to restart LEAPS Gateway.On windows, repeat the USB/IP attach WSL 2 to connect the USB device. (
usbipd wsl attach --busid <busid>
)