Connecting with IoT Hub using MQTT.fx

Things Connection with Cloud.

Internet of Things is an emerging opportunity for making human and machines connected for future. MQTT is the most common protocol to make things to connect with any IoT platform to publish data. To experience the MQTT connection with IoT platform, we will use MQTT.fx client tool and Fogwing Community Cloud.

Fogwing is an Industrial IoT platform that enables any edge computing devices to connect with cloud and send meta and processed data for larger data analyses. Fogwing supports the MQTT protocol-based integration to send the data from devices. If you want to know more about Fogwing IIoT Platform and its feature, visit

Now you may want to simulate your edge devices to IoT platform integration through MQTT client program and Fogwing Community without having any devices; To simulate the connection, you can use MQTT.fx client desktop application.

In this blog, we will walk you through the sending of device data from MQTT.fx to Fogwing Community Cloud Platform.

Setup Fogwing Community Account

Sign up for Fogwing Community (login if you already have an account)

• Following the instructions to create application,

• Create edge configuration

• Finally, create an IoT Hub Access. Fogwing should send client id credentials by email.

• Click on “view” in IoT Hub Access that you have just created and note down all the credentials. (Note: your password will not appear here)

Setup MQTT.fx Client Configuration

· Download and install MQTT.fx

· Configure the Connection Profile for MQTT.fx

· Broker Address:

· Broker Port: 8883

· Client Id: Use your client id generated

MQTT.fx Software Screenshot

◦ Go to User Credentials: Use your username and password.

MQTT.fx Software Screenshot

◦ Finally go to SSL/TLS: Click on Enable SSL/TLS and choose CA signed server certificate.

MQTT.fx Software Screenshot

• Now click on Connect to connect with Fogwing MQTT Broker

• Enter the topic that you have got from Fogwing IoT Hub Access (Note: Do not use any other topic otherwise you will be disconnected from the connection). All the setup is completed now.

Publishing Data

You can start publishing data to Fogwing IoT Hub (MQTT broker). Before publishing the data, you need to be mindful a of few things. Fogwing supports JSON format of data for processing. Therefore, data should be in JSON format as appeared below. Also, it should have client_id and dev_eui in proper key value pair.

Example of Sample Data:

{“dev_eui” : “1011121314151617”, “client_id”: “xxx-xxx-xxx-xxx”, “payload”:{“Moisture” :”87", “Frequency” : “462”, “Temperature” : “60.5”, “Humidity” : “85”}}

Analyze your Data at Fogwing

After successful publish, you can login to your Fogwing Community Cloud and go to Data log page to view all your data published.

Please note that the above exercise is for simulation of edge devices to Fogwing IoT Cloud communication. You can modify the data format to add additional parameters in case you want to prepare your IoT solution design.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store