Mosquitto service unable to start


I am little bit stuck with mosquitto mqtt. I am unable to start it.
Installed: 1.5.7-1+deb10u1
Candidate: 1.5.7-1+deb10u1
beaglebone : SanCloud BeagleBone® Enhanced WiFi 512​


# 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

pid_file /var/run/

persistence true
persistence_location /var/lib/mosquitto/

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

include_dir /etc/mosquitto/conf.d


allow_anonymous true
password_file /etc/mosquitto/passwd
listener 1883 
listener 8883

root@beaglebone:/home/debian# systemctl status mosquitto
● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
   Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2022-05-17 13:10:15 EEST; 2s ago
     Docs: man:mosquitto.conf(5)
  Process: 1598 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
 Main PID: 1598 (code=exited, status=1/FAILURE)


1636373500: Config loaded from /etc/mosquitto/mosquitto.conf.
1636373500: Opening ipv4 listen socket on port 1883.
1636373500: Error: Cannot assign requested address
1636373501: mosquitto version 1.5.7 starting
1636373501: Config loaded from /etc/mosquitto/mosquitto.conf.
1636373501: Opening ipv4 listen socket on port 1883.
1636373501: Error: Cannot assign requested address

I installed Mosquitto about a month ago on a BBB, it went ok, I don’t recall that many issues. I’m sorry I didn’t keep the links I was working from. As far as the .conf file, that is stock and look just like mine. I did not add a file to conf.d, it has just a readme. I did edit a ‘websockets.conf’ in the mosquitto folder with

listener 1883
protocol mqtt
listener 9001
protocol websockets

and I did(not sure if I needed to):

systemctl stop cloud9.service 
systemctl stop cloud9.socket 
systemctl disable cloud9.service
systemctl disable cloud9.socket
systemctl stop bonescript-autorun.service
systemctl stop bonescript.service
systemctl stop bonescript.socket
systemctl disable bonescript-autorun.service
systemctl disable bonescript.service
systemctl disable bonescript.socket
systemctl daemon-reload

chmod 666 /etc/ssh/ssh_config
chmod 644 /etc/ssh/ssh_config
chmod 666 /etc/mosquitto/websockets.conf
chmod 666 /etc/sysctl.conf
chmod 666 /var/log/mosquitto/mosquitto.log
systemctl restart 
chmod 666 /var/lib/mosquitto/mosquitto.db

I did all this logged on as root also.
I’ll watch this thread, best, Dan.

1 Like

Hi aivcho,
So, I had to start over, I blew off my network. I did write this as I did. I still have an ESP8266EX out there reporting. So:

apt update
apt install mosquitto
apt install mosquitto-clients

is all I had to do. Set the new IP on the ESP and:

mosquitto_sub -v -t 'tele/homerefer/SENSOR' | xargs -d$'\n' -L1 >> /var/log/mosquitto/refer.log &

the refer.log is filling with data!
Best, Dan.

1 Like