Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

The MQTT Tools refer to a configuration interface for managing MQTT connections and exploring data structures interactively. Its purpose is configuring, connecting, and visualizing data exchanged via the MQTT protocol. Main functionalities include managing MQTT connections, simulating MQTT message publication, and data visualization. Applications include IoT sensor monitoring, application development, and debugging in MQTT connectivity.

On this page:

Table of Contents
maxLevel3
stylenone

Understanding the MQTT Tools

MQTT Tools provides functionalities for managing MQTT communications.


Expand
titleTMQTT Service Installation

Refer to Enabling the TMQTT Broker for information on how to install the TMQTT Service.

Connecting and Disconnecting

Use the Connect button to connect to the target MQTT broker. If you are already connected, use the Disconnect button to finish your connection. The connection status appears beside the buttons.


MQTT Broker options

The MQTT Broker Connection options include a Local Built-in Broker, allowing users to start or stop the broker with command buttons and adjust settings via the TMQTT Broker Settings dialog. The Solution Connection option enables selection from predefined MQTT TagProviders or Devices Nodes to generate connection strings. In contrast, the Remote Broker URL option permits URL entry for remote brokers, with configurable parameters accessible through the MQTT Broker Connection dialog to manage IoT device communications.

Expand
titleTMQTT Service Installation

Refer to Enabling the TMQTT Broker for information on how to install the TMQTT Service.



Local Built-in Broker

This configuration option allows the user to use a built-in MQTT broker that is integrated within the tool.

The button starts the broker, and the button stops it. When you click on the icon next to the command buttons, it opens the TMQTT Broker Settings dialog window. This configuration dialog has two tabs: General and Local/Remote.

General 

This tab has the following configuration items:

Backlog: Manages the queue of pending messages that the broker can handle. Proper configuration ensures the broker effectively manages high volumes of messages without dropping or delaying data.

DisableRetainedFile: Disables retained message storage. Disabling it can improve performance and reduce storage needs but may cause clients to miss important retained messages.

MaxPendingMessagesPerClientOut Specifies the maximum number of pending messages allowed per client. It prevents any single client from overwhelming the broker, ensuring fair resource allocation and avoiding potential denial of service conditions.

User Credentials: Manages user authentication details, including UserName and Password. Proper user authentication secures the broker, preventing unauthorized access to the IoT network and ensuring only authenticated clients can publish or subscribe to topics.

Client Connections: Manages client connections, including ClientName, Topic, and permissions (Can Subscribe, Can Publish). Managing client permissions ensures that clients can access only authorized data, enhancing security and data integrity.

Local/Remote

This tab has similar configuration item for both Local and Remote. The difference is that Remote has additional configuration items.

Local

Listening Port: Specifies the port on which the broker listens for incoming MQTT connections. Default is 1883. Proper configuration ensures the broker accepts connections on the correct port, establishing and maintaining communication.

Certificate File: Uploads the SSL/TLS certificate file used for secure connections. Using SSL/TLS certificates encrypts data in transit, protecting against eavesdropping and tampering, and securing communication between clients and the broker.

Certificate Password: Enters the password for the SSL/TLS certificate. This adds an additional security layer by protecting the certificate itself, ensuring only authorized personnel can configure or update the certificate for secure communications.

SSL Protocols: Selects the desired security protocol (none, TSL, TSL 1.0, TSL 1.2). Choosing the appropriate SSL/TLS protocol encrypts data transmitted between clients and the broker, protecting against security threats and ensuring compliance with industry standards.

Remote

The settings for remote MQTT broker include the previous items plus the following:

Broker URL: Specifies the address of the remote MQTT broker.

KeepAlive: Configures the keep-alive interval for maintaining the connection. It ensures the connection remains open by sending periodic keep-alive messages, preventing inadvertent disconnection and ensuring consistent data flow between clients and the broker.

WebSocket: This checkbox option enables WebSocket connections for MQTT. WebSockets allow MQTT to be used over web-based applications, integrating MQTT communication into web interfaces and applications that use web protocols, broadening the applicability and accessibility of MQTT communication.

Allow Untrusted Certificates: This checkbox option allows using untrusted SSL/TLS certificates. This flexibility aids development and testing environments where strict security measures are not required. However, this setting should be avoided in production environments due to potential security risks.

The message "TMQTTBroker is running" confirms that the broker is active. Additionally, there are two options: 

