diff --git a/docs/howto.md b/docs/howto.md index 90c0d13d..6f557604 100755 --- a/docs/howto.md +++ b/docs/howto.md @@ -256,10 +256,6 @@ config.opcua = { }; config.mappingTool = { - /** - * Boolean property to assess whether enabling MappingTool or not - */ - enabled: false, /** * Boolean property to assess whether enabling polling in MappingTool or not */ diff --git a/docs/images/OPC UA agent flow chart_2.png b/docs/images/OPC UA agent flow chart_2.png index 9e12ab47..01ee74a1 100644 Binary files a/docs/images/OPC UA agent flow chart_2.png and b/docs/images/OPC UA agent flow chart_2.png differ diff --git a/docs/installation_and_administration_guide.md b/docs/installation_and_administration_guide.md index 666a6334..2013a081 100755 --- a/docs/installation_and_administration_guide.md +++ b/docs/installation_and_administration_guide.md @@ -30,11 +30,12 @@ Open the `conf/config.js` and make your changes (see how to do this [here](howto The downloaded repository comes with a `config.js` (conf/config.js) in which an empty Device is preloaded. -At this point, you have three options: +At this point, you have three options for the configuration: -- Use the mapping tool to automatically generate a `config.js` -- Define your own context mappings in fields `types`, `contexts`, `contextSubscriptions`, `events` in `config.js` -- Dynamically provision the new Device (mapping between OPC UA Server and OPC UA Agent) via REST interface +- `auto`: use the mapping tool to automatically generate a `config.js` +- `static`: define your own context mappings in fields `types`, `contexts`, `contextSubscriptions`, `events` in + `config.js` +- `dynamic`: dynamically provision the new Device (mapping between OPC UA Server and OPC UA Agent) via REST interface If you want to use the mapping tool simply set as empty the following properties in the config.js: diff --git a/docs/opc_ua_agent_tutorial.md b/docs/opc_ua_agent_tutorial.md index 9ead6f31..c92d2bff 100644 --- a/docs/opc_ua_agent_tutorial.md +++ b/docs/opc_ua_agent_tutorial.md @@ -141,11 +141,9 @@ configuration file (config.js) or through the REST API Three different initialization modalities are available: -- Use a preloaded config.js -- Invoke a mapping tool responsible of automatically building the mapping between OPC UA and NGSI (**NOTE:** **_Before - using the MappingTool, erase the three objects: *types*, *contexts*, *contextSubscriptions* within the existing - config.js_**) -- Use the REST API +- `auto`: invoke a mapping tool responsible of automatically building the mapping between OPC UA and NGSI +- `static`: use a preloaded config.js +- `dynamic`: use the REST API Since in the following parts of this tutorial we are going to use the REST API you have not to worry about the initialization. diff --git a/docs/quick_start_guide.md b/docs/quick_start_guide.md index a1d5dae3..7335fed7 100755 --- a/docs/quick_start_guide.md +++ b/docs/quick_start_guide.md @@ -16,37 +16,17 @@ Main sections are: - `config.iota`: configure northbound (Context Broker), agent server, persistence (MongoDB), log level, etc. - `config.opcua`: configure southbound (OPC UA endpoint) - `config.mappingTool`: configure mapping tool properties to set auto configuration -- `config.autoprovision`: flag indicating whether or not to provision the Service Group and Device automatically when - measures arrive -##### Auto provisioning +#### Option 1: Auto configuration (usage of Mapping Tool) -Setting property `autoprovision` in the config.js to `false`, a manual provisioning can be performed using -iotagent-node-lib [API](https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md) interfaces. +When `config.configurationType` is `auto`, the Mapping Tool creates a mapping for all OPC UA objects (except those with +namespace to ignore matching): all OPC UA variables will be configured as active attributes whereas all OPC UA methods +will be configured as commands. -Setting property `autoprovision` in the config.js to `true`, the OPC UA Agent will perform autoprovisioning when -measures arrive. +#### Option 2: Static configuration (editing config.js file) -#### Auto Configuration (usage of Mapping Tool) - -When `config.mappingTool.enabled` is `true` and `config.iota.types` is empty, the Mapping Tool creates a mapping for all -OPC UA objects (except those with namespace to ignore matching): all OPC UA variables will be configured as active -attributes whereas all OPC UA methods will be configured as commands. - -To enable auto configuration, simply set as empty the following properties in the config.js: - -- `types: {}` -- `contexts: []` -- `contextSubscriptions: []` - -and enable the mapping tool: - -- `mappingTool: { enabled: true, ... }` - -#### Manual Configuration (editing config.js file) - -Using Manual Configuration it is possible to specify the mapping between OPC UA objects and NGSI attributes and -commands. The mapping can be specified in the config.js, editing the properties `types`, `contexts` and +When `config.configurationType` is `static`, it is possible to specify the mapping between OPC UA objects and NGSI +attributes and commands. The mapping can be specified in the config.js, editing the properties `types`, `contexts` and `contextSubscriptions`. To define active attributes: @@ -73,11 +53,11 @@ To define poll commands: An example can be found [here](../conf/config-v2.example.js). -#### Dynamic configuration (REST API) +#### Option 3: Dynamic configuration (REST API) -If you want to use the REST interface have a look at Step 4 -[here](https://iotagent-opcua.readthedocs.io/en/latest/opc_ua_agent_tutorial.html#step-by-step-tutorial) to see how to -provision a new device. +When `config.configurationType` is `dynamic`, you can use the REST interface to setup the Agent once it has started. To +provision a new device have a look at Step 4 +[here](https://iotagent-opcua.readthedocs.io/en/latest/opc_ua_agent_tutorial.html#step-by-step-tutorial). ### Run diff --git a/docs/user_and_programmers_manual.md b/docs/user_and_programmers_manual.md index a0125978..d414b6ad 100755 --- a/docs/user_and_programmers_manual.md +++ b/docs/user_and_programmers_manual.md @@ -35,35 +35,29 @@ one is needed when the OPC UA Server answers to the mapping tool returning its h ## Step 3 - Preparing the Agent for start up OPC UA Agent is configurable through a single configuration file. All properties are explained in the -[config.js](../conf/config.js) template. +[config.js](../conf/config.js) template. If you are running the Agent using Docker, please use the environment variables +defined in the docker-compose example provided. Main sections are: - `config.iota`: configure northbound (Context Broker), agent server, persistence (MongoDB), log level, etc. - `config.opcua`: configure southbound (OPC UA endpoint) - `config.mappingTool`: configure mapping tool properties to set auto configuration -- `config.autoprovision`: flag indicating whether or not to provision the Service Group and Device automatically -#### Auto Configuration (usage of Mapping Tool) +Three options are available to configure the Agent, described below. -When `config.mappingTool.enabled` is `true` and `config.iota.types` is empty, the Mapping Tool creates a mapping for all -OPC UA objects (except those with namespace to ignore matching): all OPC UA variables will be configured as active -attributes whereas all OPC UA methods will be configured as commands. +![edit config.js](./images/OPC%20UA%20agent%20flow%20chart_2.png) -To enable auto configuration, simply set as empty the following properties in the config.js: +#### Option 1: Auto configuration (usage of Mapping Tool) -- `types: {}` -- `contexts: []` -- `contextSubscriptions: []` +When `config.configurationType` is `auto`, the Mapping Tool creates a mapping for all OPC UA objects (except those with +namespace to ignore matching): all OPC UA variables will be configured as active attributes whereas all OPC UA methods +will be configured as commands. -and enable the mapping tool: +#### Option 2: Static configuration (editing config.js file) -- `mappingTool: { enabled: true, ... }` - -#### Manual Configuration (editing config.js file) - -Using Manual Configuration it is possible to specify the mapping between OPC UA objects and NGSI attributes and -commands. The mapping can be specified in the config.js, editing the properties `types`, `contexts` and +When `config.configurationType` is `static`, it is possible to specify the mapping between OPC UA objects and NGSI +attributes and commands. The mapping can be specified in the config.js, editing the properties `types`, `contexts` and `contextSubscriptions`. To define active attributes: @@ -90,11 +84,11 @@ To define poll commands: An example can be found [here](../conf/config-v2.example.js). -#### Dynamic configuration (REST API) +#### Option 3: Dynamic configuration (REST API) -If you want to use the REST interface have a look at Step 4 -[here](https://iotagent-opcua.readthedocs.io/en/latest/opc_ua_agent_tutorial.html#step-by-step-tutorial) to see how to -provision a new device. +When `config.configurationType` is `dynamic`, you can use the REST interface to setup the Agent once it has started. To +provision a new device have a look at Step 4 +[here](https://iotagent-opcua.readthedocs.io/en/latest/opc_ua_agent_tutorial.html#step-by-step-tutorial). ## Step 4 - Run the Agent