Unable to connect to MQTT server from Node-Red

1tim
Sat, 28 Sep 2024 19:15:03 +0000
MQTT

Hi,

I am now stumped with what I thought would be a simple cog to implement in a bigger solution.

I am unable to connect to my TTN application using MQTT.

I first ran Node-Red within a docker container on a Pi5, which didn’t connect. I just keep getting Connection failed to broker message in the log file.

I tried with TLS and without, using tcp protocol and not, mapping app ports in docker and still nothing.

So I tried directly inside the Pi5 with Node-Red (not in a docker container) and I get the same problem.

I was thinking it might be network related, so removed all ‘iptables’ on the Pi5 (alllowing all traffic) and still no luck.

Convinced it might be my home network, I now have a Node-Red instance running in the cloud (FlowFuse) and get the same message, again using all options I can think of.

The only connection I have been able to make it using MQTT Explorer on my Mac, and using npx mqtt sub from a command line.

That got me thinking it must be the MQTT node in Node-Red, so I connected it to the free Mosquitto server, and there were no problems at all.

The server I am connecting to is eu1.cloud.thethings.industries for which I get the same IP resolution each time…

Does anyone have any other ideas or thoughts as to why this might be happening.

Does anyone know how to view detailed logs on The Things Stack application to even see if the connection is being refused?

Many thanks,

Tim

16 posts - 5 participants