Enable Trace: When enabled, it provides the option to enable tracing of MQTT messages. It logs detailed information about MQTT messages, including their content, source, destination, and timestamps.

Enable Raw View Mode: When selected, it displays the raw data of MQTT messages without any formatting or parsing, providing a clear view of the actual transmitted data. It presents raw data and low-level information for debugging and shows unprocessed data streams, memory contents, register values, and network packets that facilitate in-depth troubleshooting.


Solution Connection

This configuration option has a drop-down menu that allows users to select predefined MQTT TagProviders or Devices Nodes to discover their data. When selected, the Solution Connection option generates a connection string with the connection details of the selected TagProvider or Device Node. It contains the parameters for connecting to the target MQTT broker.

Enabling this configuration can require creating an MQTT External TagProvider or configuring a MQTT Device. For more details, refer to the External TagProviders.


Remote Broker URL

Allows the user to enter the URL of a remote MQTT broker. The icon next to the field may open additional configuration options for the remote broker connection.

Specifies the Remote Broker URL to connect to an remote MQTT broker, allowing integration with external data sources. Clicking on the next to the Remote Broker URL field opens the MQTT Broker Connection dialog window.

The Broker Settings dialog allows users to configure the connection parameters for a remote MQTT broker. This configuration establishes a reliable and secure connection to the broker, managing the communication between IoT devices and applications. The following configuration items are available:

Field

Description

Broker URL

Specifies the address of the MQTT broker. This is typically an IP address or a domain name (e.g., localhost).

Port

Indicates the port number used for the connection. The default MQTT port is 1883.

ClientID

A unique identifier for the client connecting to the broker. This ensures that each client can be uniquely identified.

Username

(Optional) username required for authentication with the broker.

Password

(Optional) password required for authentication with the broker.

Certificate File

Path to the SSL certificate file used for secure connections. This is important for encrypted communication.

Certificate Password

Password for the SSL certificate file, ensuring secure access to the certificate.

Network Security

Specifies the security protocol used (e.g., None, SSL, TLS). Determines the encryption level for the connection. Network security options for MQTT brokers include: 

None: No encryption or protocols are applied. This option is suitable for secure or isolated networks but risky in public settings.

TLS 1.0: An early TLS version that enhances SSL 3.0 security. However, it is now outdated and vulnerable to attacks like POODLE and BEAST. It is generally discouraged.

TLS 1.1: An improvement over TLS 1.0, addressing initialization vector issues. However, it remains outdated and susceptible to attacks, with limited support for new standards.

TLS 1.2: Offers significant security upgrades, supporting modern cryptographic algorithms like AEAD ciphers. It ensures data confidentiality and integrity. TLS 1.2 is the recommended secure protocol for network communications until TLS 1.3 sees wider adoption.

WebSocket

Checkbox option to enable WebSocket connections. This is useful for scenarios where traditional MQTT ports are blocked.

QoS

The Quality of Service (QoS) levels in MQTT define the guarantee of message delivery between the sender and the receiver. The available QoS levels are:

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)

Time interval in seconds to keep the connection alive. Ensures that the connection remains open even if no messages are sent.



MQTT Publisher Simulator

This tool allows users to simulate an MQTT Publisher device integrated into the platform.

The button starts the Simulator, and the button stops it. Clicking on the green play button opens the MQTTspB Simulator window. This window has buttons to connect and disconnect. It also has two tabs: Connection Parameters and Payload Settings.


Connections Parameters displays configurations options defined on MQTTspB Simulator Configuration, such as the Broker URL, Port, Username, Password, Start Minimized, Block Configuration Field, Connect On Startup and Publish Data On Startup.


The Payload Settings of the MQTTspB Simulator Configuration dialog allows users to manage settings related to the data payload being sent, such as GroupID, Number of NodesIDs and the Edit Data Structure button. 

GroupID:Specifies a unique identifier for a group of clients or devices. This identifier helps organizing and managing clients within the same group.

Number Of NodeIDs:Indicates the number of nodes or individual devices within the specified group. This value helps structuring the data to be sent, ensuring that the correct number of nodes is included in the payload.

Edit Data Structure: This button allows users to modify the data structure that will be used in the payload. Clicking this button opens a configuration popup where users can define or adjust the data points, types, and hierarchical organization of the data to be published.


When you click on the icon next to the command buttons, it opens the MQTTspB Simulator Configuration dialog. This configuration dialog has the following fields:

