Skip to content

The application-skeleton-wot converts Web Things to Arrowhead services and converts Arrowhead services into Web Things"

License

Notifications You must be signed in to change notification settings

arrowhead-f/application-skeleton-wot

Repository files navigation

Site: IoTPrismLab

application-skeleton-wot

The application-skeleton-wot converts Web Things to Arrowhead services and converts Arrowhead services into Web Things.

Further details on the operation of the application and a performance analysis can be found in this paper. We kindly ask to cite the already mentioned paper if you utilized our tool in any academic project.

Usage with Docker

Docker and Docker Compose

This application can be deployed as a Docker container. If you do not have Docker installed yet, follow the instructions here .

You can check your current Docker version using the following commands:

$ docker version

The application has a docker image ready to be used publicly available in DockerHub. In order to instantiate the container run the following commands with admin privileges:

$ docker pull ivanzy/wot-arrowhead-enabler
$ docker run -p 3333:3333 -p 3334:3334 ivanzy/wot-arrowhead-enabler

It is also possible to build and run the container from the project directory;

$ git clone https://github.com/arrowhead-f/application-skeleton-wot.git
$ cd application-skeleton-wot/
$ docker build -t application-skeleton-wot:1.1 .
$ docker run -p 3333:3333 -p 3334:3334 --name application-skeleton-wot application-skeleton-wot:1.1 

Usage with NPM

npm is a package manager for the JavaScript programming language. To install all dependencies of the Adapter and deploy it execute the following commands:

$ npm install
$ npm run start

Test

to test if the application-skeleton-wot is running correctly, check your browser at http://localhost:3334, the response should be:

{
   "status":"application-skeleton-wot is working",
   "message":"application-skeleton-wot is running",
   "description":"The application-skeleton-wot converts Web Things to Arrowhead services and converts Arrowhead services into Web Things"
}

The project API documentation can be consulted at http://localhost:3334/docs-api once the application is running.

Configuration

The application-skeleton-wot configurations are defined in the config.json file

{
    "arrowhead": {
        "host": "<IP ADDRESS>",
        "port": 8443
    },
    "wotRepository": {
        "host": "<IP ADDRESS>",
        "port": 8080
    },
    "poolingInterval": 10,
    "adapter": {
        "port": 3334
    },
    "wot": {
        "port": 3333
    },
    "mode": {
        "arrowheadAdapter": false,
        "wotAdapter": true,
        "wotRepository": "wot or modron"
    },
    "logLevel":"info"
}
  • arrowhead: configure the IP address and port for the Arrowhead Service Registry
  • wotRepository: configure the IP address and port for the WoT Repository. It can be a list of Web Things defined according to the W3C WoT specification or the Modron server address.
  • poolingInterval: the interval in seconds to pool from arrowhead server and from the wot repository.
  • adapter: the port that the WoT-Arrowhead Adapter will run execute.
  • wot: the port for accessing the Web Things created.
  • mode: specific configurations of the WoT-Arrowhead Adapter
    • arrowheadAdapter: true if you want to instantiate Arrowhead services as Web Things, false otherwise.
    • wotAdapter: true if you want to instantiate Web Things Arrowhead services, false otherwise.
    • wotRepository: the two modes are "modron" or "wot". Use wot if you are not using modron server.
  • logLevel: the log level of the adapter. The default is "info", choose "debug" for more details or "warning" for less.

Modron Usage

To connect the adapter with Modron, it is necessary to create a .env file in /src containing the user and password for the given modron server.

MODRON_PASSWORD= <MODRON PASSWORD>
MODRON_USER= <MODRON USER>

About

The application-skeleton-wot converts Web Things to Arrowhead services and converts Arrowhead services into Web Things"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages