D-Inventor
D-Inventor

Reputation: 480

node-red says that it is connected to mqtt broker, but isn't

As part of an assignment, I have to create a node-red flow to monitor values in an iot environment, using cloudmqtt as my broker.
Since I have no experience with node-red at all, I wanted to start with a simple flow that would just get the payload from a specific topic and print it in the debug window.
The problem is with the connection to cloudmqtt. Node-red itself claims that it is connected to the broker, but when I log into cloudmqtt and look at the connection list, my node-red service doesn't appear in the list. I used the username and password that are provided in the 'details' tab on cloudmqtt.

node-red flow

Notice that the payload on this topic is provided by a NodeMCU of which I can tell for certain that it is properly connected. I can see the connection in the connection list and using mqtt-spy, I verified that the messages are indeed received by the broker and distributed to the subscribed devices.

according to this website, I have to create a user and give that user read and write permissions and use the name and password from that user. I have tried this, but the result is the same.

What is particularly noteworthy is that even if I use a wrong password, node-red still indicates that there is a proper connection. I am certain that I deployed the flow, I also tried to restart the node-red service and the log in the cmd tells me that it has successfully connected to the broker, but node-red still doesn't appear in the list of connections.

Why does node-red think that there is a proper connection to cloudmqtt while there isn't? How do I get my node-red to properly connect to cloudmqtt?

I use node-red version 0.18.4

Upvotes: 2

Views: 1335

Answers (1)

D-Inventor
D-Inventor

Reputation: 480

So it turned out that I used the wrong port. I used the default port that was inserted by node-red, but the port to the broker was different. Changed the port number to the proper port and now it works!

Upvotes: 0

Related Questions