Hello everyone,
I’m having some troubles, trying to use the MQTT binding.
I’m using an raspberry pi3 where I have installed openhab2 and mosquitto. I also installed the MQTT binding in the paper UI.
I’m trying to configure the mqtt.cfg file via /etc/openhab2/services/mqtt.cfg and only changed the line .url=tcp://localhost:1883 to this:
# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
broker.url=tcp://localhost:1883
But when I want to save the file, I already get an error in the events.log :
[ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection
MqttException (0) - java.net.NoRouteToHostException: No route to host (Host unreachable)
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38)[208:org.openhab.io.transport.mqtt:1.10.0]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:664)[208:org.openhab.io.transport.mqtt:1.10.0]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
at java.net.PlainSocketImpl.socketConnect(Native Method)[:1.8.0_121]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)[:1.8.0_121]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)[:1.8.0_121]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)[:1.8.0_121]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)[:1.8.0_121]
at java.net.Socket.connect(Socket.java:589)[:1.8.0_121]
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:70)[208:org.openhab.io.transport.mqtt:1.10.0]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:650)[208:org.openhab.io.transport.mqtt:1.10.0]
... 1 more
When I use mqtt.fx I can successfully subscribe and publish on my raspberry’s IP-address.
Also, I noticed from the mosquitto.log file (/var/log/mosquitto/mosquitto.log) that when my ESP8266-12S wifi module is trying to connect, it is also disconnecting continuously because of an socket error.
1499945603: Socket error on client Device1, disconnecting.
1499945603: New connection from 192.168.0.170 on port 1883.
1499945603: New client connected from 192.168.0.170 as Device1 (c1$
1499945693: Client Device4 has exceeded timeout, disconnecting.
1499945693: Socket error on client Device1, disconnecting.
1499945766: New connection from 192.168.0.170 on port 1883.
1499945766: New client connected from 192.168.0.170 as Device1 (c1$
1499945855: Client Device1 has exceeded timeout, disconnecting.
1499945855: Socket error on client Device1, disconnecting.
Does anyone know how I can fix this error? Or what is causing it?
I’m btw new here and an beginner at openhab, so already sorry if I ask some stupid questions or making a lot of mistakes
Thanks in advance!