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:
Property | Description |
---|---|
BrokerHost | Broker host to connect to (IP address or hostname). |
BrokerPort | Broker TCP port (usually 1883 for unencrypted and 8883 for encrypted connections) |
UserID | User ID for authentication with the broker. Can be empty if broker allows connections without userID. |
Password | Password for authentication with the broker. Can be empty if broker allows connections without password. |
ClientID | Client ID to use when connecting to broker. If empty, random (but same for every component instance on every start) ClientID will be auto-generated. |
KeepAlive | Connection 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. |
Retry | Connection retry in seconds. Sets time to wait between unsuccessful connection retries. Defaults to 10 seconds. |
LWTTopic | LWT (Last Will and Testament) topic that can be used by other clients to detect this client connectivity. |
LWTConnectedPayload | Payload that will be sent to LWTTopic at client connect. |
LWTDisconnectedPayload | Payload that will be sent to LWTTopic by broker after this client connection is lost. |
Encryption | Broker connection encryption. Choose between options:
|
TLSBrokerCACertFile | Broker host certificate issuer (CA) file name (used for TLS certificate based broker verification). See also TLS certificate setup. |
TLSClientCertFile | Client authentication certificate file name (for TLS client authentication). See also TLS certificate setup. |
TLSClientKeyFile | Client authentication key file name (for TLS client authentication). See also TLS certificate setup. |
TLSPSKIdentity | TLS-PSK key identity (for TLS-PSK based encryption/authentication). See also TLS-PSK key setup. |
TLSPSKKey | TLS-PSK key hexadecimal string (for TLS-PSK based encryption/authentication). See also TLS-PSK key setup. |
DisablePersistentSessions | Flag 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). |
ProtocolVersion | MQTT protocol version to use. Choose between:
|
MQTTClient state can be observed at runtime via these read-only properties:
Connected | Connection status with broker. |
ConnectionLastChangedTime | The timestamp of last connection or disconnection. |
LastMessageTime | The timestamp of last message sent or received. |
PublishedMessageTotalCount | Sent (published) message total count for all topics. |
SubscribedMessageTotalCount | Received (subscribed) message total count for all topics. |
In order to send/receive data to/from MQTT network, Topics must to be added to MQTTClient.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.