The configuration file
The gateway reads one YAML file at start: the configuration file. This page shows the sections of the file and the order in which the gateway uses them. Each section has its own page.
The sections
# yaml-language-server: $schema=https://opcua-omni-edge.doc.sterfive.com/schema/config.schema.json
# The TCP port of the OPC UA server.
port: 4840
# Well-known information models, by alias (di = http://opcfoundation.org/UA/DI/).
namespaces:
- di
# Your own information models (NodeSet2.xml files).
imports:
- alias: t
filename: ./model/MyDevice.Nodeset2.xml
# The Objects and Variables that the gateway adds to its address space.
instances: []
# The devices that the gateway connects to: Modbus, S7, EtherNet/IP, OPC UA, IO-Link...
brownfieldDevices: {}
# For each OPC UA variable, the source of its value.
mapping: []
The gateway uses the sections in this order:
| Order | Section | What it does | Page |
|---|---|---|---|
| 1 | namespaces:, imports: | Loads the information models. They give the types. | Information models |
| 2 | templates:, instances: | Adds Objects and Variables, made from the types. | Instances, Templates |
| 3 | brownfieldDevices:, redis: | Opens a connection to each device. | Devices |
| 4 | mapping: | Connects each variable to its source. | Mappings |
| 5 | pubsub: | Publishes the values of variables to an MQTT broker. | PubSub |
| — | port:, serverOptions:, certificateStores: | Sets the OPC UA server: port, endpoints, security, limits. | The OPC UA server |
The Key reference lists every section and every key, with its type and its meaning.
How to check a configuration file
-
Run this command:
opcua-omni-edge check config.yaml -
Read the result.
config.yaml: OK: the gateway can load the file.- Each error gives the line and the problem, for example:
config.yaml:15: error [schema] Property dataTipe is not allowed.
-
Correct each error and run the command again. A message that starts with a code, such as
MAP-E001, has its meaning and its fix in Error codes.
The run command also checks the file, before it starts the server.
run reports an error as CONFIG-E001 with the path of the entry, for example /instances/1, the second entry of instances:.
To see the configuration after the gateway expands the templates, run opcua-omni-edge dump-config config.yaml.
How to get completion in VS Code
-
Install the VS Code extension "YAML" (Red Hat).
-
Put this line at the top of the configuration file:
# yaml-language-server: $schema=https://opcua-omni-edge.doc.sterfive.com/schema/config.schema.json -
Open the file. VS Code shows the keys that you can use, and marks a wrong key.
The schema at this URL agrees with the latest release of the gateway.
Older configuration files
A version 3 configuration file used one nodesets: key. The gateway does not accept it.
To convert the file, run opcua-omni-edge migrate-config config.yaml.