LEAPS センター

LEAPS センター is a web application that provides device management, network management, and visualization of location and telemetry data for the whole network.

主な機能

  • 2Dと3Dのグリッドはリアルタイムで位置を更新し、ネットワーク内のデバイスを視覚化します。

  • その他の便利な機能には、ユーザー管理、ゾーン管理、ゾーン履歴、フロアプラン管理、ポジション履歴、ポジションヒートマップがあります。

  • The LEAPS センター interconnects with the LEAPSサーバー via the MQTT Broker. It runs as a service on Linux and Windows platforms.

インストール

システム要件

Dockerのシステム要件はOSによって異なります。

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

  • Windowsでは、仮想化を有効にしたWindows 10上でDocker Desktopを使用します

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

注釈

最新の詳細については`Docker <https://docs.docker.com/>`_公式ドキュメントを参照してください。

使用方法

  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. コンフィギュレーション・パッケージを準備する。

  1. PCでコマンドプロンプトまたはターミナルウィンドウを開く。

  • Navigate to the directory where you extracted from the LEAPS センター configuration package.

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

cd LEAPS_CENTER_DOCKER/
  1. Install the LEAPS センター Docker packages, run:

docker run -d -p 80:8080/tcp --name some_name -v /path/to/data/data/:/app/data/ -e LEAPS_CENTER_HOME=/app/data/ leapslabs/leaps_center:tag sh -c "cd /app &&  java -jar leaps-center-web.jar"

ここで、some_name はコンテナに割り当てたい名前であり、tag は希望する leaps-center-web バージョンを指定するタグである。

leaps_centerイメージは、設定ファイル、アプリケーションログ、設定/ノード履歴データベースを格納する外部マウントフォルダと共に動作する必要があります。

オプション -v /path/to/data/:/app/data//path/to/data/ にあるフォルダを内部の /app/data フォルダにマウントします。データフォルダには以下のファイルが必要です。

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

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

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

  • 走行オプション

    • --security-opt seccomp=unconfined このオプションは32ビットのRaspberry Piイメージ(Raspbian)で必要です。なぜなら、Dockerイメージに悪影響を与える(MQTTサーバーに接続できない)バグのある旧式のseccompライブラリが含まれているからです。このオプションにより、この問題を上書きすることができます。

  1. The LEAPS センター installation process will begin.

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

docker run -d -p 80:8080/tcp --name leaps_center -v $PWD/leaps_center/:/app/data/ -e LEAPS_CENTER_HOME=/app/data/ leapslabs/leaps_center:latest sh -c "cd /app &&  java -jar leaps-center-web.jar"

Unable to find image 'leapslabs/leaps_center:latest' locally
latest: Pulling from leapslabs/leaps_center
a458657ccc71: Pull complete
Digest: sha256:a19b127656d41d8607f043c2c83924e5b9a5cbd4dc23cfbed070be3b9cfc6b9a
Status: Downloaded newer image for leapslabs/leaps_center:latest
320d3768289874e063619f75faca7a24dd75a08884df8cd8fb2cc9b54c6f0a46
  1. インストールが成功したことを確認し、実行する:

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

docker ps

CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS                          PORTS     NAMES
b1145b72db35   leapslabs/leaps_center:latest   "sh -c 'cd /app &&  …"   37 seconds ago   11 seconds ago                            leaps_center
  1. Open a web browser and enter the following http://localhost:80; The LEAPS センター application will load in a web browser.

../../../_images/lc_login.png

So, you have successfully installed and started LEAPS センター on your PC.

