Protocols

MQTT

Characteristics - MQTT

Information Model Requirements

  • The first Node after the root node rootNode must be of type Event eventNode.

  • The following Node Types can be used under the Event Node:

  • In case of publishing a topic, the Information Model determines the structure of the payload.

  • In case of subscribing to a topic make sure that the Information Model structure matches the payload.

How to configure the MQTT Channel

  1. Select the MQTT (JSON) as Channel Type.

  2. Click the Configure button.

MqttConfiguration
  1. Select the root model node

  2. Enter host and port of the MQTT Broker used.

  3. Specify a path to a folder on your local machine. The temp directory inside the SMARTUNIFIER Manager can be also used.

  4. Select Username and Password in order to enter username and password. If there are no credentials needed (e.g., test.mosquitto.org) make sure None is selected.

MqttModelRootNodeConfiguration
  1. Select the event node in the tree on the left.

  2. Enable either producer or consumer depending on the use case and enter a topic name.

  3. Click the Apply button.

MqttModelEventNodeConfiguration

Certificates

Encrypted connection using TLS security is supported. Follow the steps below to encrypt the connection.

  1. Enable Hostname Verification (optional)

  2. Enable the Tls Configuration checkbox

  • Enter the path to the CA (certificate authority) certificate of the CA that has signed the server certificate

Note

Make sure the CA certificate is valid.

  1. Enable the Client checkbox

  • Enter the path to the client certificate. The client certificate identifies the client just like the server certificate identifies the server.

  • Enter the path to the private client key.

  • If applicable select and enter a password.

  • Select the protocol from the Drop-Down.

Mqtt Configuration Certificates

Disconnected Buffer

In case the connection is lost, messages can be buffered offline when the Disconnected Buffer is enabled. Follow the steps below to enable the DisconnectedBuffer.

  1. Enable the DisconnectedBuffer checkbox.

  2. Set the Buffer Size - defines the amount of messages being hold e.g., 5000.

  3. (Optional) Enable PersistBuffer.

  4. (Optional) Enable DeleteOldestMessage.

MqttConfigurationDisconnectedBuffer

Description of configuration properties:

Property

Description

Example

host

URL of the MQTT Broker.

test.mosquitto.org

port

Port of the MQTT Broker.

1883

reconnectInterval

Time interval to reconnect to the MQTT Broker after loss of connection in seconds

5

connectionTimeout

Time interval the connection times out in seconds

60

keepAliveInterval

Time the session persists in seconds

60

persistenceFolder

Path to a folder for the persistence store of the MQTT

temp

clientId

Identifies an MQTT client which connects to an MQTT Broker

MyClientID

username

Client username

Username

password

Client password

Password

hostnameVerification

Hostname Verification

true, false

tls

Encryption

true, false

producers

Data producer

true, false

consumer

Data consumer

true, false

protocol

TLS protocol version

TLSv1.1, TLSv1.2

disconnectedBuffer

Offline buffering of data

true, false

bufferSize

Amount of message allowed in the buffer

5000

persistBuffer

Buffer persistence

true, false

deleteOldestMessage

Delete oldest message in buffer

true, false

OPC-UA

Characteristics - OPC-UA

OPC (Open Platform Communications) enables access to machines, devices and other systems in a standardized way. To learn more about the standard visit the OPC-UA website.

Information Model Requirements

Example Model

OPC-UA Client

  1. Select OPC-UA Client as Channel Type.

  2. Click the Configure button.

OPC-UA Client Setup
  1. Make sure the root model node is selected to configure the OPC-UA Client

  2. Enter an applicationName

  3. Configure the serverTcpConfiguration

  • Enter an ipAdress

  • Enter the port

  • Define an endpoint

  • Set a requestTimeOut

  1. Configure the defaultSubscriptionAttribute

  • Define a publishingInterval

  1. Configure monitoringParameters

  • Set a samplingInterval

  • Enter a queueSize

  • Enable discardOldest depending on the use case

OPC-UA Client Setup
  1. Select the complex variable node.

  2. Enable the complexVariables

OPCUAClientComplexVariableNodeEnableConfig
  1. Assign OPC-UA data block variables to corresponding variables in the Information Model by selecting the variable in the tree

  2. Assign data block

  • Enable the variables checkbox

  • Enter the nodeId

OPC-UA Client Setup

REST

REST Server

  1. Select the root model node in the tree on the left.

  2. Enter a path prefix.

  3. Configure the REST Server endpoint.

  • Enter the IP.

  • Enter the port.

  • Enter the Content-Type.

  1. Check the webapp checkbox and provide the WAR-file if you want to host an application.

  2. Click the Apply button and save the Channel by clicking the Save button on the upper right corner.

Rest_Server_Config

Description of configuration properties:

Property

Description

Example

pathPrefix

Prefix for the URL

e.g., demo

Port

Port of the REST server

e.g., 9002, 9000, ...

IP

IP address of the REST server

http://localhost

DefaultContentType

Is used to indicate the media type of the resource

application/json, application/xml, text/html, text/csv

webapp

Possibility to host an application

true, false

REST Client

  1. Select the root model node in the tree on the left.

  2. Configuration of the REST Client

  • Enter the IP.

  • Enter the Default-Content type.

  • Enter a timeout.

Rest_Client_Config
  1. Click on the variable in the tree which needs a configuration.

  2. Enable the Event routes checkbox.

  3. Variable configuration.

  • Enter the URL.

  • Select the HTTP method.

  1. Enable the Headers checkbox to add headers.

  2. Configure Key-Value pair of the header.

  • Enter a name.

  • Enter a value.

  1. Click on the Add header button to add more headers.

  2. Click the Apply button and save the Channel by clicking the Save button on the upper right corner.

Rest_Client_Config

Description of configuration properties:

Property

Description

Example

URL

URL of the REST Server.

localhost:8090

RouteModelPath

Path of a node in the Information Model. A node can be a command, an event or a variable

/Model/RestMetrics/Event/partQualityEvent

RouteUrl

URL of the exposed node.

localhost:8090

HttpMethod

HTTP method for the action performed by the Client.

GET, POST, PUT

HeaderName and Header Value

To provide server and client with additional information

Retry-After: 12

ContentType

Is used to indicate the media type of the resource.

application/json

WaitTimeoutDuration

Timeout in seconds until request is failing

10