• 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

  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Product
    • Design UI
    • Develop
    • Analyze and test
    • Deploy
    • Framework and toolbox
    • Compatibility
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

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

Protocols - MQTT I/O Topics

MQTT Client

MQTT Client

MQTTClient Component

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

MQTTClient has 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 broker allows connections without userID.
PasswordPassword for authentication with the broker. Can be empty if broker allows connections without password.
ClientIDClient ID to use when connecting to broker. If empty, 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 broker is still open. Defaults to check it after every 60 seconds.
RetryConnection retry in seconds. Sets 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 connectivity.
LWTConnectedPayloadPayload that will be sent to LWTTopic at client connect.
LWTDisconnectedPayloadPayload that will be sent to LWTTopic by 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.
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 broker during client connection failure will not be resent at connection restore (regardless of sender QoS parameter).
ProtocolVersionMQTT protocol version to use. Choose between:
  • 3.1.1 - default, newest version
  • 3.1 - older version, must be selected when connecting to older brokers that do not support 3.1.1

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

ConnectedConnection status with broker.
ConnectionLastChangedTimeThe timestamp of last connection or disconnection.
LastMessageTimeThe timestamp of last message sent or received.
PublishedMessageTotalCountSent (published) message total count for all topics.
SubscribedMessageTotalCountReceived (subscribed) message total count for all topics.

In order to send/receive data to/from MQTT network, Topics must to be added to MQTTClient.

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

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

    © Copyright 2022 CDP Technologies. Privacy and cookie policy.

    Return to top