設定ファイル

  • leaps-center-web.conf

    JAVA_OPTS="-Xms256m -Xmx512m -Xss256k"
    
  • アプリケーション.特性

  • leaps-center-history.properties

  • leaps-center-web.properties

    この設定ファイルは、アプリケーションのロギングを制御する。

    spring.main.banner-mode=OFF
    
    logging.level.root=OFF
    logging.level.global.leaps.center.mqtt=OFF
    logging.level.global.leaps.center.init=OFF
    logging.level.global.leaps.center.service=OFF
    logging.level.global.leaps.center.history.filter=OFF
    logging.level.global.leaps.center.history.service=OFF
    logging.level.global.leaps.center.history=OFF
    logging.level.global.leaps.center.web.component=OFF
    logging.level.global.leaps.center.web.rest=OFF
    logging.level.global.leaps.center.web.sse=OFF
    logging.level.global.leaps.center.web=OFF
    logging.level.global.leaps.center=OFF
    

    この設定ファイルはノードの位置履歴ロギングを制御します。

    #
    #       LEAPS - Low Energy Accurate Positioning System - LEAPS Center.
    #
    #       Copyright (c) 2016-2021, LEAPS.
    #
    #       Licensed under the Apache License, Version 2.0 (the "License");
    #       You may not use this file except in compliance with the License.
    #       You may obtain a copy of the License at
    #
    #       http://www.apache.org/licenses/LICENSE-2.0
    #
    #       Unless required by applicable law or agreed to in writing, software
    #       distributed under the License is distributed on an "AS IS" BASIS,
    #       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    #       See the License for the specific language governing permissions and
    #       limitations under the License.
    #
    
    # history enabled (default false)
    history.enabled=false
    history.position.enabled=true
    history.zone.enabled=true
    
    # use node position message timestamp (default true)
    history.use.position.timestamp=false
    
    # =======================================================================================================
    # Export Options
    # =======================================================================================================
    
    # add headers (default false)
    history.export.headers=false
    
    # maximum number of records (default 1000000)
    history.export.max.lines=1000000
    
    # compress export file (default true)
    history.export.compress=true
    
    # number of decimal places for x, y, z values (default 4)
    history.export.position.decimal.places=2
    
    # format network id to hex value (default true)
    history.export.hex.network.id=true
    
    # format node  ID to hex value (default true)
    history.export.hex.node.id=true
    
    # =======================================================================================================
    # Position History Options
    # =======================================================================================================
    
    # interval time to add a history record (default 10000)
    history.node.position.interval.time=10000
    
    # minimun quality value (default 0)
    history.node.position.min.quality=0
    
    # =======================================================================================================
    # Heatmap Options
    # =======================================================================================================
    # maximum number of records for heatmap (default 100000)
    heatmap.max.results=100000
    
    # =======================================================================================================
    # Purge Options
    # =======================================================================================================
    
    # time to purge database records in days (default 30 days)
    history.purge.time=30
    
    # backup purged records to a file in /history folder (default false)
    history.purge.backup.records=true
    
    # max number of backup files (default 10)
    history.purge.max.backup.files=5
    
    # =======================================================================================================
    # DBMS (SQLITE, POSTGRESQL, MY_SQL, ORACLE, SQL_SERVER or CUSTOM)
    # =======================================================================================================
    
    # History - SQLite Database Example (default).
    # history.dbms=SQLITE
    # history.db.jdbc.url=jdbc:sqlite:leaps-center-history.db
    # history.db.username=
    # history.db.password=
    
    # History - PostgreSQL Database Example
    # history.dbms=POSTGRESQL
    # history.db.jdbc.url=jdbc:postgresql://localhost:5432/leaps_center_history
    # history.db.username=leaps_center
    # history.db.password=pwd
    
    # History - Oracle Database Example
    # Important! To use Oracle DBMS is mandatory to change global.leaps.center.history.entity.NetworkNodeHistory.id @Id generation strategy to GenerationType.AUTO or GenerationType.SEQUENCE. Oracle does not support GenerationType.IDENTITY.
    # history.dbms=ORACLE
    # history.db.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
    # history.db.jdbc.url=jdbc:oracle:thin:@127.0.0.1:1521/XE
    # history.db.username=leaps_center
    # history.db.password=pwd
    
    # History - MySQL Database Example
    # history.dbms=MY_SQL
    # history.db.jdbc.url=jdbc:mysql://localhost:3306/leaps_center
    # history.db.username=leaps_center
    # history.db.password=pwd
    
    # History - SQL Server Database Example
    # TODO: It needs to be tested.
    # history.dbms=SQL_SERVER
    # history.db.jdbc.url=jdbc:sqlserver://localhost:1433;databaseName=leaps_center_history;integratedSecurity=true
    # history.db.jdbc.url=jdbc:jtds:sqlserver://localhost:1433/leaps_center_history;instance=SQLEXPRESS;
    # history.db.username=leaps_center
    # history.db.password=pwd
    
    # History - Custom Database
    # history.dbms=CUSTOM
    
    # Hibernate Dialect
    # history.db.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
    
    # JDBC driver class
    # history.db.jdbc.driver.class=org.postgresql.Driver
    

    この設定ファイルはleaps_centerアプリケーションをコントロールします。

    #
    #       LEAPS - Low Energy Accurate Positioning System - LEAPS Center.
    #
    #       Copyright (c) 2016-2021, LEAPS.
    #
    #       Licensed under the Apache License, Version 2.0 (the "License");
    #       you may not use this file except in compliance with the License.
    #       You may obtain a copy of the License at
    #
    #       http://www.apache.org/licenses/LICENSE-2.0
    #
    #       Unless required by applicable law or agreed to in writing, software
    #       distributed under the License is distributed on an "AS IS" BASIS,
    #       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    #       See the License for the specific language governing permissions and
    #       limitations under the License.
    #
    
    # database (SQLITE, POSTGRESQL, MY_SQL, ORACLE, SQL_SERVER or CUSTOM)
    db.dbms=SQLITE
    
    # History - SQLite Database Example.
    # dbms=SQLITE
    # db.jdbc.url=jdbc:sqlite:leaps-center-db
    # db.username=
    # db.password=
    
    # History - PostgreSQL Database Example
    # db.dbms=POSTGRESQL
    # db.jdbc.url=jdbc:postgresql://localhost:5432/leaps_center
    # db.username=postgres
    # db.password=qwe123
    
    # History - Oracle Database Example
    # Important! To use Oracle DBMS is mandatory to change global.leaps.center.entity.NetworkNodeHistory.id @Id generation strategy to GenerationType.AUTO or GenerationType.SEQUENCE. Oracle does not support GenerationType.IDENTITY.
    # db.dbms=ORACLE
    # db.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
    # db.jdbc.url=jdbc:oracle:thin:@127.0.0.1:1521/XE
    # db.username=leaps_center
    # db.password=q1w2e3r4t5
    
    # History - MySQL Database Example
    # db.dbms=MY_SQL
    # db.jdbc.url=jdbc:mysql://localhost:3306/leaps_center
    # db.username=root
    # db.password=qwe123
    
    # History - SQL Server Database Example
    # db.dbms=SQL_SERVER
    # db.jdbc.url=jdbc:sqlserver://localhost:1433;databaseName=leaps_center_history;integratedSecurity=true
    # db.jdbc.url=jdbc:jtds:sqlserver://localhost:1433/leaps_center_history;instance=SQLEXPRESS;
    # db.username=leaps_center
    # db.password=qwe123
    
    # History - Custom Database
    # db.dbms=CUSTOM
    
    # Hibernate Dialect
    # db.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
    
    # JDBC driver class
    # history.db.jdbc.driver.class=org.postgresql.Driver
    # db.jdbc.url=jdbc:postgresql://localhost:5432/leaps_center
    # db.username=postgres
    # db.password=qwe123
    # db.jdbc.driver.class=
    # db.hibernate.dialect=
    
    # show sql (default false)
    # db.jpa.show-sql=false
    
    # format sql (default false)
    # db.jpa.format-sql=false
    
    # =======================================================================================================
    # network
    # =======================================================================================================
    
    # enable the registration of networks with mqtt connection type = HOST. (default true)
    network.mqtt.connection.by.host.enabled=true
    
    # enable the registration of networks with mqtt connection type = PAN_ID. (default false)
    network.mqtt.connection.by.network.id.enable=false
    
    # enable the registration of networks with web client connection by websocket. (default false)
    network.web.client.connection.by.web.socket=false
    
    # create the default network if it does not exist when starting. (default true)
    network.create.default.network=true
    # network.create.default.floor.plan=true
    
    network.default.id=
    network.default.name=Default
    
    # PAN_ID or HOST
    network.default.mqtt.connection.type=HOST
    
    # WS or SSE
    network.default.web.client.connection.type=SSE
    
    # MQTT
    mqtt.host=
    mqtt.ws.port=15675
    mqtt.tcp.port=1883
    mqtt.username=dwmuser
    mqtt.password=dwmuser
    # Enable/Disable TLS
    #mqtt.tls=
    # CA_SIGNED_CERTIFICATE (signed by a publicly trusted CA), CA_FILE_CERTIFICATE (file certificate);
    #mqtt.tls.certificate.type=CA_SIGNED_CERTIFICATE
    # TLS Protocol: TLS_V1 (TLSv1), TLS_V1_1 (TLSv1.1), TLS_V1_2 (TLSv1.2), TLS_V1_3(TLSv1.3);
    #mqtt.tls.protocol=TLS_V1_2
    #mqtt.tls.certificate.file=/user/.../leaps-center.crt
    mqtt.topic.prefix=dwm
    mqtt.tag.topic.prefix=node
    mqtt.anchor.topic.prefix=node
    
    # =======================================================================================================
    # floorplan settings
    # =======================================================================================================
    # size in pixels (default 2048)
    floorplan.max.image.dimension.size=2048
    
    # =======================================================================================================
    # scene settings
    # =======================================================================================================
    # size in cm (default 50cm)
    scene.grid.size=50
    # color in int (default 0xD8D8D8)
    scene.grid.color=0xD8D8D8
    # max grid visibility distance in meters (default 100)
    scene.grid.max.visibility.distance=100
    # zoom min in meters (default 2)
    scene.zoom.min=2
    # zoom max in meters (default 100)
    scene.zoom.max=100
    
    # =======================================================================================================
    # web server settings
    # =======================================================================================================
    
    # http session timeout
    server.servlet.session.timeout=120m
    
    # maximum number of http sessions per user (-1 is unlimited)
    server.max.sessions.per.user=-1
    
    # mod-jk/ajp connector configuration
    tomcat.ajp.enabled=false
    # tomcat.ajp.port=8009
    # tomcat.ajp.secret.required=false
    # tomcat.apr.enabled=false
    
    # server port (2-65535)
    server.port=8080
    
    # enable / disable https
    server.ssl.enabled=false
    # keystore format
    # server.ssl.key-store-type=PKCS12
    # keystore location
    # server.ssl.key-store=D:\\Leaps\\tls\\springboot.p12
    # keystore alias
    # server.ssl.key-alias=springboot
    # keystore password
    # server.ssl.key-store-password=password
    # SSL protocol to use
    # server.ssl.protocol=TLS
    # Enabled SSL protocols
    # server.ssl.enabled-protocols=TLSv1.2
    

