Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Java client: Trouble connecting to CloudMQTT server with username password
Java client: Trouble connecting to CloudMQTT server with username password [message #1701306] Fri, 10 July 2015 18:16 Go to next message
Steve Golton is currently offline Steve GoltonFriend
Messages: 1
Registered: July 2015
Junior Member
I'm having some trouble using the Eclipse Paho async MQTT client with a CloudMQTT server instance running under Android. Is this the correct way to specify username / passwords?

mClient = new MqttAsyncClient( "tcp://xxx.cloudmqtt.com:11729", "TestGuy", new MemoryPersistence() );

// Set up connection options
connOpts = new MqttConnectOptions();

connOpts.setCleanSession( true );
connOpts.setUserName( "usr" );
connOpts.setPassword( "pwd".toCharArray() );

// Attempt to connect
mClient.connect( connOpts, this );



I keep getting "Not authorized to connect" in my onFailure() handler.

I can connect absolutely fine using the mosquitto_pub & sub tools, the M2Mqtt .NET client, the Paho C client and the "MyMQTT" Android app running on the same phone I am trying to connect from using the above code.

I am running the latest version "org.eclipse.paho.client.mqttv3-1.0.2.jar"


Thank you
Re: Java client: Trouble connecting to CloudMQTT server with username password [message #1702148 is a reply to message #1701306] Mon, 20 July 2015 10:34 Go to previous message
Ian Craggs is currently offline Ian CraggsFriend
Messages: 47
Registered: March 2013
Member
I'm not aware of anything special you should need to do. The only factor that immediately springs to mind is the encoding, of user name or password. Do you have any message from the cloud server that explains what problem it is having?
Previous Topic:Paho Java, M2JE problem, compliling my program
Next Topic:Having trouble getting connection to iot.eclipse.org (javascript)
Goto Forum:
  


Current Time: Sat Nov 18 14:21:21 GMT 2017

Powered by FUDForum. Page generated in 0.01722 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software