Skip to main content

Configuration

Global Configuration

The tapio CloudConnector can be configured through a .xml-file named TapioCloudConnector.xml. The configuration provides two different ways to store the information. It is also possible to mix both ways together.

  1. Store all information in one xml file. (see example 1)
  2. Use a Distributed Configuration where different sections are in different files. See example 2 with ManufacturerConfig and CloudConnectorConfig in different files.

If a section, e.g. Modules contains content in the GlobalConfig the tapio CloudConnector will take these information and will ignore the file behind the given file path. If you want to use the information from the file, you need to remove the content from the GlobalConfig file in the specific section like Modules.

By default it's located at C:\ProgramData\tapio\CloudConnector\ for Windows and /opt/tapio/cloudconnector/config for Linux.

Example 1:

<?xml version="1.0"?>
<GlobalConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- Optional: Manufacturer Configuration for on the fly machine registration -->
<ManufacturerConfig>
<ManufacturerSubscriptionId>33386422-f77e-493c-8db6-9d48a1a3cbbb</ManufacturerSubscriptionId>
<DeviceType>Test</DeviceType>
</ManufacturerConfig>

<ConnectorConfig>
<ConnectorId>q8AElWQ8Iqc7vbMiy2jnmYbguEH-K...</ConnectorId>
<ConnectorCert>MIacAQMwgAYJKoZIhvcNAQcBoIAkg...</ConnectorCert>
<DiscoveryServiceUri>https://disco.tapio.one</DiscoveryServiceUri>
<DiscoveryServiceCert>MiIDQaDCCAiigAwIBAgI...</DiscoveryServiceCert>
<AuthAppId>00000000-0000-0000-0000-000000000000</AuthAppId>
<AuthSecret>secret</AuthSecret>
<ResourceId>https://tapiousers.onmicrosoft.com/DiscoveryService</ResourceId>
<Authority>https://login.microsoftonline.com/32896ed7-d559-401b-85cf-167143d61be0</Authority>
<InstrumentationKey>00000000-0000-0000-0000-000000000000</InstrumentationKey>
<LogLevel>Verbose</LogLevel>
<OpcUaServerUrl>opc.tcp://somedomain:4433/CloudConnectorDiagnostic/</OpcUaServerUrl> <!-- optional -->
<MaxRegistrationInterval>0</MaxRegistrationInterval> <!-- optional -->
</ConnectorConfig>
<Modules>
<Module xsi:type="DataModuleConfig">...</Module>
<Module xsi:type="FileTransferModuleConfig">...</Module>
</Modules>
</GlobalConfig>

Example 2:

<?xml version="1.0"?>
<GlobalConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ManufacturerConfig source="C:\ReadOnlyPath\tapio\CloudConnector\config\ManufacturerConfig.xml">
</ManufacturerConfig>
<ConnectorConfig source="C:\ProgramData\tapio\CloudConnector\config\ConnectorConfig.xml">
</ConnectorConfig>
<Modules>
<Module xsi:type="DataModuleConfig">...</Module>
<Module xsi:type="FileTransferModuleConfig">...</Module>
</Modules>
</GlobalConfig>

ModuleConfig.xml example 3:

<Modules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<Module xsi:type="DataModuleConfig">...</Module>
<Module xsi:type="AzureIotHubConfig">
<Id>AzureIotHub</Id>
<ServiceId>AzureIoTHub</ServiceId>
</Module>
</Modules>

In case of using path information for one of the three section in a configuration, you are able to store e.g. the ManufacturerConfig in a section which is read-only.

GlobalConfig Model

ElementDescription
ManufacturerConfigManufacturerConfig, required for automatic machine registration
ConnectorConfigConfiguration required for connecting to the tapio platform.
ModulesList of module configurations.

ManufacturerConfig Model

This configuration section is required if you want to use automatic machine registration. The following information about a device will be stored in the manufacturer section.

ElementDescription
ManufacturerSubscriptionIdThe SubscriptionId of the manufacturer
DeviceTypeThe device type
DeviceSubTypeOptional: Device sub type

ConnectorConfig Model

The ConnectorConfig will contain the following information. You will get the information via a xml file download by registering a device in My tapio.

PropertyRequiredDescription
ConnectorIdIdentifier of the CloudConnector instance.
ConnectorCertCloudConnector certificate (client-certificate).
DiscoveryServiceUriDiscovery service URI.
DiscoveryServiceCertDiscovery service certificate (server-certificate).
AuthAppIdApp identifier for discovery service OAuth2 flow.
AuthSecretApp secret for discovery service OAuth2 flow.
ResourceIdResource id for discovery service OAuth2 flow.
AuthorityAuthority for discovery service OAuth2 flow.
InstrumentationKeyInstrumentation key for logging into Application Insights
LogLeveloptionalVerbosity of the logs. There are six log levels available. Default is Error.
LoggingSinkLocationoptionalWhere log messages go to. See log sink location for possible options.
LogFileCountoptionalThe count of log files to use, at least 1, default 10.
LogFileSizeoptionalThe max size per log file, min 4K (4 KiB) , default 10M (10 MiB), format {number}{unit}, allowed units: K - KiB, M - MiB, G - GiB. See below for more examples.
OpcUaServerUrloptionalOPC UA server address. Default is opc.tcp://localhost/CloudConnectorDiagnostic/. You can set a specific port with this tag.
MaxRegistrationIntervaloptionalThe maximum time between registration attempts (in milliseconds). If set to 0 the registration will be disabled. If not set the default value 30000 ms is used.

