Unable to Connect to Mosquitto Broker

I'm trying to connect Node-RED (which is running on an Azure Web-App) to my mosquitto broker (v.3.1.1, which is running on and Azure Virtual Machine running Ubuntu v18.04.1). I am able to pub and sub on localhost with 2 cmd windows open. I believe localhost is on port 1883.

I've also allow acces to the 1883 port on the VM through this command

sudo ufw allow 1833

However, when I try to connect the node-red MQTT node (either pub or sub) it's just stuck with a little yellow square bellow and says "connecting" constantly. I'm not sure what I'm missing because I haven't even configure the SSL connection yet (I tried and failed too so I'm trying without it first). The MQTT node configuration and the server config can be seen below:



(I can only put 2 images in the post but the security contains my mosquitto username and password)

Is there something I'm missing or a way to troubleshoot this?

ps: the birth, close and will message are blank at the moment. I'm fairly new to this so apologies if the question isn't properly asked.

I'm not an VM ware expert, but UFW is for setting the firewall and not opening ports.
Google tells me you need to use something like az vm open-port -g MyResourceGroup -n MyVm --port 80 --priority 100

Neither am I :sweat_smile: I'll look into that and see if it works. Cheers!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.