NR not receiving MQTT

Hi friends,

today NR stopped receiving mqtt-messages from localhost:1883 (mosquitto without any fancy settings) after i reinstalled NR since i had some issues with Git and stuff (that's another topic).
I checked with MQTT-Explorer if there are any messages coming in and they do.

My setup: Node-Red v1.0.6, Node.js v8.9.4, Mosquitto v1.6.8 on a RasberryPi running Raspbian GNU/Linux 8.0 (jessie).

NR gives me back:

6.5.2020, 19:04:00node: dbf811e1.f3db78
msg : error
"SyntaxError: Invalid regular expression: /(?:^|(?<=\s))(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(?=\s|$)/: Invalid group"


6.5.2020, 19:06:56node: Wohnzimmer/Temp
msg : string[28]
"missing broker configuration"

The mqtt configuration is simple (no auth-processes). I tried different addresses (localhost, IP of the RPi, Nothing comes through

Any ideas where to start?

Lovely greetings from sunny Germany

Welcome to the forum!
After you re-installed did you reconfigure the MQTT nodes broker configuration?

yes - you need a newer version of node.js... Ideally 10 or 12 - but you can still get away with 8.17 for a while .
(There were some enhancements to regex handling that we needed for ipv6 support - that were released into node 8.x (but I forget which ... but after 8.9 certainly)

1 Like

Thank you very much!

Yes, i think i did so. After re-install I inserted the whole code of the old project to a new one, found the problem with mqtt and deleted all old broker configurations in NR and added one new config with localhost:1883 (and the others)

1 Like

Did you reinstall using the recommended upgrade script from the node red docs? That should have given you a working version of nodejs.

Yes, i did. Maybe the script did not overwrite the old version since i did not delete the old NR folders.

What does
apt-cache policy nodejs
show? Also what sort of pi is it?

I just updated using
sudo npm cache clean -f sudo npm install -g n sudo n stable.

pi@himbeere:~ $ apt-cache policy nodejs
  Installed: (none)
  Candidate: 0.10.29~dfsg-2
  Version table:
     0.10.29~dfsg-2 0
        500 jessie/main armhf Packages

The node.js-update changed a directory.

pi@himbeere:~ $sudo n stable

installing : node-v10.20.1
mkdir : /usr/local/n/versions/node/10.20.1
fetch :
installed : v10.20.1 (with npm 6.14.4)

Note: the node command changed location and the old location may be remembered in your current shell.
old : /usr/bin/node
new : /usr/local/bin/node
To reset the command location hash either start a new shell, or execute PATH="$PATH"

Do i have to change anything for NR to run probably?

I just did a rebuild (after updating nodejs to v10.x) using npm rebuild in the ~/.node-red directory

Thank you @dceejay, @Colin and @ghayne so much!

1 Like

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