4

I'm trying to connect my Arduino with ethernet to Xively using their MQTT server but am having trouble authenticating. When I do client.connect("arduinoMQTT") I get a failure. I tried passing my API Key as a username by doing client.connect("arduinoMQTT", "APIKEY") but then the code won't compile.

How can I authenticate to the Xively MQTT server on arduino.

1 Answer 1

6

If you check the api docs for the Arduino MQTT client, you'll see you need to provide a password argument as well as the username. When connecting to Xively, you use your api key as username and null for the password:

client.connect("arduinoMQTT", "APIKEY",null)

You should probably use something a bit more unique than arduinoMQTT as the client id as well.

Sign up to request clarification or add additional context in comments.

1 Comment

Oops... Didn't mean to create this as a CW. Oh well

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.