The example on using MQTT for ESP32 does not incorporate any security. How do I incorporate some security in the messages so that only the authorized subscribers are allowed to read the messages.
Hello,
I have a thread on the Forum that you can use as a reference: https://rntlab.com/question/how-to-use-cloud-mqtt-broker-with-esp32-using-async-mqtt-client-library/
In summary, you need to do the following. In the setup() function, you need to call the .setCredentials() method with your own username and password (MQTT broker):
mqttClient.setCredentials("zkk-----", "BtH------");
I hope that helps.
Regards,
Rui
username and password is still insecure if sent in plain text over an unencrypted connection. I found that in the course “Learn ESP32 with Arduino IDE – 2nd Edition” in the MQTT part, a chapter was missing showing connection via SSL with username and password. Here’s a tip for an update