Sign inSign up

fiware/iotagent-opcua

By fiware

Updated 8 months ago

IoT Agent for OPC UA protocol

Image
0

3.6K

fiware/iotagent-opcua repository overview

OPC UA Agent: the FIWARE IoT Agent for OPC UA

License: AGPL

An Internet of Things Agent accepting data from OPC UA devices. This IoT Agent is designed to be a bridge between the OPC Unified Architecture protocol and the NGSI interface of a context broker.

The intended level of complexity to support these operations should consider a limited human intervention (mainly during the setup of a new OPC UA endpoint), through the mean of a parametrization task (either manual or semi-automatic, using a text-based parametrization or a simple UI to support the configuration) so that no software coding is required to adapt the agent to different OPC UA devices.

It is based on the IoT Agent Node.js Library. Further general information about the FIWARE IoT Agents framework, its architecture and the common interaction model can be found in the library's GitHub repository.

Background

Positioning in the overall F4I Reference Architecture

The F4I OPC UA Agent is based on the reference implementation of the FIWARE Backend Device Management Generic Enabler, IDAS, delivered by Telefonica I+D. IDAS provides a collection of Agents - i.e., independent processes that are typically executed in the proximity of IoT devices and that are responsible for bridging a specific IoT protocol to the NGSI standard (e.g. the IDAS distribution includes off-the-shelf Agents for LwM2M and MQTT). To this end, IDAS links the NGSI southbound API of the FIWARE Orion Context Broker to the northbound API of the IoT application stack, by providing a software library (the IoT Agent Lib depicted in the previous figure) for developing custom Agents that may extend the bridging capabilities of IDAS to other protocols. The F4I IDAS OPC UA Agent makes use of this framework to integrate OPC UA-based devices in a publish-subscribe system based on the FIWARE Orion Context Broker.

Getting Started - Install

Currently two options are available to install the Agent:

We suggest using a Docker-first approach in order to avoid issues related to your environment configuration. Moreover, using this approach you will be provided with all the needed components: OCB, Mongo instances and a sample OPC UA server.

A step-by-step tutorial is available here

npm

Before launching the Agent you must install Orion Context Broker (Be aware to choose the correct version, please use orion if it's needed to test the Agent with NGSI v2 otherwise use orion-ld in case of NGSI-ld test.) and a OPC UA Server. After that you must tell the Agent how to interact with these components by using config.properties file. Once configuration is complete you can execute these commands to run the Agent.

$ npm install
$ node bin/iotagent-opcua

Further Information about how to install the OPC UA IoT Agent can be found at the corresponding section of the Installation & Administration Guide.

Usage

Information about how to use the IoT Agent can be found in the User & Programmers Manual.

Administration Services

Administration services are reachable at port specified by api-port property (config.js).

ServiceDescription
GET/versionReturns information about version, name and agent description
Poll commands

Poll commands can be enabled switching polling property to true (config.properties). Once enabled poll command, you can customize the polling Daemon Frequency and Expiration time still in the (config.properties). The polling-commands-timer is referred to the feature developed, that consist in the execution of the older polling command periodically (if exists) ed delete it in case of success.

API

Apiary reference for the Configuration API can be found here More information about IoT Agents and their APIs can be found in the IoT Agent Library documentation.

Testing

For test purpose can create an OPC UA server using the code in the following GitHub repository

Firstly edit the properties in order to set Northbound (NGSI) and Southbound (OPC UA) settings.

Further information about configuration properties can be found here

For checking current status of the Agent, send a request to /status service (http://{agent-ip-address}:api-port/status)

Secure connection with an OPC UA Server

OPC UA Agent will automatically generate key pairs and certificates (persisted in iotagent-opcua/certificates) to establish a secure connection to the OPC UA Server.

How to get access to the advanced API and Documentation topics

Documentation about the OPC UA Administration API can be found here

Tag summary

Content type

Image

Digest

sha256:72e0748e9

Size

111.9 MB

Last updated

8 months ago

docker pull fiware/iotagent-opcua