A while ago I installed mosquitto with the hassbian script
sudo ./hassbian-scripts/install_mosquitto.sh
The installation went fine and the integration with HASS and owntracks works like a charm. So far so good.
Because I want to play with the android tasker app and the mqtt plugin I tried to start mosquitto. I then get the following error:
pi@hassbian:~ $ mosquitto
1529048526: mosquitto version 1.4.15 (build date Sat, 07 Apr 2018 11:13:41 +0100) starting
1529048526: Using default config.
1529048526: Opening ipv4 listen socket on port 1883.
1529048526: Error: Address already in use
I figured out that I should edit etc/systemd/system/ [email protected]. However when I change it and reboot the pi, I can start mosquitto but Hass give me an mqqt installation error. When I restart Hass the mqtt errors are gone but I then the āadress already in useā error is back again
# 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/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
/etc/mosquitto/conf.d/local.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.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_file mosquitto.db
persistence_location /var/lib/mosquitto/
user mosquitto
password_file /etc/mosquitto/pwfile
allow_anonymous false
connection_messages true
log_dest topic
log_dest syslog
log_dest stdout
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
log_timestamp true
The error normally indicates two brokers trying to open the same port. Did you stop the version of mosquitto started by systemd before you ran on the command line?
Thanks that worked! But do I have to stop this service each time after a reboot or can I disable it permanently? Do I need that broker in the first place?
Ok, but which mosquitto does hassbian configures; the internal broker or the one I installed with the script??
However I got the following messageā¦
pi@hassbian:~ $ sudo systemctl disable mosquitto.service
mosquitto.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable mosquitto
But what i dont understand is that Hass gives me config errors after I stopped and disabled mosquitto.service. After I turned the service on the errors are gone. So it seems that hass uses mosquitto.service. And if this is the internal broker why isnt hass uses the external broker I installed. My config looks like
Letās get the terminology straight, because I think that is where you are getting confused.
HomeAssistant has an embedded broker, that is included within the code of HA. To use this, you do not need to install anything, and need to specify just mqtt: in your configuration file to enable it. Everything else is regarded as an external broker. Thus there is no such thing as an internal broker.
The mosquitto program you have installed is an external broker, and presumably is running at the location 192.168.1.103, as you get error messages only when it is not running.
Hi,
i know this is an old post but iāve this error and i donāt know how to figure out.
Iāve tried to start this service without success
Iāve also tried to del all mosquitto folders but iāve had permission problems.
Is there anyone help me?
Iāve Hassio installation on docker.
Regards,