MQTT would not connect to TLS broker

Hi All,

I am sorry to post this here, but I did not find a MQTT specific forum. Yesterday I have updated my NR to the latest version which took about 3.5 hours, mostly because there was some issue with updating the mosquitto. Apt was looking for the wheezy release which is no longer there. I managed to get it working somehow, but my NR is not connecting my a TLS broken. Connecting to the local MQTT is fine, but other mqtt in and out nodes that are linked to a TLS broken just stay "connecting".

This is the point where my lack of NR code and Linux debugging / tracing knowledge is really biting me.
Would you be able to help me where should I start looking? At the end I managed to update mosquitto yesterday with sudo apt-get install mosquitto, but I guess some libraries are missing after all. How do you start an investigation like this?


Can you connect using another client, such as mosquitto-sub?
Updating node-red would not have automatically updated mosquitto, so presumably you did more than just updating node-red.
What operating system are you running? I know you mentioned Wheezy but it could be Debian or Raspbian, possibly others.
Post the node red startup log starting with the Welcome to node-red message.

Hi Colin,

Ehhh, so I have restarted node-red to capture a fresh log and now mqtt is connected. Therefore it appears that I am good, most probably the remote broker has some temporary connection issue. Sorry for all this.

Btw, when I ran the update bash script yesterday, I noticed that the script was installing Node 6.x.x all the time instead of 10. When I ran the sudo apt-get update I found the the error message when the system was trying to get the mosquitto/.../wheezy/.../Package file. 404 file not found. I guess the same causes the bash script not to update to the latest Node.js.

I have the following OS:
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION="8 (jessie)"

And my startup log:
Welcome to Node-RED

4 May 15:46:06 - [info] Node-RED version: v0.20.5
4 May 15:46:06 - [info] Node.js version: v10.15.3
4 May 15:46:06 - [info] Linux 4.9.35-v7+ arm LE
4 May 15:46:07 - [info] Loading palette nodes
4 May 15:46:11 - [info] Worldmap version 1.5.40
4 May 15:46:13 - [info] Dashboard version 2.14.0 started at /ui
4 May 15:46:14 - [warn] ------------------------------------------------------
4 May 15:46:14 - [warn] [node-red-contrib-ecolect/ecolect] Error: Cannot find module 'ecolect/values/index' (line:21)
4 May 15:46:14 - [warn] ------------------------------------------------------
4 May 15:46:14 - [info] Settings file : /home/pi/.node-red/settings.js
4 May 15:46:14 - [info] HTTP Static : /home/pi/node-red-static
4 May 15:46:14 - [info] Context store : 'default' [module=memory]
4 May 15:46:14 - [info] User directory : /home/pi/.node-red
4 May 15:46:14 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
4 May 15:46:14 - [info] Flows file : /home/pi/.node-red/flows_OpenHAB.json
4 May 15:46:14 - [info] Server now running at
4 May 15:46:15 - [info] Starting flows
4 May 15:46:19 - [info] [worldmap:4dac5582.33b0cc] started at /worldmap
4 May 15:46:19 - [info] Started flows

Does all this look OK for you?


Looks OK, it shows node 10.15.3 is installed. Are you sure it was not npm that you were seeing at v6.x?
You do have a problem with node-red-contrib-ecolect though, but that may just be that you haven't set it up yet.
Did you sort the mosquitto problem? It sounds as if you have/had a problem with your software sources setup. If you are not sure it is sorted then what does this show?
sudo apt-cache policy mosquitto

I am sure Node was only at 6.x and the email component is not read was not running as it required 8 or higher. At first I did not even notice that as all the tick marks in the update script were greeen.
I am removing ecolect and that error will probably go away. I am not using it any more so, not a burning problem.

apt-cache policy mosquitto says the following:

Installed: 1.3.4-2+deb8u3
Candidate: 1.3.4-2+deb8u3
Version table:
*** 1.3.4-2+deb8u3 0
500 jessie/main armhf Packages
100 /var/lib/dpkg/status

I fixed the mosquitto issue by downloading the jessie source setup for mosquitto, adding it to apt-get and running the update again. At list this is what I understood. I just followed steps on a post somewhere... I was pretty much in panic mode and trying out random stuff without really understanding what it does. I know this is not ideal.

Mosquitto looks ok, you did the right thing by the look of it.
Well you can see from the startup log that node is at 10 now so that's ok.

Just as a curiosity, why are you usingjessie instead of stretch?

I was blindly following various blog post which did not explain why something is happening and neither explain how the solution works. So I was typing some commands in and all of a sudden it was working.
To be honest, I am completely clueless when in comes to Linux packages, and what jessie or strech is.

Jessie and Stretch are the names of the debian releases. Stretch is the latest. If you flash a new SD card using the latest release from th RPI foundation, you will be installing the Stretch version.

However, if you have a working system that is performing a task then it may be a bit of a pain to reinstall the OS and all the applications, so it may be sensible to stick with what you have.

1 Like