# Need help rebuilding home automation raspberry pi

**URL:** <https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517>\
**Category:** General\
**Created:** [7 March 2026 21:47 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517 "2026-03-07T21:47:33Z")\
**Posts on this page:** 20\
**Page:** 2

<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:** [12 March 2026 09:14 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/21 "2026-03-12T09:14:52Z")

</div>

To allow mosquitto to accept connections across the network (without using passwords), create a file with the extension .conf in the folder /etc/mosquitto/conf.d (I call mine `/etc/mosquitto/conf.d/mossy.conf`) and in there put

```auto
listener 1883
allow_anonymous true

```

In addition, if you want human readable timestamps in the mosquitto log add

```auto
# human readable timestamps in log
log_timestamp true
log_timestamp_format %Y-%m-%d %H:%M:%S

```

That is preferable to modifying the master config file as that may get overwritten during a mosquitto upgrade.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 March 2026 13:09 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/22 "2026-03-12T13:09:25Z")

</div>

> [@jbudd](#):
>
> Surprisingly for a communications application, it's default is localhost only.

Secure by default - I approve! 😃

Of course, the usual security considerations apply so you should think about your network, information sensitivity and the threat levels of your host country. Not normally too great an issue for home automation over a local network but given the state of the digital world war currently being fought, none of us should be complacent.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 March 2026 13:26 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/23 "2026-03-12T13:26:36Z")

</div>

Well @merkelck has not confirmed that he is using Mosquitto, much less that it's not configured.

It could be filtering at his router; he might even be using Aedes.

Secured by default would imply HTTPS and allow\_anonymous false?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 March 2026 14:55 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/24 "2026-03-12T14:55:17Z")

</div>

