MQTT to Watson IOT not connecting?


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] [] - Error starting broker connection
Not authorized to connect (5)
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException([]
at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck([]

My /etc/openhab2/services/mqtt.cfg looks as follows:


I already deleted the /var/lib/openhab2/config/org/openhab/mqtt.config as suggested in another 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]”. Looking fine to my (not too experienced) eye…

There are no other brokers listed in this file either.

Other things I have tried and want to add:

  • 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.
  • I have connected to a local Mosquito broker (without using credentials) and then OpenHAB connects successfully
  • I have configured Mosquito to serve as a bridge (OH2 <-> Mosquito (local) <-> Watson IOT) and then Mosquito DOES connect to IBM Watson. This also suggests that my credentials are set up correctly.

What am I missing? How can I further debug this within OH2?

Many thanks for any pointers!