HiveMQ broker

NOTE: The following how-to guide applies only to IoT (MQTT) connection type.

By default, GUI-O application uses a MQTT test broker that is running on our own server. The broker listens on ports 1883 (unencrypted), 8883 (encrypted with client certificates) and 8884 (encrypted). This is perfect for testing and some smaller use cases, but some IoT scenarios require using a broker platform that gives you finer control over additional settings (e.g., managing credentials for different clients).

There are numerous platforms that offer managed cloud MQTT broker, such as HiveMQ, EMQX, CloudMQTT, etc. This how-to guide focuses on migrating from GUI-O broker to HiveMQ broker using ESP32 board.

Step 1: Setup HiveMQ

  1. Navigate to and signup to (free) HiveMQ cloud plan

  2. Login to HiveMQ cloud console and navigate to "Clusters"

  3. Create a new cluster selecting any cloud service provider

  4. Select "MANAGE CLUSTER" (NOTE: The "Cluster URL" is required later)

  5. Select "ACCESS MANAGEMENT" tab and add new credentials (at least one)

Video tutorial of Step 1

Step 2: Setup GUI-O for HiveMQ

  1. Open GUI-O application, open settings and navigate to "Connections -> IoT -> IoT Settings"

  2. Set the "Server name" using the HiveMQ "Cluster URL" from Step 1.

  3. Set the "SSL port number" to 8883

  4. Set the "User name" and "User password" based on the HiveMQ credentials from Step 1.

  5. Navigate to "Connections -> IoT" and press "Connect" to test the connection

Video tutorial of Step 2

Step 3: Setup ESP32 for HiveMQ

  1. Download BasicMQTT_HiveMQ.ino sketch and open it in Arduino IDE

  2. Get the certificate of your HiveMQ broker (see video below)

  • On Linux, open the terminal and enter command "openssl s_client -connect <hivemq_url>:8883 -showcerts" (without the quotes), replacing the <hivemq_url> with the "Cluster URL" from Step 1.

  • You can alternatively use an online Linux terminal (e.g., to execute the same command

  • After running the command, copy the last certificate displayed in the terminal and replace the one in BasicMQTT_HiveMQ.ino source code (keep same certificate formatting)

  1. Finally, refer to ESP32 MQTT video example, while using the BasicMQTT_HiveMQ.ino sketch (make sure that the server url, user name and password are set according to HiveMQ setup from Step 1.)

NOTE: Do not forget to generate and set the publish and subscribe topics!

Video tutorial of Step 3 (get HiveMQ certificate)

Connect . Create . Control

Connect . Create . Control

YouTube channel