QuickStart Guide
...
Industrial Systems Connection ...
MQTT

MQTT Client

9min

You can set up an MQTT Client through DeviceHub.

Note: You can't connect the MQTT Client to the DeviceHub Industrial OT Server if they are using the same Litmus Edge instance. This includes connecting through the Flows Manager or through an Integration connector. If they are using different Litmus Edge instances, they can connect.

Step 1: Add MQTT Client to DeviceHub

To add the MQTT Client to Device Hub:

  1. In Litmus Edge, navigate to DeviceHub.
  2. Click the Connect a Device box.

    The Connect Device dialog box appears.

    Connect a device icon
    Connect a device icon
    
  3. For Driver Type, select MQTT. Then, for Driver Name, select MQTT Client.
  4. Enter a name for the client. Optionally, add a description.
  5. For Broker Address, enter the broker IP address or host name.
  6. For Port, enter the port of the broker.

Configure the client with the following options.

Client Authentication

Select one of the following client authentication methods:

  • Anonymous
  • Certificate (only for SSL mode)
  • Username/Password
  • Username/Password & Certificate

Update the default username and password values as needed.

Security Mode

If you enable security mode, upload or paste the certificate in the Certificate Authority field.

Certificate Authority field
Certificate Authority field


Will Enabled (Last Will and Testament)

If you enable a last will and testament, (LWT) configure the following.

  • Will Topic: Enter the topic for the last will and testament.
  • Will Payload: Enter the payload in string format.
  • Will Qos: Select one of the following message delivery options.
    • 0 - At most once (fire and forget)
    • 1 - At least once (acknowledged delivery)
    • 2 - Exactly once (assured delivery)
  • Will Retained: Select Enable or Disable.
Document image


Advanced

If you show these options, configure the following as needed.

  • Client ID: Enter the MQTT Client ID. The default client ID is the DeviceHub device name.
  • Persistent Session: Select Enable or Disable.
  • Certificate Verification: Select Enable or Disable.
  • Protocol Version: Select the MQTT protocol version: v3 (3.1), v4 (3.1.1), v5 (5.0).
  • Keep Alive Period: Configure the keep-alive period in seconds.
  • Write Timeout: Configure the write timeout in seconds.
  • Connect Timeout: Configure the connect timeout in seconds.
Advanced fields
Advanced fields


Additional Options

See the Define Optional Parameters section to learn more about additional options.

When done configuring the device, click Add Device.

Step 2: Add Tags

When you Add Tags to the connected device refer to the following tag parameters.



Step 3: Connect to MQTT Server

Once the client is connected in Litmus Edge with tags, you can connect it to an MQTT server.

Note: You can't connect the MQTT Client to the DeviceHub Industrial OT Server if they are using the same Litmus Edge instance. If they are using different Litmus Edge instances, they can connect.