Imroy / pubsubclient

A client library for the ESP8266 that provides support for MQTT
MIT License
433 stars 115 forks source link

PubSubClient.connect with userName/password ? #91

Open dpapdpap opened 4 years ago

dpapdpap commented 4 years ago

I can't connect to my MQTT server because it wants to login but PubSubClient.connect hasn't this ability. Know someone what can I do, please ?

thedanbob commented 3 years ago

You use the set_auth method on MQTT::Connect:

PubSubClient client(wifiClient, server_ip, port);
client.connect(MQTT::Connect("some_id_string").set_auth("username", "password"));