Hello,
I installed the following code you suggested me “Connecting ESP 32 CAM with Hive MQ Cloud” in my ESP32 through Arduino IDE, and it worked. So I wonder if what is missing to connect my ESP32 using my own code, I need to include the “HiveMQ Cloud Let’s Encrypt CA Certificate”?