Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 2.11 KB

README.md

File metadata and controls

66 lines (49 loc) · 2.11 KB

Site: IoTPrismLab

C3PO

The C3PO (Converter of OPen API SPecification to WoT Objects) translates OpenAPI specification (both versions 2 and 3) to W3C WoT Thing Descriptions and deploys them as a Web Thing proxy of the real application.

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

In order to build and run the container from DockerHub:

$ docker run -p 3333:3333 -p 3334:3334 --name c3po --network host ivanzy/c3po:1.1 

Usage with NPM

To install all dependencies of the C3PO and deploy it execute the following commands:

$ git clone --recurse-submodules https://github.com/UniBO-PRISMLab/c3po.git
$ npm install
$ npm run build
$ npm run start

Test

To test if C3PO is running correctly, check your browser at http://localhost:3334/api-docs/.

Configuration

C3PO configurations are defined in the config.json file

{
  "translator": {
    "host": "localhost",
    "port": 3334
  },
  "wot": {
    "http": { "host": "localhost", "port": 3333 },
    "mqtt": { "broker": "localhost", "port": 1883 },
    "coap": { "host": "localhost", "port": 5683 }
  },
  "cache": {
    "enable": false,
    "host": "localhost",
    "port": 6379,
    "manager": { "host": "localhost", "port": 1883 }

  },
  "logLevel": "info"
}
  • translator: the port and hots that C3PO will run execute.
  • wot: the port and host for accessing the Web Things created for each different protocol binding.
  • cache: if enabled (enable: true), it will connect to a redis host in the specified address
  • logLevel: the log level of the adapter. The default is "info", choose "debug" for more details or "warning" for less.