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
Navigate to https://www.hivemq.com/downloads/ and signup to (free) HiveMQ cloud plan
Login to HiveMQ cloud console and navigate to "Clusters"
Create a new cluster selecting any cloud service provider
Select "MANAGE CLUSTER" (NOTE: The "Cluster URL" is required later)
Select "ACCESS MANAGEMENT" tab and add new credentials (at least one)
Video tutorial of Step 1
Step 2: Setup GUI-O for HiveMQ
Open GUI-O application, open settings and navigate to "Connections -> IoT -> IoT Settings"
Set the "Server name" using the HiveMQ "Cluster URL" from Step 1.
Set the "SSL port number" to 8883
Set the "User name" and "User password" based on the HiveMQ credentials from Step 1.
Navigate to "Connections -> IoT" and press "Connect" to test the connection
Video tutorial of Step 2
Step 3: Setup ESP32 for HiveMQ
Download BasicMQTT_HiveMQ.ino sketch and open it in Arduino IDE
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., https://www.tutorialspoint.com/linux_terminal_online.php) 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)
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