The MQTT TagProvider provides access to standard MQTT data, as well as automatically parsing data using the SparkplugB specification. The MQTT TagProvider allows you to dynamically connect to MQTT brokers at Runtime. This enables the integration and visualization of data and other components of your application without the need to create local tags.
On this page:
Configuration
The software platform supports both MQTT Standard and MQTT SparkplugB protocols. MQTT Standard allows general message communication via publish/subscribe, quality of service levels, message retention, last-will messages, and secure connections. SparkplugB adds standardized data models, device birth and death messages, auto-discovery, network state monitoring, efficient binary payloads, and state retention, enhancing interoperability and network management in industrial IoT applications.
MQTT Standard
To set up MQTT as a TagProvider, navigate to Unified Namespace → TagProvider Connections and select the MQTT Message Queuing Telemetry Transport.
MQTT SparkplugB
To set up MQTT SpB as a TagProvider, navigate to Unified Namespace → TagProvider Connections and select the MQTT SparkplugB Protocol.
Connection Parameters
Both options share the same configuration parameters.
Field | Description |
---|---|
Provider | Specifies the system the TagProvider will interface with. In this case, it interfaces with the MQTT Message Queuing Telemetry Transport. |
Access Mode | Determines permissions for interacting with tags. Read allows data reading. Write permits data writing. ReadWrite enables both reading and writing. |
Name | User-defined name for the TagProvider instance. Identifies the specific configuration in the system. |
Description | Explains the TagProvider's purpose or the systems it interfaces with. Provides context for its usage. |
ProtocolOptions | Defines specific communication settings for the connection to the device. |
Connection | Defines connection settings for the MQTT broker, including broker URL, port, client ID, username, password, and security options. |
The Test button verifies the connection settings to ensure successful communication with the specified broker.
Field | Description |
---|---|
BrokerURL | Specifies the URL of the MQTT broker. |
Port | Sets the port number used for communication with the MQTT broker. |
ClientID | A unique identifier for the client connecting to the MQTT broker. This is a user-defined string, which can also include the following macros, intermixed with the text:
|
UserName | Specifies the username for authentication with the MQTT broker. |
Password | Specifies the password for authentication with the MQTT broker. |
X509Certificate | Specifies the X.509 certificate for secure communication with the MQTT broker. |
X509Certificate Password | Specifies the password for the X.509 certificate. |
Network Security | Network Security options specify the security protocol (e.g., None, SSL, TLS) and encryption level for MQTT connection. Options include: None: Applies no encryption or protocols, suitable for secure or isolated networks but poses risks in public settings. TLS 1.0: Uses an early version of the Transport Layer Security (TLS) protocol with enhancements for security, now outdated and vulnerable to attacks. TLS 1.1: Addresses initialization vector issues and includes protection against certain types of attacks but remains susceptible to modern cryptographic attacks with limited support for new standards. TLS 1.2: Provides significant security upgrades, supporting modern cryptographic algorithms like AES-GCM and AEAD ciphers. Ensures data confidentiality and integrity with robust mechanisms for secure key exchange and message authentication. Recommended for secure network communications and widely supported across modern systems and applications. TLS 1.3: Enhances security and performance by reducing handshake latency, eliminating outdated cryptographic algorithms, and enforcing forward secrecy. Supports modern cipher suites, improving overall security and efficiency in network communications. SSL2: Implements an early security protocol that is now considered obsolete due to numerous vulnerabilities, including susceptibility to man-in-the-middle attacks and lack of protection against cipher block chaining attacks. Deprecated and should not be used. SSL3: Offers an updated protocol but remains vulnerable to attacks such as POODLE. Lacks modern security features and should be avoided in favor of newer protocols like TLS 1.2 for secure communications. |
WebSocket | Enables WebSocket protocol for communication with the MQTT broker. |
Collector ID | Specifies the collector ID for identifying the data source. |
QoS | Defines the Quality of Service level for message delivery. Options include: AtMostOnce: Ensures that each message is delivered at least once to the receiver. This level may result in duplicate messages but guarantees that no message is lost. AtLeastOnce: Guarantees that a message is delivered at most once, meaning it might not be delivered at all. This level is suitable for scenarios where occasional message loss is acceptable but duplicate messages are not. ExactlyOnce: Ensures that each message is delivered exactly once. This is the highest level of service, preventing both message loss and duplication, but it incurs the highest overhead. |
KeepAlive (sec.) | Sets the keep-alive interval in seconds for maintaining the connection to the MQTT broker. |
Report Out Of Range By Exception | Enables reporting only when data goes out of the expected range, reducing network traffic. |
ConnectionString | Displays the full connection string used to connect to the MQTT broker. Provides a summary of all connection parameters. |
To view the tags imported from MQTT, go to Unified Namespace -> Asset Tree and create a folder.
Then, use the "Insert Link to TagProvider" and select the MQTT you just added. You can link all the data to the folder on your Asset Tree or select a specific part of the application.
Once the data is added to the Asset Tree, you'll be able to browse all the values.
In this section: