Configure an MQTT Sparkplug B Collector Instance using Configuration Hub
This topic describes how to configure an MQTT Sparkplug B collector instance using Configuration Hub.
Before you begin
- Ensure that you installed the Historian server and collectors.
- Ensure that you created an MQTT Sparkplug B collector instance, using RemoteCollectorConfigurator or Configuration Hub.
Procedure
- Access Configuration Hub.
-
Select Collectors, and then select the MQTT Sparkplug B
collector instance that you want to configure.
The configurations specific to the collector instance appear in the DETAILS section.
-
In the COLLECTOR SPECIFIC CONFIGURATION and INSTANCE
CONFIGURATION sections, configure the values as described in the
following table.
COLLECTOR SPECIFIC CONFIGURATION
Field Description MTLS Security Indicates whether you want to use Mutual TLS (MTLS) protocol to enforce a secure and strong authentication mechanism. MTLS Data Encryption Indicates whether you want to encrypt the data that the collector shares to the data archiver (DA). For more information on how to enable MTLS Security, refer to Enable MTLS Security. INSTANCE CONFIGURATION
Field Description Broker Address Enter the host name of the MQTT broker using which you want to collect data. A value is required. Broker Port Enter the port number of the MQTT broker. A value is required. Client ID Enter the client ID of the MQTT Sparkplug B collector is running. This is required if you want to send the data to a cloud destination. If you do not have a client ID set up, by default, the interface name is taken. Primary Host ID Enter the unique host ID of the Collector. The Collector will publish the STATE message topic using this host ID and then the Publisher will subscribe and start publishing the topics to this host ID. REORDER TIMEOUT Enter the duration for waiting before sending a CMD message if a sequence is skipped. You can enter the duration in milliseconds. Group ID Enter the Sparkplug B group name to which you want your collector to subscribe. If this is empty along with the other fields below TOPIC, the collector will subscribe to all the available groups, nodes, and devices. Edge Node ID Enter the Sparkplug B edge node ID to which you want your collector to subscribe. If this is empty, then the Collector will subscribe to all the edge nodes corresponding to the entered GROUP ID. If the GROUP ID and DEVICE ID are also empty, then the collector will subscribe to all the available groups, nodes and devices. Device ID Enter the Sparkplug B device name. If this is empty, the collector subscribes to node messages if a NODE ID is entered, otherwise, if a DEVICE ID is entered, it subscribes to device messages. You can also use wildcards in the GROUP ID, EDGE NODE ID, and DEVICE ID fields. The following wildcards are supported:
- + (single-level wildcard): Supported for all the three fields.
- # (Multi-level wildcard): Supported for the EDGE NODE ID and DEVICE ID
+ (Single-level wildcard): Can be used to subscribe to only one topic level. For example, if you subscribe to a topic<Admin>/+/<ABC-123>
, you will receive messages from all the nodes corresponding to the group and device. That is,<Admin>/Node1/<ABC-123> <Admin>/Node2/<ABC-123> <Admin>/Node3/<ABC-123> ... <Admin>/Noden/<ABC-123>
# (Multi-level wildcard): Can be used to subscribe to any number of levels within a topic. For example, if you subscribe to a topic<Admin>/#
, you will receive messages from all the nodes and devices corresponding to the group,<Admin>/Node1/<ABC-123> <Admin>/Node2/<ABC-123> <Admin>/Node3/<ABC-123> <Admin>/Node1/<ABC-124 <Admin>/Node2/<ABC-124> ... <Admin>/Noden/<Devicen>
Tags to Add Provide a mask along with wildcard to collect those tags that include the mask you provided and store in Historian. For example, *Pressure*. This will collect all the tags that begin with "Pressure". If you enter Pressure*, all the tags that end with "Pressure" will be collected. Similarly, if you enter *Pres?, all the tags that contain "pres" at the beginning will be collected. It can be "Pressure", "Press", or "Pres1". Note: Whenever a new tag is collected, the collector verifies the tag availability in the Historian and, if not present, adds the tag, then adds the data samples, streaming the data to the Historian server or a cloud destination.Tags to Exclude Provide a mask along with wildcard to exclude those tags that include the mask you provided. For example, *Pressure*. This will exclude all the tags that begin with "Pressure". If you enter Pressure*, all the tags that end with "Pressure" will be excluded. Similarly, if you enter *Pres?, all the tags that contain "pres" at the beginning will be excluded. It can be "Pressure", "Press", or "Pres1". Tag Prefix Enter a prefix to be included in the tag. By using this field, you can clearly identify a tag. For example, you can clearly differentiate the tags that are collected. The following options are available:
- <interfacename>
- <groupid>
- <edgenodeid>
- <deviceid>
For example, if all four fields provided and the interface / collector name is "sparkplug1" and the Topic contains group id = g1 edge node id = n1, device id = d1 then device tags will be created in Historian as “sparkplug1.g1. n1.d1.tag1”.
Username Enter the username to connect to the MQTT broker. A value is required if you have configured username/password-based authentication in the MQTT broker. Password Enter the password to connect to the MQTT broker. A value is required if you have configured username/password-based authentication in the MQTT broker. CA Server Root File Enter the path to the CA server root file to connect to the MQTT broker. A value is required if you have configured certificate-based authentication in the MQTT broker. Private Key File Enter the path to the private key file to connect to the MQTT broker. A value is required if you have configured certificate-based authentication in the MQTT broker. Client Certificate File Enter the path to the client certificate file to connect to the MQTT broker. A value is required if you have configured certificate-based authentication in the MQTT broker. MQTT Version Select the version of the MQTT that you want to use. The following versions are supported: - MQTT_V311
- MQTT_V5
- As needed, enter values in the other sections common to all collectors.
-
Restart the collector.
The collector instance is configured.