Skip to content

Training ‐ Setting Up Development Environment

Michael Elmore edited this page Nov 10, 2023 · 2 revisions

Requirements

Java SDK

GIT

OpenSensorHub SDK

APIs supported:

  • v1.4 Sensor Web Enablement
  • v2.0 Sensor Web Enablement, Sensor Web API, and SensorThings API

Setting Up OpenSensorHub SDK

  1. Choose version to develop against
  2. Clone respective branch from GitHub repository
  • v1.4:

git clone https://github.com/opensensorhub/osh-node-dev-template.git --recursive

  • v2.0:

git clone --branch v2-upgrade https://github.com/opensensorhub/osh-node-dev-template.git --recursive

Perform Initial Build

  • Performing the initial build ensures the development environment is set up correctly. Make sure you have the right JDK version for the OSH SDK version you are working on, for example:

java -version

May print:

java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) Client VM (build 25.231-b11, mixed mode, sharing)

  • Execute build command (excluding unit tests, ‘-x’)

cd osh-node-template
./gradlew build -x test

Verify Build

  • A successful build will generate the build subdirectory
  • The build will contain subdir distributions
  • The zip file is the build target

Deploying OpenSensorHub

  1. Unzip the build target

unzip osh-node-dev-template\build\distributions\osh-node-0.0.1.zip

  1. Execute the launch script for your corresponding OS
  • Windows

./launch.bat

  • Linux (ensure permissions are correct: chmod +x launch.sh)

./launch.sh

Verify Execution

Connecting to a node requires the operator to know either the IP address or Uniform Resource Locator (URL) for the server hosting the particular node port. To connect to an OpenSensorHub node, enter the following in the Web Browser’s address bar:

http://[IP_ADDRESS]:[PORT]/sensorhub/admin The default port is 8181 but may be changed through the admin panel (see Network for configuration) Note that if the node is being served through https, the default port will be different (likely, 443) but does not need to be specified, for example: https://[IP_ADDRESS]/sensorhub/admin

Success!

Open a web browser and navigate to:

http://localhost:8181/sensorhub/admin

  • Default username: admin
  • Default password: admin

1

2