I am using MQTT node from couple of years and it's working fine. But when I am trying to establish connection now its not working. The MQTT node is getting disconnected. I don't know if this is the problem with any version or upgrades. Currently I am using latest version of node-red. It would be very helpful if anyone can help.
Just a couple of clarifications please:
- By "The MQTT node is getting disconnected" do you mean that it connects and then shows disconnected, or that it never connects?
- What version of Node-red do you have? ("The latest" is less informative than eg "3.1.2").
- What MQTT broker are you using?
- How is the broker configured in Node-red?
- Did you change anything in the MQTT node config?
- Did you update Node-red or the MQTT node?
- Did you update the MQTT broker?
- If your MQTT broker is on your own network, did it's IP address change?
- If your MQTT broker is on your own network, is it actually running?
First the node is getting connected.
But then if I am trying to send the data it's not connecting.
.
Currently I am using v4.0.8 of Node-RED. I haven't changed any configurations from the previous configuration. I am following the method from this website for configuring the MQTT node.
Connecting Node-Red to Azure IoT Hub using MQTT nodes. | by Nikhil Kinkar | Medium
You don't seem to have answered all of the previous questions.
Also, stop node red and start it again in a command window and post the full output here please.
Some topics can cause the broker to disconnect.
Some brokers do not like certain data / topics.
Is this an AWS or other cloud broker?
Its Azure Cloud IoT Hub Service. If you can share any example structure of msg that I can try it would be very helpful.
Could be an ACL issue with the broker.
Most of them close the connection if you don't have the permission to publish to a topic.
The most common disconnection issue is reuse of the same client ID. Please try removing the client id from the node and see if that fixes it.