MQTTspB Simulator Configuration


Broker URL

Specifies the IP address or domain name of the MQTT broker. For example, 127.0.0.1 indicates a local broker running on the same machine as the simulator.

Broker Port

Indicates the port number used to connect to the MQTT broker. The default port for MQTT is 1883, which is specified here.

Username

Allows to enter the username required for authentication with the MQTT broker. This is used to verify the identity of the client connecting to the broker.

Password

Allows to enter the password required for authentication with the MQTT broker. This works in conjunction with the username to authenticate the client.

GroupId

Specifies a unique identifier for a group of clients or devices. This can be used to manage and identify clients within a specific group.

ConfigFile

Displays the path to the configuration file used by the simulator. This file contains the saved settings for the simulator, allowing for easy reconfiguration and management.

Minimized

When checked, starts the simulator minimized. This can be useful for reducing screen clutter and running the simulator in the background.

Block Configuration Field

When checked, prevents changes to the configuration fields once the simulator is running. This helps maintain consistency and prevents accidental modifications during operation.

Connect On Startup

When checked, automatically connects the simulator to the MQTT broker upon startup. This is useful for ensuring that the simulator is always connected and ready to operate as soon as it is launched.

Publish Data On Startup

When checked, enables the simulator to start publishing data immediately upon connecting to the broker. This automates the data publication process, ensuring that data starts flowing as soon as the connection is established.

Refer to the MQTTspB Simulator for detailed information.


Editing MQTT Data Structure

This configuration popup in the MQTTspB Simulator allows users to define and customize the data payload that the simulator will publish to the MQTT broker. Here is a detailed description and explanation of each section and its components:

NodeIDs

NumberOfNodes: Specifies the number of nodes (or groups of devices) included in the data structure. Default value is set to 4, meaning there are four groups of devices.

Node List: Lists the node names. By default, the nodes are named "Barcelona," "Bilbao," "Madrid," and "Sevilha." Users can add or remove nodes using the add (+) and remove (–) buttons.

DeviceIDs

Device List: Lists the devices under the selected node. By default, the devices are named "Panel_1," "Panel_2," and "Panel_3." Users can add or remove devices using the add (+) and remove (–) buttons.

Tags

Tags Table: Defines the tags associated with each device. Each row represents a variable with the following columns:

Name: The name of the variable (e.g., "Name," "State," "Latitude," "Longitude").

Type: The data type of the variable (e.g., "String," "Boolean," "Double").

VariationFlag: Indicates whether the variable should vary over time. When checked, the variable's value will change according to the specified range.

Min: The minimum value of the variable when it varies.

Max: The maximum value of the variable when it varies.

InitialValue: The initial value assigned to the variable when the simulation starts.


Controlling the Simulator

The Simulation Control in the MQTTspB Simulator allows users to manage the data publication process. Here is an explanation of each control option available:

Publish One Data Sample: Initiates publishing a single data sample to the MQTT broker. It is useful for testing and verifying if the data structure and connection are configured correctly. By publishing one sample, users can ensure the data is sent and received as expected without starting a continuous data flow.

Publish Continuous Data: Starts the continuous publication of data to the MQTT broker. When active, the simulator will repeatedly send data samples at specified intervals. This is useful for simulating real-time data streams and stress testing the MQTT infrastructure. Continuous data publishing also helps evaluate how the system handles sustained data loads.

Stop Publishing Data: Stops the data publication process, whether a single or continuous data sample. It controls the data flow and stops the simulation when necessary. Stopping data publication can be used to adjust configurations, analyze received data, or halt the simulation after a specific testing period.


Browsing the Asset model

The table in the MQTT Tools displays the hierarchical organization and current state of various parameters. It includes columns for each parameter's name, type, value, timestamp, and address, allowing users to browse the asset model and view the data model and their organization. Each row represents a specific data point within the hierarchy, providing details on its current state and location within the MQTT topic structure, facilitating effective monitoring and management of the system. Here is an brief description and explanation of each column in the table:

Name: This column lists the names of various entities and parameters in the simulation. It includes hierarchical names that represent groups, panels, and specific parameters within those panels. Examples include "LocalBroker," "spBv1.0," "GroupID," "Barcelona," "Panel1," and specific data points like "Latitude," "PanelPower," etc.

