Hi, I’m on OH2b4 (I believe, latest on site at present) and I’m facing MQTT issues.
OH is running on Ubuntu server, and I’ve used HABmin/Paper UI to enable MQTT.
The broker is Mosquitto on the same machine, and is known good, i.e. it worked under OH1.8 and works from other clients (from phone, so I know connection details are correct; I can pub/sub from the command line also so I know it’s running).
I get the following error. In order to verify that it wasn’t my broker at fault I changed the config to point to m2m-eclipse.url=tcp://m2m.eclipse.org:1883
, but i get exactly the same error, so it’s at the OH end.
23:04:32.460 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
23:04:32.461 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mqtt'
23:04:32.464 [ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection
Unable to connect to server (32103) - java.net.ConnectException: Connection refused
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:75)[197:org.openhab.io.transport.mqtt:1.9.0.201609250111]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:538)[197:org.openhab.io.transport.mqtt:1.9.0.201609250111]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)[:1.8.0_91]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)[:1.8.0_91]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)[:1.8.0_91]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)[:1.8.0_91]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)[:1.8.0_91]
at java.net.Socket.connect(Socket.java:589)[:1.8.0_91]
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:66)[197:org.openhab.io.transport.mqtt:1.9.0.201609250111]
... 2 more
23:04:32.465 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'm2m-eclipse'
23:04:32.467 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_157803d1104_serial_sof changed from 1500 to 1501
23:04:32.469 [ERROR] [ssage.ApplicationCommandMessageClass] - Error processing frame: Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 16 04 71 05 00 00 >> Attempt to read message payload out of bounds: Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 16 04 71 05 00 00 (8)
23:04:32.788 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'broker'
23:04:32.788 [ERROR] [org.apache.felix.configadmin ] - Cannot use configuration org.openhab.mqtt for [org.openhab.core.scriptengine.action.ActionService, org.osgi.service.cm.ManagedService, id=339, bundle=203/mvn:org.openhab.action/org.openhab.action.mqtt/1.9.0-SNAPSHOT]: No visibility to configuration bound to mvn:org.openhab.io/org.openhab.io.transport.mqtt/1.9.0-SNAPSHOT
Why would brokers (including the eclipse test broker) refuse my connection?
mqtt.cfg:
m2m-eclipse.url=tcp://m2m.eclipse.org:1883
mqtt-eventbus.cfg:
broker=m2m-eclipse
statePublishTopic=/openHAB/out/${item}/state
commandPublishTopic=/openHAB/out/${item}/command
stateSubscribeTopic=/openHAB/in/${item}/state
commandSubscribeTopic=/openHAB/in/${item}/command
No items are specifically configured for sending, I just want the standard eventbus logging at present. Been googling for a long time and come up short. Note that changing the port (e.g. to 1882) gives me exactly the same error message. I wondered if it was permissions, but I chowned the OH directory. Am I missing the transport 1.9 snapshot? I can’t find it on the web, and I’ve seen several MQTT troubleshooting threads that state that it is no longer needed for manual inclusion.
At a bit of a loss here.