Examples for LogFileSize:

ValueDescription
{number}{unit}
4K4 Kilobyte = 4096 Byte
1M1 Megabyte = 1024 Kilobyte = 1048576 Bytes
10M10 Megabyte = 10240 Kilobyte
1G1 Gigabyte = 1024 Megabyte

Log level

LevelLogged events
VerboseEverything
DebugInformation logs and information for developers.
InformationWarning logs and general information.
WarningError logs and expected exceptions.
ErrorCritical logs and unexpected exceptions.
CriticalOnly critical events.

Log Sink Location

It is also possible to disable logging on the file system. You need to add the property LoggingSinkLocation to the ConnectorConfig.

<ConnectorConfig>
...
<InstrumentationKey>00000000-0000-0000-0000-000000000000</InstrumentationKey>
<LogLevel>Verbose</LogLevel>
<LoggingSinkLocation>Ai</LoggingSinkLocation>
</ConnectorConfig>
LocationDescription
AiAndFileLogs are stored in the application insights and file log on the device
AiLogs are stored in the application insights

If no location is set in the configuration, the CloudConnector will use the AiAndFile location.

Module Configuration

Each module has a unique configuration model. Have a look at the documentation of the module you want to configure.

OPC UA Client Configuration

Some modules like the file transfer or call endpoint module contain a OPC UA client which has to be configured according to the documentation of the module in charge. Configuration patterns for authentication and node identifiers are reused in multiple modules.

Authentication

There are three different ways for authentication. Set the xsi:type property of the Authentication XML tag to either AuthenticationUserName, AuthenticationCertificate or AuthenticationNone and configure accordingly.

Currently used in BackupModule, DataModule and FileTransferModule.

Authentication with username and password

Example:

<Authentication xsi:type="AuthenticationUserName">
<UserName>thelegend27</UserName>
<Password>somePassword!</Password>
</Authentication>

Model:

PropertyDescription
UserNameOPC UA username.
PasswordOPC UA password for given username.
Authentication with certificates

Example:

<Authentication xsi:type="AuthenticationCertificate">
<X509CertBase64>
HDAJBgNVBAYTAlJVMA8GA1UEAx4IAFQAZQBzAHQwggEiMA0GCSqGSIb3DQEBA...
</X509CertBase64>
<CertPassword>somePassword!</CertPassword>
</Authentication>

Model:

PropertyDescription
X509CertBase64A X509 certificate encoded as Base64 string.
CertPasswordPassword to load certificate with private key, set when required.
No authentication

Example:

<Authentication xsi:type="AuthenticationNone">
</Authentication>

Node Identifier

There are many ways to format a NodeId. We support the following notations:

Currently used in DataModule and FileTransferModule.

Full notation

The full notation is just a string with specific formatting.

Format:

ns=<namespaceIndex>;s=<identifier>

Example:

<NodeId>ns=2;s=MyServer.MyFolder.MyNode</NodeId>

It is possible to resolve the index namespace on runtime:

<!-- Note the nsu parameter has to be the first one -->
<NodeId>nsu=http://tapio.one;i=45</NodeId>
Identifier and Namespace Index notation

Model:

PropertyDescription
NamespaceIndexOPC UA namespace index of the node.
IdentifierOPC UA identifier string of the node.

Example:

<NodeIdIndex>
<NamespaceIndex>2</NamespaceIndex>
<Identifier>MyServer.MyFolder.MyNode</Identifier>
</NodeIdIndex>
Identifier and Namespace URI

Model:

PropertyDescription
NamespaceUriOPC UA namespace URI of the node.
IdentifierOPC UA identifier string of the node.

Example:

<NodeIdNamespace>
<NamespaceUri>urn:MyCompany:MyServer</NamespaceUri>
<Identifier>MyFolder.MyNode</Identifier>
</NodeIdNamespace>

Distributed Configuration

The configuration can be split up into separate parts that are located at different locations. A location is given by an uri in the source attribute of the element for which the contents should be load. While loading the configuration, the serializer will resolve referenced uris and insert the contents.

Example:

<?xml version="1.0"?>
<GlobalConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConnectorConfig source="file:///c:/programdata/tapio/cloudconnector/config/Modules.xml">
</ConnectorConfig>
<Modules>
<Module xsi:type="DataModuleConfig">...</Module>
<Module xsi:type="FileTransferModuleConfig">...</Module>
</Modules>
</GlobalConfig>
<ConnectorConfig>
<ConnectorId>q8AElWQ8Iqc7vbMiy2jnmYbguEH-K...</ConnectorId>
<ConnectorCert>MIacAQMwgAYJKoZIhvcNAQcBoIAkg...</ConnectorCert>
....
</ConnectorConfig>

Currently the ConnectorConfig element and the Modules element support the source attribute. If the configuration is split up, each individual file needs to be a valid XML. Required namespaces (e.g. xsi) need to be defined in all files where they are used.

The source must be a valid uri. Ideally, only absolute uris are used, but relative uris are supported as well if a base uri is provided while loading the configuration. When a source attribute is given for an element that also has children, it is ignored.

By default only the file scheme is supported.