Type: This column indicates the data type of each parameter listed in the "Name" column. Common types shown include "ModuleDevice," "Double," "Text," and "Digital." These types describe the nature of the data, such as numerical values (Double), text strings (Text), and binary states (Digital).

Value: This column displays the current value of each parameter at the given timestamp. The values can be numerical, textual, or binary. For example, "37.36" for Latitude, "Sevilha - Panel1" for Name, and "true" for State.

Timestamp: This column shows the exact date and time when the value of each parameter was recorded. This is useful for tracking the time-specific states and readings of the various parameters. The format used is "M/D/YYYY H:MM AM/PM."

Address: This column provides the full address or path within the MQTT topic hierarchy for each parameter. This path helps locate the specific data points within the overall structure of the simulation. Examples include "spBv1.0/GroupID/Sevilha/Panel1/Latitude" and "spBv1.0/GroupID/Sevilha/Panel1/PanelPower."


Configuring the MQTT Tools

To configure the MQTT Tools, go to Data Explorer / MQTT Tools.

Anchor
Enabling the TMQTT Broker
Enabling the TMQTT Broker
Enabling the TMQTT Broker

To enable the built-in MQTT Broker when it is not running, follow these steps:

  1. Open the Solution Manager and navigate to the Server Information section to check the current services.

  2. If the MQTT Broker is not listed as an installed service, go to Add Services.

  3. Click the MQTTBroker icon to add it as a service. This action installs the MQTT Broker on your server.

  4. After installation, return to the Solution Designer and go to Data Explorer / MQTT Tools.

  5. Check the status of the TMQTTBroker to ensure it is active and running.

This process installs and activates the built-in MQTT Broker, allowing for subsequent configurations and connections in the MQTT Tools of the Data Explorer.


Enabling Solution Connections Configuration

There are two options available on the software platform to enable the Solution Connection configuration on the Data Explorer / MQTT Tools:

By Configuring an MQTT Device

All initial configurations for devices in the solutions on the software platform encompass the following workflow:

  1. Defining a Channel using a target communication Protocol. It will create the base instance for linking a Node;

  2. Defining the Node linked to the created Channel;

  3. Defining the Point that you would like to monitor.

Navigate to the Devices Module on the software platform.

Create a new channel using MQTT protocols. Channels establish global parameters for the use of a specific protocol. They include configuration details such as the broker URL for MQTT, port numbers, and security settings like SSL/TLS certificates. Channels ensure that all nodes linked to them adhere to the same communication settings.

Define a node within the created channel. Nodes represent the field device. Each node is identified by a unique field address (PrimaryStation), allowing the platform to recognize and communicate with specific devices within the network. Nodes link to a defined channel to inherit its communication settings.

For detailed information refer to the Devices.

By Connecting to an MQTT External TagProvider

Navigate to the Unified Namespace / External TagProviders on the software platform.

Create a new External TagProvider for MQTT. This involves setting up the connection parameters, such as broker address, port, and authentication credentials.

Configure the tag provider to match the data structure and requirements of the Solution Connection. This includes setting up the appropriate topics, QoS levels, and data formats.

For detailed information refer to the External TagProviders.


Remote Broker URL Connection

There are two options available on the software platform to enable the Solution Connection configuration on the Data Explorer / MQTT Tools:

To connect using the Remote Broker URL option, start by entering the broker’s IP address or domain name in the specified field. Click the icon next to this field to access the MQTT Broker Connection dialog. In this dialog:

  1. Specify the port number, typically 1883.

  2. Assign a unique ClientID to identify the client.

  3. If authentication is required, input the username and password.

  4. For secure connections, provide the path to the SSL certificate file and its password.

  5. Select the network security protocol, such as SSL or TLS 1.2, to ensure encrypted communication.

  6. Enable WebSocket connections if traditional MQTT ports are blocked.

  7. Choose the Quality of Service (QoS) level based on the desired message delivery guarantee.

  8. Configure the KeepAlive interval to maintain an open connection during inactivity.

After completing these configurations, save the settings to establish a reliable and secure connection between your client and the external MQTT broker, enabling effective communication between IoT devices and applications.


Working with

the

MQTT

Tools

The software platform supports MQTT Integrations, offering extensive options for connecting and managing IoT devices. Working with MQTT tools reveals the platform's capabilities in enabling real-time data exchange, simplifying device communication, and enhancing system interoperability. Refer to the MQTT documentation for detailed information.


In this section:

Page Tree
root@parent
spacesV10