Using MQTT Explorer Client



MQTT Explorer Tutorial

Introduction

MQTT Explorer is a comprehensive MQTT client that provides a structured overview of your MQTT topics and makes working with devices/services on your broker simple.

It is a go-to tool for viewing broker data and manually publishing messages to the broker for testing purposes.

Features:

  • Visualize topics and topic activity

    • It shows a tree view of the topic hierarchy, which helps in understanding the structure of the MQTT broker.

  • Display, search, and filter retained topics

    • This feature lets you check the last known state of the topic.

  • Payload formatting

    • MQTT Explorer supports plain text, XML, and JSON formats as payloads.

    • JSON payloads can be pretty-printed for readability.

  • Real-time monitoring

    • You can see the messages in real time as they are sent from the publisher.

    • It also offers a log of past messages for historical analysis.

  • Friendly User Interface

    • Its simple and compact interface makes it easier to understand pub-sub concepts.

    • The stats tab at the bottom shows a summary of the number of messages, topics, and subtopics.

Downloading MQTT Explorer:

The application can be downloaded using this link based on the operating system used. The current application is supported on Windows, Mac, Ubuntu, and Linux.

Once downloaded, install the application and open it. The initial interface looks like the below.

The host and port details should be provided based on where the broker is set up. If a username and password are set up on the broker configuration, they should be entered.

Using MQTT Explorer as a Publisher:

To use MQTT Explorer as a publisher, ensure that you are connected to the same host and port. Once connected, publish your message over the same topic used for subscribing. The message should now be displayed in the subscriber terminal.

Example:

Write a message that you want to publish, e.g. "Signal Check from MQTT Explorer to Docker". Click Publish.

As shown in the previous example, open a separate external terminal from "Exec" tab in the Docker container terminal and type the below command:

mosquitto_sub -h localhost -t gatewaylabs/topic

(If your topic is different from "gatewaylabs/topic", use that topic instead.)

It should display the message as shown below if connected successfully:

A terminal window running the subscriber command listed above which is displaying the message published.