0
votes

I'm creating a MQTT client with Paho and Python to connect with a device in Watson IoT Platform.

I correctly assembled the broker:

<org>.messaging.internetofthings.ibmcloud.com:1883

And the client:

d:<org>:<type>:<deviceId>

And published values to this topic:

iot-2/evt/<eventName>/fmt/json Payload: {"db",56}

With the authentication: username: use-token-auth Password:

And all OK.

But I tried to subscribe the topic iot-2/type//id//evt//fmt/json

And the connection always closes, and the dashboard says:

Closed connection. The topic is not valid: iot-2/type/sound/id/ipt/evt/db/fmt/json The topic does not match an authorized rule

Why this don't work? Thank you

1

1 Answers

0
votes

You cannot subscribe to an events topic using using a clientID of "d:::". You need to generate an APIKey and use a clinetID of "a:orgId:appId" to subscribe to topic iot-2/type/device_type/id/device_id/evt/event_id/fmt/format_string (iot-2/type/sound/id/ipt/evt/db/fmt/json)

You can use as reference: https://www.ibm.com/support/knowledgecenter/SSQP8H/iot/platform/applications/mqtt.html