Skip to content

Commit

Permalink
align docs
Browse files Browse the repository at this point in the history
  • Loading branch information
walterwootz committed Mar 26, 2024
1 parent fad6e41 commit e272297
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 65 deletions.
4 changes: 0 additions & 4 deletions docs/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Binary file modified docs/images/OPC UA agent flow chart_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions docs/installation_and_administration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
8 changes: 3 additions & 5 deletions docs/opc_ua_agent_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
42 changes: 11 additions & 31 deletions docs/quick_start_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
36 changes: 15 additions & 21 deletions docs/user_and_programmers_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit e272297

Please sign in to comment.