Today I installed the new mosquitto version via apt-get and now mqtt cannot connect to the broker anymore.
Anyone experiencing the same issue?
2016-01-09 12:50:57.476 [INFO ] [.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2016-01-09 12:50:57.479 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
2016-01-09 12:50:57.830 [ERROR] [.io.transport.mqtt.MqttService] - Error starting broker connection
org.eclipse.paho.client.mqttv3.MqttException: Verbindung zu Server kann nicht hergestellt werden
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:75) ~[na:na]
at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:77) ~[na:na]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:538) ~[na:na]
at java.lang.Thread.run(Thread.java:744) ~[na:1.8.0]
Caused by: java.net.ConnectException: Verbindungsaufbau abgelehnt
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) ~[na:1.8.0]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0]
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:649) ~[na:1.8.0]
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:66) ~[na:na]
... 3 common frames omitted
Are you explicitly passing the -h host and -p port arguments to mosquitto_sub and mosquitto_pub? If not, where are those tools getting their connection settings?
If you do netstat -an | grep LISTEN at a prompt, do you see the mosquitto server listening on the port(s) you expect?
[quote=“watou, post:4, topic:5925, full:true”]
Are you explicitly passing the -h host and -p port arguments to mosquitto_sub and mosquitto_pub?[/quote]
The above means that mosquitto is only listening on the loopback interface for connections on port 1883, while
means that any host can connect that can reach the server on any interface. If you are OK to listen for 1883 connections on any interface, you would change the line in mosquitto.conf from
listener 1883 127.0.0.1
to
listener 1883
and restart/reload mosquitto, and see if openHAB can connect.
I changed mosquitto.conf according to your advice and get now
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN
so the changes were recognized. But the problem is still the same.
BUT: in addition to my apt-get upgrade a couple of hours ago I had a power outage this morning (short in a light bulb blew the fuse) and my Pi was shut down. As we all know by now this can corrupt a complete installation
I’m thinking about restoring my two day old image backup …
Problem was solely caused by the power outage, the os was corrupted.
After restoring a backup (with mosquitto 1.4.5) everything worked fine.
Then I did again an upgrade to mosquitto 1.4.7 and still everything is working fine.