I have a device that hosts node-red and my mqtt broker. I'm working on transitioning the node-red to a different host with more memory and I'm running into difficulties connecting to the mqqt broker on my original device. Both devices are on my local network, so I'm using the IP address of the device hosting the mqtt broker instead. However, it's simply not connecting and I'm wondering if somebody can assist me with troubleshooting steps. I have included some screen shots that might better illustrate what I'm working with.
When I do a trace route from my new node-red host to the mqtt broker, there's a single hop between the two devices.
I opened ports 1883 and 8883 on the firewall of both devices, so I'm assuming the firewall is not the issue.
I can connect to the mqtt://test.mosquitto.org:1883 on my new node-red host device.
You are right, it is an industrial unit and the broker is installed on the unit. I have worked with their support personal, and they said it should work but they are not very good at helping with troubleshooting.
Yes, I can ping the other device when the broker is running.
The vendor where I bought the unit from, said it is not bound to localhost only...supposed to work across a network.
I will try to install the node-red-contrib-eades MQTT broker inside node-red and see what I find.
Thanks for the help Steve-Mcl. As you suggested, I tried to connect to my broker with the app using its IP address and it could not connect. I was able to connect to two test brokers with the app. So the issue seems to be my broker??
I can ping the broker box from my Node-Red machine. That seems to work fine.
It does indeed seen to be the broker from what you've said. Get back in touch with support - or - switch it off and use your own (mosquito or the node for node red I mentioned earlier)
I ended up having to install a third party broker on my machine running node-red and it instantly connected. Seems like the broker on my original unit is bound to localhost, even though their support claims it should work.
Remember, your new broker is local to your node red install (same situation as you had originally) & therefore it works (LAN is taken out of the scenario)
There could still be a number of factors preventing communication across LAN.
machine 1 could have a simple setting to enable/disable LAN access.
machine 1 might have a firewall and require port 1883 to be open on ETH0 (out whatever interface it uses)
Machine 1 firmware might require update.
Machine 2 firewall might be preventing 1883 outbound
Router might not be permitting port 1883
...
Etc
...
Etc
...
That all said, if you are happy with your current solution then all is well.
I'm not totally satisfied with this solution, but I'm relieved that it's finally working after spending tons of time try to find the problem. Will probably have more time to troubleshoot sometime later....
Having it bound to 127.0.0.1 by default is obviously better for security - so I would also do that if I was shipping a generic product. It is probably a configuration option somewhere to change that to 0.0.0.0 (ie all interfaces)