はじめに

デフォルトでは、ユーザー名は admin、パスワードは admin です。

LEAPS サーバー Docker

ネットワーク構成

ネットワークを設定するには、メニューから Networks を選択する。

../../../_images/lc_select_networks.png

ネットワーク管理ダイアログがポップアップします。デフォルトでローカルホストネットワークがネットワークID 0x1234で設定されています。

../../../_images/lc_list_networks.png

新しいネットワークを作成するには、右下の Add ボタンをクリックします。

次に、必要な設定パラメータを入力する:

  • 名前

  • ネットワークタイプ

  • ホスト

  • TCPポート

  • ユーザー名

  • トピックのプレフィックス

すべて入力したら、Save ボタンをクリックして接続し、ネットワークIDを受け取ります。

../../../_images/lc_config_networks_1234.png

ネットワークIDがわからない場合は、LEAPSマネージャー やShellを使って見つけることができる。

最後に Test ボタンをクリックして接続を確認し、 Save ボタンをクリックして設定を保存します。

ノード構成

ノードを設定するには、あらかじめノードを特定のネットワークに割り当てる必要があります。

指定したノードのあるネットワークを選択すると、ネットワークの詳細が表示されます。次に、ノードの設定を開始します。

ゲートウェイ・ノード、アンカー・ノード、タグ・ノードとして設定可能なノードについては、以下を参照してください

