Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Connect to broker on pi(connection to broker on pi fails)
Connect to broker on pi [message #1836979] Wed, 20 January 2021 14:04 Go to next message
Paulina Lange is currently offline Paulina LangeFriend
Messages: 2
Registered: January 2021
Junior Member
Hi,

I have found one issue in this forum where someone wanted to run the broker on a pi (https://www.eclipse.org/forums/index.php/t/1078080/). However his problem was, that he ran kura and the broker on the same pi, which is not the case for me. I use the IP of my pasberry, which runs mosquitto mqtt, in the broker url field. The connection fails with a "Failed to connect error!". Using python for a test publish and subscribe, I checked that the broker worked. What else could be the issue?

Any help would be greatly appreciated.
Thanks in advance

Paulina
Re: Connect to broker on pi [message #1836987 is a reply to message #1836979] Wed, 20 January 2021 15:37 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi,
can you please provide some logs from Kura?
Can you also share the configuration used to connect to the broker?

Thanks
Re: Connect to broker on pi [message #1837030 is a reply to message #1836987] Thu, 21 January 2021 08:46 Go to previous messageGo to next message
Paulina Lange is currently offline Paulina LangeFriend
Messages: 2
Registered: January 2021
Junior Member
Here are the logs:

 2021-01-21T09:38:41,983 [DataServiceImpl:ReconnectTask:org.eclipse.kura.data.DataService] WARN  o.e.k.c.d.DataServiceImpl - Connect failed
org.eclipse.kura.KuraConnectException: "Connection failed. Cannot connect"
        at org.eclipse.kura.core.data.transport.mqtt.MqttDataTransport.connect(MqttDataTransport.java:342)
        at org.eclipse.kura.core.data.DataServiceImpl$2.run(DataServiceImpl.java:605)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: MqttException (0) - java.net.NoRouteToHostException: Keine Route zum Zielrechner (Host unreachable)
        at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38)
        at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:736)
        ... 1 more
Caused by: java.net.NoRouteToHostException: Keine Route zum Zielrechner (Host unreachable)
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:74)
        at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:722)
        ... 1 more
2021-01-21T09:38:42,001 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - # ------------------------------------------------------------
2021-01-21T09:38:42,002 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  Connection Properties
2021-01-21T09:38:42,002 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  broker    = tcp://172.17.0.161:1883
2021-01-21T09:38:42,003 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  clientId  = B8:27:EB:50:D9:83
2021-01-21T09:38:42,003 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  username  = null
2021-01-21T09:38:42,003 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  password  = XXXXXXXXXXXXXX
2021-01-21T09:38:42,003 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  keepAlive = 30
2021-01-21T09:38:42,004 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  timeout   = 20
2021-01-21T09:38:42,004 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  cleanSession    = false
2021-01-21T09:38:42,004 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  MQTT version    = 3.1.1
2021-01-21T09:38:42,005 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  willDestination = $EDC//B8:27:EB:50:D9:83/MQTT/LWT
2021-01-21T09:38:42,005 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  willMessage     =
2021-01-21T09:38:42,005 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #
2021-01-21T09:38:42,005 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  Connecting...
2021-01-21T09:38:42,006 [pool-18-thread-1] INFO  o.e.k.c.s.r.LogStatusRunnable - Notification LED fast blinking
2021-01-21T09:38:45,099 [qtp9813740-132] WARN  o.e.k.c.d.t.m.MqttDataTransport - xxxxx  Connect failed. Forcing disconnect. xxxxx
2021-01-21T09:38:45,100 [qtp9813740-132] INFO  o.e.k.c.d.t.m.MqttDataTransport - Forcing client disconnect...


I added a screenshot of the mqtt config. I pretty much only changed the broker-url and deleted the default entries for Topic Context Account Name, Password and User.
Re: Connect to broker on pi [message #1839671 is a reply to message #1837030] Thu, 25 March 2021 12:48 Go to previous message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi,
are you able to ping the destination IP from the device running Kura?
Previous Topic:Reusable UI with Eclipse Kura /Basys
Next Topic:Kura and Java 11
Goto Forum:
  


Current Time: Fri Apr 26 12:51:56 GMT 2024

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

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

Back to the top