This was all working so well and now I can't get it to work after hours.
It is a fresh Respberry installation
sudo apt install -y mosquitto mosquitto-clients
sudo systemctl enable mosquitto.service
Synchronizing state of mosquitto.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mosquitto
mosquitto -v
1664393794: mosquitto version 2.0.11 starting
1664393794: Using default config.
1664393794: Starting in local only mode. Connections will only be possible from clients running on this machine.
1664393794: Create a configuration file which defines a listener to allow remote access.
1664393794: For more details see
https://mosquitto.org/documentation/aut ... n-methods/
1664393794: Opening ipv4 listen socket on port 1883.
1664393794: Error: Address already in use
1664393794: Opening ipv6 listen socket on port 1883.
1664393794: Error: Address already in use
sudo mosquitto_passwd -c /etc/mosquitto/passwd mqtt
sudo nano /etc/mosquitto/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
sudo systemctl status mosquitto
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-09-28 21:32:40 CEST; 7min ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Main PID: 3339 (code=exited, status=1/FAILURE)
CPU: 58ms
Sep 28 21:32:40 raspberrypi systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5.
Sep 28 21:32:40 raspberrypi systemd[1]: Stopped Mosquitto MQTT Broker.
Sep 28 21:32:40 raspberrypi systemd[1]: mosquitto.service: Start request repeated too quickly.
Sep 28 21:32:40 raspberrypi systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Sep 28 21:32:40 raspberrypi systemd[1]: Failed to start Mosquitto MQTT Broker.
I don't understand why this does not work