../../../_images/lc_config_gateway.png
../../../_images/lc_config_anchor.png
../../../_images/lc_config_tag.png

フロアプラン

フロアプランを設定するには、メニューから Floor Plans を選択してください。

../../../_images/lc_menu.png

右下の Add ボタンをクリックしてください。

../../../_images/lc_floor_plans_add.png

Then, import the Floor Plans you want to configure and fill in the corresponding parameters.

../../../_images/lc_floor_plans_create.png

入力が終わったら Save ボタンをクリックして設定を保存します。 Visible チェックボックスを使用すると、マップ上で可視性を有効にすることができます。

../../../_images/lc_floor_plans_udk1.png

ゾーン

ゾーンを設定するには、メニューから Zones を選択してください。

../../../_images/lc_menu.png

右下の Add ボタンをクリックしてください。

../../../_images/lc_floor_plans_add.png

それから対応するパラメータを入力し、Save の設定を追加します。

ユーザー

ユーザーを設定するには、メニューから Users を選択してください。

../../../_images/lc_menu.png

デフォルトでは、アプリケーションは管理者アカウントと共通アカウントをあらかじめ設定しています。

../../../_images/lc_user_list.png

管理者または共通アカウントの場合。

../../../_images/lc_user_admin.png
../../../_images/lc_user_common.png

API 認証

  1. ユーザは /login に以下のパラメータを渡すシンプルな HTTP POST を行う必要があります (admin:admin を例にしています)。

    • ユーザー名: admin

    • パスワード: admin

    • remember-me: on

  2. ログイン後、JSESSIONIDクッキーが生成され、ユーザはそれ以降のリクエストでそれを使用する必要があります。

    注釈

    1. これは必須ではありません。もしユーザがこれを使うと、レスポンスとして別のクッキー (クッキー REMEMBERME) が追加され、ユーザはそれ以降のリクエストでそれを使うことができます。

    2. As the LEAPS センター performs a redirect after login and also when users are not authorized, it is necessary to properly set up the "follow redirects" parameter in user's client. The response code after login is 302, but users need to handle it manually because if the user is not authorized the status code is also 302. Users can make any request to a REST service, for example, and if the response status code is not 200 the user will not be authorized.

以下は、リクエストとネットワークへの問い合わせを行うJavaのコード例である:

../../../_images/api-authorization.png

詳細については、以下の2つのビデオを参照してください。1つはPostmanを使用し、もう1つはJavaコードを使用します。

Postman


Java Client


トラブルシューティング

  • Use the following command docker restart leaps_center to restart LEAPS センター.

  • Check the logs when LEAPS センター is running, open the docker desktop and select the leaps_center container.