MQTT.fx is an Eclipse Paho-based Message Queuing Telemetry Transport (MQTT) client that is written in Java. MQTT.fx supports Windows, macOS, and Linux operating systems. MQTT.fx can be used to verify whether a device can connect to IoT Platform. MQTT.fx allows you to subscribe to and publish messages by using topics. This article describes how to connect a simulated device to IoT Platform over MQTT by using MQTT.fx on Windows.
Prerequisites
A product and a device are created in the IoT Platform console. The device certificate and MQTT connection parameters are obtained from the Device Details page. For more information, see the following articles:
In this example, a public instance of the previous version is used. The following table describes the device certificate and MQTT connection parameters. For more information about the parameters, see Establish MQTT over TCP connections.
Parameter | Value |
---|---|
ProductKey | a1*** |
DeviceName | device1 |
DeviceSecret | f35***d9e |
clientId | a1***.device1securemode=2,signmethod=hmacsha256,timestamp=2524608000000 |
username | device1&a1*** |
passwd | 86761***21d |
mqttHostUrl | a1***.iot-as-mqtt.cn-shanghai.aliyuncs.com |
port | 1883 |
Configure MQTT.fx
In the following sections, downstream messaging and upstream messaging are tested to check whether the MQTT.fx client is connected to IoT Platform. If your test results are different from the following sample results, the connection is not established. You must modify the settings based on the logs.
Test downstream messaging
Test upstream messaging
View logs
In the MQTT.fx tool, click the Log tab. On the tab that appears, view the operation logs and error logs.
