Connecting OPC UA Pub Sub agents via MindConnect MQTT broker¶
This guide explains the steps how to connect to OPC UA Pub/Sub via MindConnect MQTT.
Architecture¶
Procedure¶
To connect to OPC UA Pub Sub agents via MindConnect MQTT broker, follow these steps:
-
Download the MindConnect MQTT Broker certificate
Login to Insights Hub environment and navigate to the "Asset Manager" application. In the "Connectivity" section, select "Manage MQTT Certificates" and click "Broker Information". MindConnect MQTT Broker Certificate is available as shown in the image.
- Broker URL: mindconnectmqtt.eu1.mindsphere.io:{TCP Port}
- Broker ports: use the port number as per the requirement.
Protocol Authentication TCP Port ALPN Protocol MQTT Client Certificate 8883 N/A MQTT Client Certificate 443 x-amzn-mqtt-ca -
Create and Download the Agent credentials
User can authenticate the agent using either one of ways.
-
Download the Agent certificate and associated private key using the built-in CA certificate. For more information, refer to obtain Auto-generated agent certificates.
The below image is an example of downloaded certificate and private key.dade1
is an example environment name.
OPCUATimeseriesDeviceTest
is the certificate name.dade1_OPCUATimeseriesDeviceTest
is used as a clientId. -
Upload the CA certificate and create an agent certificate and private key. For more information, refer to Register your ca certificates and Create agent private key documentation.
Note
To successfully connect, onboard, and communicate with the MQTT broker, each client needs to use a client id in the following format "
<clientId> = <tenant>_<CertificateName>
". -
-
Install the Agent Credentials
Install certificate and private key in the agent. Installation depends on the software used in the agent. The agent is now ready to send Timeseries.
Note
Example of MQTT Client Configuration:
-
Ingest Timeseries or Events metadata
Ingest metadata over the metadata topics
c/<clientId>/o/opcua/v3/u/m/t
c/<clientId>/o/opcua/v3/u/m/e
Note
- Refer to the sample message for timeseries metadata. Once the metadata is published, the corresponding owner asset is created on Insights Hub with
core.opcuadatamodel
type. Refer to the below image for example onTestOpcuaDevice1
.
- Datapoint asset is created under the owner asset with a type which is derived from
core.opcuadatatype
.
-
Send Timeseries or Events data
Ingest Timeseries/Events data over the data topics:
c/<clientId>/o/opcua/v3/u/d/t
c/<clientId>/o/opcua/v3/u/d/e
For more information on Timeseries, refer to sample message for timeseries data.
Except where otherwise noted, content on this site is licensed under the Development License Agreement.