This article will use MQTT Explorer as the MQTT client test tool to access the MQTT cloud service-EMQ X Cloud . Through this article, you will be able to quickly understand the basic usage of MQTT Explorer and the basic concepts and usage of the MQTT protocol.
Introduction to MQTT Explorer
MQTT Explorer is currently a relatively active MQTT client desktop application, which has always been loved by developers. The main technology is Electron , developed and open sourced @thomasnordquist Creative Commons Public Licenses protocol, and the GitHub address is https://github.com/thomasnordquist/MQTT-Explor/MQTT.
Its main features are:
- Basic subscription/push/connection function
- User authentication function
- WebSocket support
- Support diff view and multiple types of payload
- Basic historical information log
- Support TLS connection
- Support dark night mode
In particular, some of the better features are:
- Automatically subscribe to the $SYS topic for easy viewing of broker status information
- The subscription list is organized in a tree structure to facilitate users to view their attribution relationships
- With message visualization function, intuitive and interactive statistical chart design
MQTT Explorer can meet most development needs, but it also has some disadvantages:
- Only one connection can exist at a time, which is not convenient for multiple connection debugging
- In the UI design, the Publish payload and Subscribe Message list are not separated, and it is not easy to check the status of sending and receiving messages.
- There is no complete operation log record, which makes it inconvenient for developers to check the information interacting with the server
Introduction to EMQ X Cloud
EMQ X Cloud is EMQ that can connect to massive IoT devices and integrate various databases and business systems. As the world's first all-hosted MQTT 5.0 public cloud services , EMQ the X-Cloud hosting provides a one-stop operation and maintenance, the unique environment of isolation MQTT messaging service.
In the era of the Internet of Everything, EMQ X Cloud can help users quickly build industry applications for the Internet of Things, and easily realize the collection, transmission, calculation and persistence of Internet of Things data.
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, please visit EMQ X Cloud official website , or check EMQ X Cloud document .
MQTT Explorer use
Function preview
The main page is shown in the figure below, with the topic search bar and connection configuration at the top. Below it is the tree structure of the subject on the left, and on the right is the Publish column, Subscribe column, Payload column, and History information control column.
MQTT connection/subscription
Initialize the page
The configuration page will pop up when you enter MQTT Explorer for the first time.
Create connection
Click Connectons to create a new connection, and fill in the Host as broker-cn.emqx.io, the port as 1883, and the protocol as mqtt protocol.
Subscribe to topics
Then click Advanced. Because EMQ X Cloud bans the topic #
$SYS
default, we delete them and enter a test subscription topic. We named it test/1
. The result is shown in the figure below.
connect
Finally, click Back to return to the connection configuration page, and click Connect to complete the connection of EMQ X Cloud and the subscription of the test/1
After the connection is successful, you will see that the subscribed tree structure has test
and 1
, and the status bar on the upper right side shows that it is connected, and the right side contains the title of the test/1
MQTT news release
/test/1
subject box at the bottom right corner of the page, and enter some text, and then click Publish to send the message.
Receive subscription messages
After the release is successful, the newly released message will be received in the Value card at the top right.
Receiving history
In the History card at the bottom right corner of the page, you will be able to see the message records received by the relevant subscription topic.
Statistics
Stats will display statistics in the lower right corner of the page.
Copyright notice: This article is the EMQ , please indicate the source for reprinting.
Original link: https://www.emqx.com/zh/blog/connecting-to-emqx-cloud-with-mqtt-explorer
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。