Page 1 of 1

mqtt in esp32 example code

Posted: Sat Oct 27, 2018 4:26 am
by vinayakk28
Hi,
As per below commands, I am able to subscribe and publish message via mqtt to my cloud from my linux machine

mosquitto_sub -h 'host_name' -p 'port_number' -q 0 -t hello/240ac41673b4 -i 240ac41673b4 -d

mosquitto_pub -h 'host_name' -p 'port_number' -q 0 -t hello/240ac41673b4 -i 240ac41673b4 -m "hello_world" -d

I need to set -i (id of client) in my mqtt library of esp32. Without -i argument my publish messages are unsuccessful in esp32.
How can I achieve this?


Best Regards
Vinayak