# NR not receiving MQTT

**URL:** <https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183>\
**Category:** General\
**Created:** [6 May 2020 17:15 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183 "2020-05-06T17:15:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayballz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayballz/32/21375_2.png) [@jayballz](https://discourse.nodered.org/u/jayballz)\
**Post date:** [6 May 2020 17:15 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/1 "2020-05-06T17:15:32Z")

</div>

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:

```auto
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"

```

and

```auto
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, [test.mosquitto.org](http://test.mosquitto.org)). Nothing comes through

Any ideas where to start?

Lovely greetings from sunny Germany  
jay

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [6 May 2020 17:25 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/2 "2020-05-06T17:25:25Z")

</div>

> [@jayballz](#):
>
> "missing broker configuration"

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [6 May 2020 17:27 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/3 "2020-05-06T17:27:09Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![jayballz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayballz/32/21375_2.png) [@jayballz](https://discourse.nodered.org/u/jayballz)\
**Post date:** [6 May 2020 17:33 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/4 "2020-05-06T17:33:59Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 May 2020 17:48 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/5 "2020-05-06T17:48:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jayballz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayballz/32/21375_2.png) [@jayballz](https://discourse.nodered.org/u/jayballz)\
**Post date:** [6 May 2020 18:54 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/6 "2020-05-06T18:54:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 May 2020 19:19 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/7 "2020-05-06T19:19:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jayballz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayballz/32/21375_2.png) [@jayballz](https://discourse.nodered.org/u/jayballz)\
**Post date:** [6 May 2020 19:50 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/8 "2020-05-06T19:50:34Z")

</div>

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

```auto
pi@himbeere:~ $ apt-cache policy nodejs
nodejs:
  Installed: (none)
  Candidate: 0.10.29~dfsg-2
  Version table:
     0.10.29~dfsg-2 0
        500 http://mirrordirector.raspbian.org/raspbian/ 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 : [https://nodejs.org/dist/v10.20.1/node-v10.20.1-linux-armv6l.tar.xz](https://nodejs.org/dist/v10.20.1/node-v10.20.1-linux-armv6l.tar.xz)  
> 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?

---

<div class="post-metadata">

**Author:** ![jayballz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayballz/32/21375_2.png) [@jayballz](https://discourse.nodered.org/u/jayballz)\
**Post date:** [6 May 2020 19:57 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/9 "2020-05-06T19:57:19Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 May 2020 19:57 UTC](https://discourse.nodered.org/t/nr-not-receiving-mqtt/26183/10 "2020-05-20T19:57:21Z")

</div>

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