New MQTT conf problem

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?

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

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?

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.

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


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.

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

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?

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.

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.

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/

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)
    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:~ $

I found my mistake.

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

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

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