Page 1 of 1

default mosquitto.conf

Posted: Wednesday 26 May 2021 19:49
by jkimmel
I upgraded Buster on my Raspi and obviously missed something when asked about the mosquitto.conf.
Result there is no more mosquitto.conf.
Please someone provides me with a essential mosquitto.conf

Re: default mosquitto.con

Posted: Wednesday 26 May 2021 21:26
by FireWizard
Hi,

Wat version of Mosquitto did you install?

There are differences between the mosquitto.conf file between version 1.* and version 2.*
Did you secure your Mosquitto broker with a username/password.

Regards

Re: default mosquitto.conf

Posted: Thursday 27 May 2021 10:59
by jkimmel
My version is 2.*

yes, I had pwd protection.

Re: default mosquitto.conf

Posted: Thursday 27 May 2021 12:18
by Ivo1986
I downgraded mosquitto to 1.6.12 because the V2 problems.

https://rouwette.com/downgrade-mosquitto/

apt install mosquitto=1.6.12-0mosquitto1~buster1
apt-mark hold mosquitto

Re: default mosquitto.conf

Posted: Thursday 27 May 2021 13:38
by djreesing
v2.0.x doesn't have problems, only external access is disabled by default. You can easily change this in the mosquitto.conf, see also https://www.domoticz.com/wiki/MQTT#Installing_Mosquitto

Regarding the original question, maybe this will help https://github.com/eclipse/mosquitto/bl ... uitto.conf

Re: default mosquitto.conf

Posted: Thursday 27 May 2021 18:22
by FireWizard
@jkimmel.

As I run the Mosquitto broker of my production system in a TrueNas jail (FreeBSD) the configuration of my system may not match with the conf file on a Raspberry Pi.

The version I run, is 2.0.8.

My mosquitto.conf looks as follows:

Code: Select all

# This mosquitto.conf file is provided with the FreeNAS Community Plugin for Mosquitto.
#
# See mosquitto.conf(5) for more information:
# https://mosquitto.org/man/mosquitto-conf-5.html

# Write process id to a file.
pid_file /var/run/mosquitto.pid

# When run as root, drop privileges to this user and its primary group.
# Set to root to stay as root, but this is not recommended.
user mosquitto

# Port to use for the default listener.
listener 1883

# At least one of cafile or capath must be defined.
cafile /usr/local/share/certs/ca-root-nss.crt
#cafile /usr/local/etc/mosquitto/ca.crt
#keyfile /usr/local/etc/mosquitto/server.key
#certfile /usr/local/etc/mosquitto/server.crt

# Save persistent message data to disk (true/false).
# This saves information about all messages, including subscriptions,
# currently in-flight messages and retained messages.
persistence true

# The filename to use for the persistent database, not including the path.
persistence_file mosquitto.db

# Location for persistent database. Must include trailing /
persistence_location /var/db/mosquitto/

# Control access to the broker using a password file.
# This file should be generated using the mosquitto_passwd utility.
# -- mosquitto_passwd -c /usr/local/etc/mosquitto/pwfile USER_NAME
# See also: https://mosquitto.org/man/mosquitto_passwd-1.html
password_file /usr/local/etc/mosquitto/pwfile

# allow_anonymous [ true | false ] determines whether clients that connect
# without providing a username are allowed to connect
allow_anonymous false
I hope this is in some respect somewhat helpful, but I recommend to read the links provided by @djreesing

Regards

Re: default mosquitto.conf

Posted: Friday 28 May 2021 11:22
by jkimmel
@FireWizard

Thank you for your efforts. I misplaced the mosquitto.conf. So problem solved.