> [@jbudd](#):
>
> Secured by default would imply HTTPS and allow\_anonymous false?

While it might ideally. As it is restricted to localhost connections only by default, the other things aren't necessarily a priority. My feeling is that Mosquitto have done this as the simplest way to try to get people to actually THINK about their needed security config. Not unreasonable in my view.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [12 March 2026 23:28 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/25 "2026-03-12T23:28:00Z")

</div>

> [@merkelck](#):
>
> The old system and the new system are connected to the same wired network. They each have their own static i/p addresses.

Just to add re the localhost bit - typically it is not best practice to set localhost as the address of the MQTT broker - but rather an explicit IP address.

I wonder if your old flows had this set - check what they have in their config screen and see if it set to the old IP address of the old machine.

Craig

---

<div class="post-metadata">

**Author:** ![merkelck](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/merkelck/32/106101_2.png) [@merkelck](https://discourse.nodered.org/u/merkelck)\
**Post date:** [13 March 2026 00:50 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/26 "2026-03-13T00:50:52Z")

</div>

In order to try and understand this localhost query, is the suggestion being made that I should use the i/p address of the RPi in all the nodes instead of localhost? I am quite sure that all the nodes in both the older machine and the newer one simply have the word localhost plus the port 1883.  
In answer to another query, the messages that I am looking to receive are coming from the device that is being commanded. The payload is either a yes or no.  
I will check the i/p situation tomorrow

---

<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:** [13 March 2026 10:17 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/27 "2026-03-13T10:17:55Z")

</div>

> [@merkelck](#):
>
> the mqttout node sends a msg to the device who in turn replies and sends the state msg back to the broker via the mqttin node who passes it to the NR for display.

The mqttout node does not send a message to a device, it sends a message to the broker. For a device to receive that it must subscribe to the topic on the mqtt broker that the mqttout node is connected to. Since you have moved the broker to a new pi, which presumably has a different ip address to the old pi, then you need to tell the device to connect to the broker on the new ip address. Have you done that?

---

<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:** [13 March 2026 11:04 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/28 "2026-03-13T11:04:04Z")

</div>

> [@merkelck](#):
>
> is the suggestion being made that I should use the i/p address of the RPi in all the nodes instead of localhost?

There is nothing wrong with using localhost to connect to the broker running on the same machine as node-red.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 March 2026 12:20 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/29 "2026-03-13T12:20:11Z")

</div>

1. Is your mqtt broker mosquitto?
2. What does /etc/mosquitto/mosquitto.conf contain?
3. Are there any .conf files in /etc/mosquitto/conf.d? What do they contain?

I don't believe there is a security issue in revealing mosquitto.conf.  
This is what mine contains

```auto
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
per_listener_settings true
pid_file /run/mosquitto/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d
allow_anonymous false 
listener 1883  
password_file /etc/mosquitto/passwd

```

ie it uses port 1883, anonymous connection is disallowed, and the permitted users have usern ame and a password hash in /etc/mosquitto/passwd, which contains something like this

```auto
user:.........................HCaCllfrRCQHuUSzhvUAp............................................

```

---

<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:** [13 March 2026 15:24 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/30 "2026-03-13T15:24:02Z")

</div>

Did you notice the first line of the file indicating the preferred way of modifying the config?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 March 2026 15:31 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/31 "2026-03-13T15:31:50Z")

</div>

Me?  
Yes I did.

---

<div class="post-metadata">

**Author:** ![merkelck](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/merkelck/32/106101_2.png) [@merkelck](https://discourse.nodered.org/u/merkelck)\
**Post date:** [13 March 2026 15:55 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/32 "2026-03-13T15:55:32Z")

</div>

I really thought the post above from "colin" had found the issue regarding the fact that all of the devices did, in fact, specify the i/p of the RPi that was running mosquitto. So I went to the older running system and shut it down. Then I went to the new system and changed it's i/p to the original value and restarted it. However, that did not change the outcome but I do think that is one problem I had not considered and I plan to stay in this configuration.

For "jbudd" , here is the conf

```auto
ckentm@4004HOME:~ $ cat /etc/mosquitto/mosquitto.conf
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf
per_listener_settings true
pid_file /run/mosquitto/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d
allow_anonymous false
listener 1883
password_file /etc/mosquitto/passwd

```

I also noted that line but as you can see in the code I sent, this file is located in "/etc/mosquitto/" and not in the conf.d directory.

```auto
ckentm@4004HOME:/etc/mosquitto/conf.d $ ls
README
ckentm@4004HOME:/etc/mosquitto/conf.d $ cat README
Any files placed in this directory that have a .conf ending will be loaded as
config files by the broker. Use this to make your local config.

```

Now I wonder if the conf file in the directory above should be moved to this directory?  
Any thoughts

Thanks again for your persistence

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 March 2026 16:11 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/33 "2026-03-13T16:11:26Z")

</div>

The file mosquitto.conf has to be in /etc/mosquitto.

It is best policy not to edit this file because a reinstallation will probably overwrite it.

The file itself instructs mosquitto to import any .conf files from /etc/mosquitto/conf.d.

So your config should ideally go in a file such as /etc/mosquitto/conf.d/myconf.conf.  
If like me you are happy to edit /etc/mosquitto/mosquitto.conf that's fine.

Moving files from one place to another isn't going to resolve this issue.

There is a good guide to setting up mosquitto at [Install Mosquitto Broker Raspberry Pi | Random Nerd Tutorials](https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/)  
As far as i know it is relevant to current versions.

---

<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:** [13 March 2026 16:17 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/34 "2026-03-13T16:17:24Z")

</div>

> [@merkelck](#):
>
> `allow_anonymous false`

That says that you expect all connections to specify a user and password. If you are not using users/pwds the set that to true.

Don't forget to restart mosquitto (or reboot) after changing the config.

`sudo systemctl restart mosquitto`

---

<div class="post-metadata">

**Author:** ![merkelck](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/merkelck/32/106101_2.png) [@merkelck](https://discourse.nodered.org/u/merkelck)\
**Post date:** [13 March 2026 22:05 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/35 "2026-03-13T22:05:42Z")

</div>

First of all, for "jbudd" . That is exactly the course that created this system in the first place. When I started the version was 1.3 and user/pswd was not required. However, when I rebuilt this from version 1.7 is when the course changed to add user/pswd. The mosquitto.conf that is in my previous post, definitely says:

> [@merkelck](#):
>
> allow\_anonymous false

which means to me that user/pswd is required .

Another input that I have rcvd in the RNT forum suggests that RPi OS,Trixie has known issues with NodeRed and suggests that I create another image using Bookworm. At this point, anything is worth a try.

---

<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:** [13 March 2026 22:14 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/36 "2026-03-13T22:14:11Z")

</div>

as a side issue - can you point to that forum re Trixie ? I'm unaware of anything that hasn't been fixed... Trixie is fine especially wrt mqtt etc.

---

<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:** [13 March 2026 22:19 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/37 "2026-03-13T22:19:22Z")

</div>

> [@merkelck](#):
>
> which means to me that user/pswd is required

It is required if you you specified anonymous false. Have you created users and passwords and configured the node red server nodes in node red to use them? If not then set anonymous true.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [13 March 2026 22:24 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/38 "2026-03-13T22:24:41Z")

</div>

> [@merkelck](#):
>
> the RNT forum suggests that RPi OS,Trixie has known issues with NodeRed

I, any many others I would think, use Node-RED with Trixie so I have no idea why anyone would think this. (I also use mosquitto on a very recently updated platform accessed from many Node-RED instances on other Pis with no problems)

---

<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:** [13 March 2026 22:37 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/39 "2026-03-13T22:37:53Z")

</div>

There was a problem early on with gpio and pi5. But I think that is ok now.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 March 2026 22:45 UTC](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517/40 "2026-03-13T22:45:36Z")

</div>

My main mosquitto broker, a Pi 4, actually still runs Bookworm so to check, I have installed mosquitto on another Pi (Zero 2) running Trixie.

I followed the guide as far as configuring anonymous access and I confirm it works with Node-red on another Pi, mqtt-out and mqtt-in nodes pointing to the IP of the Zero 2

I'll now change it to allow\_anonymous false, setup a user/password and report back...

Yes, it works now with a user account and password.  
Key tests:  
systemctl status mosquitto returns, among other stuff:

```auto
Active: active (running)

```

And after editing the Node-red config to include username and password

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ffdac5e36e09c1249d7894fa57aef51a9f329bf0.png)  
the mqtt nodes status shows as Connected.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e8f10003af8604de3690f8340d73aad36b115973.png)

What do these two tests show for you?

ps as @Colin has twice said, there is no real need to disallow anonymous access to mosquitto as long as you can only access the broker from your home network, which is surely the case unless you do something unwise like port forwarding in the router.

[Previous page](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517.md?page=1)

[Next page](https://discourse.nodered.org/t/need-help-rebuilding-home-automation-raspberry-pi/100517.md?page=3)
