MQTT.fx is a mainstream MQTT desktop client. Compatible with Windows, macOS, and Linux, it can quickly verify whether it is possible to connect to IoT Hub and publish or subscribe to messages. For more information on the MQTT protocol, please see MQTT Introduction. This document describes how MQTT.fx can interact with IoT Hub with MQTT.fx 1.7.0 for macOS as an example.
Parameter | Description |
---|---|
Profile Name | Name of the profile |
Broker Address | MQTT server connection address. For more information, see Device Connection Regions. `PRODUCT_ID` in the domain is a variable parameter, and you should replace it with the product ID automatically generated when you create the product, such as `9****ZW2EZ.iotcloud.tencentdevices.com`. |
Broker Port | MQTT server connection port. For certificate authentication, enter `8883`. For key authentication, enter `1883`. |
Client ID | MQTT protocol field. Enter product ID + device name according to IoT Hub's requirement, such as `9****ZW2EZgate_dev01`, where `9****ZW2EZ` is the product ID, and `gate_dev01` is the device name. |
Connection Timeout | Connection timeout period in seconds |
Keep Alive Interval | Heartbeat interval in seconds |
Auto Reconnect | Automatic reconnection after network disconnection |
9****ZW2EZgate_dev01;12010126;12345
(the ProductID
can be viewed on the product list or product details page after the product is created). It is sufficient to replace only the product ID and device name in the example. As the last two parameters are automatically generated by the connection SDK of IoT Hub, fixed test values are entered here.true
by default, you need to enter a random non-empty string as the password; otherwise, you will not be able to connect to IoT Hub's backend. When actually accessing IoT Hub's backend, the authentication is based on the certificate, and the random password entered here will not be used as the access credential.File | Description |
---|---|
CA File | Root certificate. Click the ca.crt link to download the file. |
Client Certificate File | Client certificate file, i.e., the device certificate which can be downloaded if the device is created in a certificate-authenticated product. For more information, please see Device Connection Preparations. |
Client Key File | Client key file, i.e., the device key which can be downloaded if the device is created in a certificate-authenticated product. For more information, please see Device Connection Preparations. |
PEM Formatted | The IoT Hub root certificate, device certificate, and device key are all generated by OpenSSL, and they are all in PEM format. MQTT.fx is a Java client, so it does not recognize PEM certificates. You need to select this option to enable the client to automatically convert the certificates into Java-recognized JKS format. |
Select the Publish tab in the client, enter a topic name, select a QoS level, and click Publish to publish the message. The publishing result can be queried through Cloud Log.
Select the Subscribe tab in the client, enter a topic name, select a QoS level, and click Subscribe to subscribe to the topic. The subscribing result can be queried through Cloud Log.
Was this page helpful?