Thomas Meier
Thomas Meier

Reputation: 49

Looking for a working example of a non-secure bridge between a local Mosquitto instance and the Watson IoT platform

I'm trying to establish a non-secure bridge from Mosquitto running on Home Assistant (home-assistant.io) to the MQTT broker on the Watson IoT platform. Why non-secure? To take out additional complexity as I can't connect. Once this step is successful I'll move on to secure the connection.

Firstly I have setup the Watson IoT platform and created a gateway device type ('ha-iotp-gateway') and device ('ha'). No other changes to the IoT platform.

I then created a bridge config file to connect Mosquitto with the Watson IoT platform broker by adopting the conf shared in this post and now have the following:

connection bridge-to-watsoniot
address xxxxxx.messaging.internetofthings.ibmcloud.com:1883
cleansession true
try_private false
bridge_attempt_unsubscribe false
notifications false
notification_topic iot-2/type/ha-iotp-gateway/id/ha/evt/status/fmt/raw
remote_username use-token-auth
remote_password <token>
remote_clientid g:xxxxxx:ha-iotp-gateway:ha
topic iot-2/type/+/id/+/cmd/+/fmt/+ in iot-2/type/+/id/+/cmd/+/fmt/+
topic iot-2/type/+/id/+/evt/+/fmt/+ out iot-2/type/+/id/+/evt/+/fmt/+
connection_messages true

The Mosquitto log file shows a connection attempt

1606909705: Connecting bridge bridge-to-watsoniot (xxxxxx.messaging.internetofthings.ibmcloud.com:1883)
1606909706: Socket error on client local.g:xxxxxx:ha-iotp-gateway:ha, disconnecting.
1606909707: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1606909707: New client connected from 172.30.32.1 as auto-BD9CD1CE-BE73-6CBA-196D-C02E83268AEB (p2, c1, k60, u'homeassistant').
1606909712: Connecting bridge bridge-to-watsoniot (xxxxxx.messaging.internetofthings.ibmcloud.com:1883)
1606909723: Connection Refused: not authorised
1606909723: Socket error on client local.g:xxxxxx:ha-iotp-gateway:ha, disconnecting.

The gateway device on the Watson IoT platform (created earlier) shows connected and the connection log shows

Closed connection. The operation is not authorized.

Has anyone been successful in establishing a non-secure connection to Watson IoT? I'm not sure whether the IoT platform is correctly configured or my bridge config has issues - or both.

Upvotes: 0

Views: 123

Answers (0)

Related Questions