# New MQTT conf problem

**URL:** <https://discourse.nodered.org/t/new-mqtt-conf-problem/69047>\
**Category:** General\
**Tags:** node-red-dashboard, database\
**Created:** [14 October 2022 21:48 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047 "2022-10-14T21:48:18Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [14 October 2022 21:48 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/1 "2022-10-14T21:48:18Z")

</div>

Hello, I reset the pico WH due to some problems. I installed Node-Red and MQTT (mosquitto) products again. However, due to identity security made in MQTT ver2, I could not set up MQTT client in my network.

How can I install an old version of mqtt?

Or can you help with the installation?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [14 October 2022 22:14 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/2 "2022-10-14T22:14:42Z")

</div>

Hi, your post is a little unclear but at a guess you cannot connect to mosquito MQTT version 2 right?

Search the forum and search the internet mosquito version 2 is secure by default, so you need to modify the config file to permit connection other than localhost.

Example: [Setting up a Live/Prod and a Development System - #20 by Colin](https://discourse.nodered.org/t/setting-up-a-live-prod-and-a-development-system/67415/20)

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [15 October 2022 22:10 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/3 "2022-10-15T22:10:06Z")

</div>

Hello, sorry for writing late.

I guess it's not because I'm doing something wrong. How can I install a non-authenticated version of mqtt on the Pi?

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [15 October 2022 22:18 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/4 "2022-10-15T22:18:47Z")

</div>

Mosquitto is a VERY popular MQTT product. There is literally one entry you need to make in the conf file to do what you want to do. I think @Steve-Mcl is trying to get you to do a little research on your own which really isn't a bad thing. Stick with the software and do a little google on it, you'll be happier in the long run.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [15 October 2022 22:28 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/5 "2022-10-15T22:28:24Z")

</div>

> [@sefaguntepe](#):
>
> How can I install a non-authenticated version of mqtt on the Pi?

Open the link I posted. The answer is literally inside.

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [16 October 2022 13:42 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/6 "2022-10-16T13:42:06Z")

</div>

Hi,

Thank you for your support, but it's still like this.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/c/7c10f49264cc15be7542d29878f05438870c3977.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 October 2022 13:57 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/7 "2022-10-16T13:57:22Z")

</div>

> [@sefaguntepe](#):
>
> Thank you for your support, but it's still like this.

Did you do anything?  
Did you change the conf file?  
Which file?  
Show us what you changed.

---

<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:** [16 October 2022 13:58 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/8 "2022-10-16T13:58:13Z")

</div>

Did you create the file /etc/mosquitto/conf.d/mossy.conf as in the linked post?  
If so did you restart mosquitto (or reboot)?

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [16 October 2022 14:53 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/9 "2022-10-16T14:53:46Z")

</div>

I proceeded as on this website. Then I tried the configurations in the link you sent, but it didn't work. I will reset the pi zero and try again. Do you have a suggested installation sequence?

> **[Install an MQTT Server and Node-RED on Raspberry Pi for Home Automation](https://www.makeuseof.com/install-mqtt-server-node-red-raspberry-pi-home-automation/)**
>
> Control DIY smart IoT devices from your Raspberry Pi by installing an MQTT server and Node-RED.

---

<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:** [16 October 2022 15:10 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/10 "2022-10-16T15:10:34Z")

</div>

No need to reset and start again, this is not windows. What do these commands show? Copy/paste them into a terminal  
`cat /etc/mosquitto/mosquitto.conf`  
`cat /etc/mosquitto/conf.d/mossy.conf`

**[Edit]** Don't follow that tutorial there are several things in there you don't need to do. Just install mosquitto, install node red, create the mossy.conf file. That's it.

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [16 October 2022 15:38 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/11 "2022-10-16T15:38:42Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a066db77c754d8e538e79be438c606ab5ebf9f70.png)

---

<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:** [16 October 2022 16:24 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/12 "2022-10-16T16:24:10Z")

</div>

That looks ok, except that you have added some lines to mosquitto.conf, which wasn't necessary. They won't do any harm though.

You should not be running mosquitto in a terminal though, it should be run as a service. What does this show?  
`sudo systemctl status mosquitto`

In future when posting output please copy/paste it here rather than screenshot.

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [16 October 2022 16:46 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/13 "2022-10-16T16:46:29Z")

</div>

```auto
pi@pico:~ $ 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.gz

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

pi@pico:~ $ cat /etc/mosquitto/conf.d/mossy.conf
listener 1883
allow_anonymous true
log_timestamp true
log_timestamp_format %Y-%m-%d %H:%M:%S

pi@pico:~ $ sudo systemctl status mosquitto
● mosquitto.service - Mosquitto MQTT Broker
     Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-10-16 17:27:01 BST; 12min ago
       Docs: man:mosquitto.conf(5)
             man:mosquitto(8)
    Process: 329 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS)
    Process: 336 ExecStartPre=/bin/chown mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS)
    Process: 337 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS)
    Process: 338 ExecStartPre=/bin/chown mosquitto /run/mosquitto (code=exited, status=0/SUCCESS)
   Main PID: 339 (mosquitto)
      Tasks: 1 (limit: 415)
        CPU: 1.019s
     CGroup: /system.slice/mosquitto.service
             └─339 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Oct 16 17:27:00 pico systemd[1]: Starting Mosquitto MQTT Broker...
Oct 16 17:27:01 pico mosquitto[339]: 1665937621: Loading config file /etc/mosquitto/conf.d/mossy.conf
Oct 16 17:27:01 pico systemd[1]: Started Mosquitto MQTT Broker.
pi@pico:~ $

```

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [16 October 2022 16:47 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/14 "2022-10-16T16:47:38Z")

</div>

I found my mistake.

> **[How to Install Mosquitto on The Raspberry Pi](https://stevessmarthomeguide.com/install-mosquitto-raspberry-pi/)**
>
> How to Install Mosquitto on The Raspberry Pi and test the install using mosquitto\_sub and mosquitto\_pub clients

I uploaded it as in the address and added the information you sent. And it worked. Thank you for everything.

```auto

listener 1883
allow_anonymous true
log_timestamp true
log_timestamp_format %Y-%m-%d %H:%M:%S

```

---

<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:** [30 October 2022 16:48 UTC](https://discourse.nodered.org/t/new-mqtt-conf-problem/69047/15 "2022-10-30T16:48:24Z")

</div>

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