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)
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
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!
Connect . Create . Control