256dpi / arduino-mqtt

MQTT library for Arduino
MIT License
1.01k stars 232 forks source link

MQTT broker username and password #260

Closed Andrew-Wasserman closed 1 year ago

Andrew-Wasserman commented 3 years ago

Hi Joël, May I ask your help. I want to connect to an MQTT broker that needs a username and password. Where in the "mqtt.begin();" function do I put the user name and password? My first guess was the following: mqtt.begin("MQTT-broker-server", "port", "wificlient", "mqtt-broker-username", "mqtt-user-password" ); However it does not seem to be working. Could you perhaps point me in the correct direction? Your help would be much appreciated.

CptHolzschnauz commented 3 years ago

client.begin("username.cloud.shiftr.io", net); client.connect("devicename", "channel_to_subscribe", "password");

256dpi commented 1 year ago

Closing as this has been most likely solved. @CptHolzschnauz Thanks for stepping in!