• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Protocols - MQTT I/O
  • MQTT Client
  • 5.0.0

Protocols - MQTT I/O Topics

MQTT Client

MQTT Client

MQTTClient Component

MQTTClient component must be added to the CDP system in order to connect and interact with other devices in the MQTT network.

MQTTClient has the following configurable properties:

PropertyDescription
BrokerHostBroker host to connect to (IP address or hostname).
BrokerPortBroker TCP port (usually 1883 for unencrypted and 8883 for encrypted connections)
UserIDUser ID for authentication with the broker. Can be empty if the broker allows connections without userID.
PasswordPassword for authentication with the broker. Can be empty if the broker allows connections without the password.
ClientIDClient ID to use when connecting to the broker. If empty, a random (but same for every component instance on every start) ClientID will be auto-generated.
KeepAliveConnection keep-alive interval in seconds. The keep-alive functionality assures that the connection with the broker is still open. Defaults to check it after every 60 seconds.
RetryConnection retry in seconds. Sets the time to wait between unsuccessful connection retries. Defaults to 10 seconds.
LWTTopicLWT (Last Will and Testament) topic that can be used by other clients to detect this client's connectivity.
LWTConnectedPayloadPayload that will be sent to LWTTopic at client connect.
LWTDisconnectedPayloadPayload that will be sent to LWTTopic by the broker after this client connection is lost.
EncryptionBroker connection encryption. Choose between options:
  • Unencrypted - no encryption
  • TLS - Use TLS certificate-based encryption and authentication. See also TLS certificate setup.
  • TLS-PSK - use TLS Pre-Shared Key-based encryption and authentication. See also TLS-PSK key setup.
TLSBrokerCACertFileBroker host certificate issuer (CA) file name (used for TLS certificate-based broker verification). See also TLS certificate setup.
TLSBrokerVerificationBroker TLS connection verification method flags: when flag H is set, then the client will check that the broker hostname matches the certificate; when flag C is set - then the client will check that the broker certificate is signed using the CA set in TLSBrokerCACertFile. By default, both checks are turned on.
TLSClientCertFileClient authentication certificate file name (for TLS client authentication). See also TLS certificate setup.
TLSClientKeyFileClient authentication key file name (for TLS client authentication). See also TLS certificate setup.
TLSPSKIdentityTLS-PSK key identity (for TLS-PSK-based encryption/authentication). See also TLS-PSK key setup.
TLSPSKKeyTLS-PSK key hexadecimal string (for TLS-PSK-based encryption/authentication). See also TLS-PSK key setup.
DisablePersistentSessionsFlag to be used for connecting with some MQTT brokers (f.e. AWS) that actively refuse connections with MQTT persistent session facility enabled (cleanSession=false). PS! Be aware that setting DisablePersistentSessions also means that messages received by the broker during client connection failure will not be resent at connection restore (regardless of sender QoS parameter).
ProtocolVersionMQTT protocol version to use. Choose between:
  • 5 - default, newest version, supports many additional features like topic aliases, response topics, correlation data, subscription identifiers, etc
  • 3.1.1 - with some minor improvements (mostly connection maintenance flags) over v3.1. Use v3.1.1 when connecting to Microsoft Azure IoT Hub.
  • 3.1

MQTTClient state can be observed at runtime via these read-only properties:

ConnectedConnection status with the broker.
ConnectionLastChangedTimeThe timestamp of the last connection or disconnection.
LastMessageTimeThe timestamp of the last message sent or received.
PublishedMessageTotalCountSent (published) message total count for all topics.
SubscribedMessageTotalCountReceived (subscribed) message total count for all topics.
BrokerMaxTopicAliasMaximum number of MQTT v5 topic aliases allowed, that the broker informed during connect handshake
UsedAliasesCountMQTT v5 topic aliases currently in use

To send/receive data to/from the MQTT network, there are two different possibilities:

  • Topics can be added to the MQTTClient that will send/receive data to/from signal-channels.
  • Publisher and Subscriber Sequencer blocks can be added and connected to the MQTTClient to send/receive data using Sequencer Events.

Protocols - MQTT I/O Topics

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top