Search code examples
ibm-cloudmqttiotnode-red

Subscribe MQTT not working in bluemix using node-red


I am having trouble in MQTT communication. I am new to MQTT and IOT. I am using IBM Bluemix as a cloud service. I can publish the data using node-red MQTT node on the device type. But I am not able to subscribe to that device and topic. Whenever I try to subscribe, it gets disconnected. Thanks

In this picture, I am publishing the status event to the device enter image description here

In this picture, I am getting the published data in the cloud enter image description here

However, as shown below, when i try to subscribe, it gets disconnected enter image description here

PS: I am using the same client ID. I don't know how to use a different client ID for the same device type.


Solution

  • When you publish, you are publishing as a device and connecting with the device client ID. A device can not subscribe to a status event, so you should be subscribing as an application. It will connect with an ID such as A:orgId:appId https://console.ng.bluemix.net/docs/services/IoT/applications/mqtt.html#mqtt