Knowledge Base
Article

Set up the MQTT client

Edit

Set up the MQTT client

Scope

The MQTT client is a LoggerV function that sends LoggerV data to an MQTT broker and receives system variable values from it. The LoggerV does not contain a broker. Companions: MQTT client field definitions and MQTT topics and payloads field definitions.

Location

  • MQTT Enabled: My Devices, the logger, then the Settings tab.
  • MQTT client page: My Devices, then MQTT Publisher Client.

Permissions

  • See the MQTT client page: any access level.
  • Turn on the MQTT client: Editor, Installer or Full control.
  • Change the connection, message and topic settings: Editor, Installer or Full control.
  • Send MQTT commands: set by the broker.

Step 1: MQTT Service

  1. On the Settings tab of the logger, set MQTT Enabled to Enable.
  2. In the menu of the setting, click Set.

Step 2: Broker Connection

  1. Configure and start the broker.
  2. On the Settings tab of the MQTT client page, in the menu of Connect, click Open.
  3. On the Basic tab, type the Broker URI, for example tcp://127.0.0.1:1883.
  4. If the broker uses authentication, type the Username and the Password.
  5. Click Save.
  • TLS: type an ssl:// Broker URI, for example ssl://broker.example.com:8883. The broker certificate must chain to a certificate authority that Java trusts by default.
  • Not available: a client certificate, or a private certificate authority.

Step 3: Publish Settings

  1. In the menu of Publish Settings, click Open.
  2. Select the QOS.
  3. Type the Publish Interval in seconds.
  4. Click Save.

Step 4: Topics

  1. In the menu of Topics, click Open.
  2. Click the tab of a topic group.
  3. Turn on the switch of each topic to send.
  4. Click Save.

Step 5: Connection Check

  1. Open the Device Info tab.
  2. Make sure that Broker connection shows Connected.

Troubleshooting

  • View-only on this site. Your access level cannot turn on the MQTT client.
  • No available topics: no device has a topic yet. Open Topics again when the devices are online.
  • Broker connection lost: the broker or the network stopped. The LoggerV connects again.
  • Broker Status shows no values: the broker does not send $SYS statistics.

Tips and Gotchas

  • After a failed connection, the LoggerV tries again after 30 seconds.
  • Do not use topics marked [Deprecated].
  • If the broker has an access control list, let the LoggerV send to solarmd/v2/{serial}/# and solarmd/clients/#. Let it subscribe to solarmd/v2/{serial}/cmd/variables and $SYS/broker/#.
  • Plant Control and Smart Alerts use a value that an MQTT command sets.

Related articles