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,InstallerorFull control. - Change the connection, message and topic settings:
Editor,InstallerorFull control. - Send MQTT commands: set by the broker.
Step 1: MQTT Service
- On the Settings tab of the logger, set MQTT Enabled to Enable.
- In the menu of the setting, click Set.
Step 2: Broker Connection
- Configure and start the broker.
- On the Settings tab of the MQTT client page, in the menu of Connect, click Open.
- On the Basic tab, type the Broker URI, for example tcp://127.0.0.1:1883.
- If the broker uses authentication, type the Username and the Password.
- 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
- In the menu of Publish Settings, click Open.
- Select the QOS.
- Type the Publish Interval in seconds.
- Click Save.
Step 4: Topics
- In the menu of Topics, click Open.
- Click the tab of a topic group.
- Turn on the switch of each topic to send.
- Click Save.
Step 5: Connection Check
- Open the Device Info tab.
- 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
$SYSstatistics.
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}/#andsolarmd/clients/#. Let it subscribe tosolarmd/v2/{serial}/cmd/variablesand$SYS/broker/#. - Plant Control and Smart Alerts use a value that an MQTT command sets.