getting these errors now
17-01-20 18:15:41.872 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to ââ was lost: Connection lost : ReasonCode 32109 : Cause : null
This thread helped me a lot. I was also stuck with two different mqtt config files and finally I solved it.
Thanks a lot guys and keep up the good work.
Folks, I have been struggling with a similar issue. Have not been able to resolve it in the last week of trying.
I have OH2 running on a Raspberry Pi3. All fine. I am now trying to publish my ZWAVE events to IBM Watsonâs IOT (mqtt) broker.
Watson cloud environment has been set up properly.
I can connect to the MQTT broker using a standalone client on my Mac (MQTTBox). Through that, I could verify that the URL / Username / Password are all ok. Connecting to Watson from the RPI3 however keeps failing with the following message:
11:39:54.082 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'watsoniotâ
11:39:55.439 [ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection
Not authorized to connect (5)
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:24)[216:org.openhab.io.transport.mqtt:1.9.0]
at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:773)[216:org.openhab.io.transport.mqtt:1.9.0]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:110)[216:org.openhab.io.transport.mqtt:1.9.0]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_112]
My /etc/openhab2/services/mqtt.cfg looks as follows:
I already deleted the /var/lib/openhab2/config/org/openhab/mqtt.config as sugested in this thread and it got rebuilt showing the same values as the mqtt.cfg file, yet with double quotes (" ") around them, eg: watsoniot.url=âtcp://myorgid.messaging.internetofthings.ibmcloud.com:1883â
There are no other brokers listed in this file either.
Again, I am fairly (if not 100%) certain that the credentials are ok, as the stand-alone client successfully connects and Watson also sees it come online. OH2 however will not connect.
What am I missing? How can I further debug this within OH2?
I do not believe that OH MQTT supports encrypted TLS connections. If Watsonâs broker is configured to encrypt the message traffic using SSL/TLS, I donât think you can connect to it.
The error is showing that OH can see the broker and it attempts to connect. If you are certain the credentials are correct this is the main thing I can think of that could cause a Not authorized to connect error.
Thanks for responding, Rich. I have not configured Watson to use SSL/TLS, and neither am I specifying it in MQTTBox on my Mac. MQTTBox does connect to Watson, OH2 does notâŠ
I do not know this Watson service but it seems to me that if you are not encrypting the traffic you potentially expose your username / password to everybody on the internet.
In any case I would try to use tcpdump to see what is going on during the communication and compare it with another tcpdump capture from the successful communication using MQTTBox. By compating the authentication requests I am sure you will see differences that can point you to the right direction
It depends on what you want to achieve: Iâm using MQTT with mosquitto since openHAB1 without any problems and also the 1.x MQTT binding works flawlessly with openHAB2 âŠ
2017-09-10 18:53:38.387 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-09-10 18:53:38.409 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
2017-09-10 18:53:38.569 [INFO ] [ulation.internal.HueEmulationServlet] - Started Hue Emulation service at /api
2017-09-10 18:53:38.671 [ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection
Unable to connect to server (32103) - java.net.ConnectException: Connection refused (Connection refused)
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:75)[221:org.openhab.io.transport.mqtt:1.9.0]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:538)[221:org.openhab.io.transport.mqtt:1.9.0]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: java.net.ConnectException: Connection refused (Connection refused)
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:66)[221:org.openhab.io.transport.mqtt:1.9.0]
... 2 more
when I use the karaf console as suggested here this is what is listed out: