Fail at MQTT connect

Hi Dear.
For a while, I can’t establish a connection with my device from MQTT clients.
I’m not using a Losant client. Now I’m trying with MQTT.fx and MQTTbox.
Using as:
broker: broker.losant.com:1883
ID = 5c9e9b03d9882500089baf9f
Username = Access Key
Password = Access Secret

Any help will be appreciated.
Thanks
Francisco

Hi @Francisco_de_Izaguir,

Could you explain a bit more about your intended use case and the issue you are seeing? Any screenshots of your integration configuration would also be helpful (Losant and the external broker).

Thanks!
Julia

Thankyou very much for your answer.
I’m trying to connect to losant

via MQTT. Right now using the client MQTTfx.
I attach an image. and the client Log.

Anithing else just tellme please. Thanks.

2019-11-15 12:54:14,202 INFO — Start App : Style: LIGHT /styles/mqttfx_theme_light.css
2019-11-15 12:54:26,274 WARN — Updater : Unknown Host ‘‘http://www.jensd.de/apps/mqttfx/appcast.xml’’: 404 www.jensd.de
2019-11-15 12:54:26,277 INFO — ScriptingManager : Found action with name: Switch Fountain Test
2019-11-15 12:54:29,164 INFO — BrokerConnectorController : onConnect
2019-11-15 12:54:29,246 INFO — MqttFX ClientModel : MqttClient with ID 5c8b2257e6c6c5000c0ecf9c assigned.
2019-11-15 12:54:41,295 ERROR — MqttFX ClientModel : Error when connecting
org.eclipse.paho.client.mqttv3.MqttException: MqttException
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:715) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_181]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
Caused by: java.net.UnknownHostException: broker.losant.com
at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
at java.net.PlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
at java.net.SocksSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
at java.net.Socket.connect(Unknown Source) ~[?:1.8.0_181]
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:84) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:701) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
… 7 more
2019-11-15 12:54:41,309 ERROR — MqttFX ClientModel : Please verify your Settings (e.g. Broker Address, Broker Port & Client ID) and the user credentials!
org.eclipse.paho.client.mqttv3.MqttException: MqttException
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:715) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_181]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
Caused by: java.net.UnknownHostException: broker.losant.com
at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
at java.net.PlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
at java.net.SocksSocketImpl.connect(Unknown Source) ~[?:1.8.0_181]
at java.net.Socket.connect(Unknown Source) ~[?:1.8.0_181]
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:84) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:701) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
… 7 more
2019-11-15 12:54:41,321 INFO — ScriptsController : Clear console.
2019-11-15 12:54:41,322 ERROR — BrokerConnectService : MqttException

1 Like

Hi @Francisco_de_Izaguir,

I downloaded MQTTfx in order to test the same configuration you have. I want to ensure I am executing the same steps you did to receive this error. Let’s begin on Losant’s side.

I have a device, MQTT Device, that I have created. I first copy the device ID to use as the “Client ID” in MQTTfx:

Next, I create an Access Key in Losant:

And include the credentials provided as the “Username” and “Password” in MQTTfx:

Finally, when I click “Connect,” in MQTTfx, I can see on my device page that I have successfully connected to Losant:

Below are my logs in MQTTfx:

I am curious, is this the same process you followed? Does the “Connect” button fail to work, and result in the logs you have included?

Thanks!
Julia

@JuliaKempf Thank you very much for your time.
Indeed I am doing exactly that. At this moment I open MQTTfx and click over “Connect” and it actually connect. I don’t know what could it be. I tryied hard before post, so I can’t understand what is going on. May be some flapping server?
Any way, thank you very very much.

1 Like

Did this ever get resolved? Trying using MQTTBox right now so I’m curious.

Hi Lars!
I tried creating a new device and that worked just fine.
I couldn’t find what I was doing wrong.