This article will use the MQTT Explorer as the MQTT client test tool to access the MQTT Cloud service – EMQ X Cloud. In this article, you will quickly learn the basics of the MQTT Explorer and the basic concepts and use of the MQTT protocol.

MQTT Explorer profile

MQTT Explorer is one of the most active DESKTOP applications for MQTT clients and has long been popular with developers. Electron, developed by @ThomasNordquist, is open source and complies with Creative Commons Public Licenses. GitHub address is github.com/thomasnordq…

The main features are:

  • Basic subscribe/push/connect functionality
  • User Authentication
  • WebSocket support
  • Supports diff viewing and multiple types of Payload
  • Logs of basic historical information
  • TLS connection support
  • Support night mode

In particular, some of the better features are:

  • Automatically subscribe to $SYS topics for easy access to broker status information
  • The subscription list is organized in a tree structure to facilitate users to view their affiliation
  • Have message visualization function, intuitive, interactive statistical chart design

The MQTT Explorer meets most development needs, but has some drawbacks:

  • Only one connection can exist at a time, which is inconvenient for multi-connection debugging
  • In the UI design, Publish payload and Subscribe Message list are not separated, and it is not easy to check the receiving and receiving information
  • There is no complete operation log record, it is not convenient for developers to check the information that interacts with the server

Introduction to EMQ X Cloud

EMQ X Cloud is a fully hosted cloud-based MQTT service launched by EMQ that can connect to massive Internet of Things devices and integrate various databases and business systems. As the world’s first fully hosted MQTT 5.0 public Cloud service, EMQ X Cloud provides a one-stop operation and maintenance managed MQTT messaging service in a unique isolated environment.

In the era of the Internet of Everything, EMQ X Cloud can help users quickly build industrial applications for the Internet of Things, and easily achieve the collection, transmission, computing and persistence of the Data of the Internet of Things.

This article will use the free public MQTT server provided by EMQ X Cloud as the MQTT server address for this test. The server access information is as follows:

  • Broker: broker-cn.emqx.io
  • TCP Port: 1883
  • SSL/TLS Port: 8883

For more details, visit the EMQ X Cloud website or check out the EMQ X Cloud documentation.

MQTT Explorer to use

Preview function

The main page is as shown in the following figure, with the topic search bar and connection configuration at the top. On the left is the tree structure of the topic, and on the right is the Publish column, Subscribe column, Payload column, and History information control column.

MQTT connection/subscription

Initialization page

The configuration page pops up the first time you enter the MQTT Explorer.

Create a connection

Click “Connectons” to create a new connection and enter Host as broker-cn.emqx. IO, port as 1883, and protocol as MQTT.

Subscribe to the topic

Then click Advanced. Since EMQ X Cloud disables the $SYS topic and # topic by default, we removed them and entered a test subscription topic, which we named test/1. The result is as shown in the figure below.

The connection

Finally, click Back to go Back to the Connection configuration page and click Connect to complete the connection to EMQ X Cloud and subscribe to the topic Test /1.

When the connection is successful, you will see the nodes in the subscription tree with test and 1, and the status bar on the top right side shows that the connection has been made, with the title of the topic Test /1 on the right side.

MQTT message released

Once the connection is established, type /test/1 in the topic box in the lower right corner of the page, and then type some text, and then click Publish.

Receive subscription messages

After successful publishing, the Value card in the upper right will receive the message just published.

Receiving history

In the History card in the bottom right corner of the page, you will see a record of the messages received by the subscribed topic.

statistics

Stats displays statistics in the lower right corner of the page.

Copyright notice: this article is the original EMQ, reprint please indicate the source.

Link: www.emqx.com/zh/blog/con…