esp-mqtt-arduino icon indicating copy to clipboard operation
esp-mqtt-arduino copied to clipboard

multiple subcribe

Open alex206cc opened this issue 6 years ago • 4 comments

hi, sorry my english ... but how do I make multiple subscribers? moreover in case of user and password on the mqtt server how are they set?

thank you

alex206cc avatar Dec 05 '18 10:12 alex206cc

you should be able to subscribe to many topics:

myMqtt.subscribe("topic1");
myMqtt.subscribe("topic2");
myMqtt.subscribe("topic2");

see example mqtt_sub

how you set user/password on the server probably differs from server to server... so you would need to look into how to do that with the mqtt-server you use.

hth.

i-n-g-o avatar Dec 06 '18 11:12 i-n-g-o

not on server but on sketch... ;-) i'am use home assistant and with other library for mqtt the publish is ok but no the subscribe. with your library not function publish and subcribe.... can you halp me?

alex206cc avatar Dec 06 '18 11:12 alex206cc

i found .setUserPwd ...

alex206cc avatar Dec 06 '18 11:12 alex206cc

yes, you can user and password like that.

hard to say what is going wrong with publish ans subscribe.

i-n-g-o avatar Dec 06 '18 11:12 i-n-g-o