The Home Assistant image HASSbian has the Mosquitto MQTT broker integrated into the image but it is not enabled by default. To get it working and persistent on reboot, perform the following:
pi@raspberrypi:~ $ sudo systemctl status mosquitto.service
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
Loaded: loaded (/etc/init.d/mosquitto)
Active: active (running) since Tue 2016-11-29 12:54:25 NZDT; 6min ago
Process: 390 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/mosquitto.service
└─399 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
Nov 29 12:54:24 raspberrypi mosquitto[390]: Starting network daemon:: mosquitto.
Nov 29 12:54:25 raspberrypi systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.
Note that by default, the HASSbian version of Mosquitto does not have a username and password set for MQTT unlike the all-in-one installer.
To add a password, follow the instructions on Ben’s video below at the 1:53s mark.
- sudo systemctl enable mosquitto
- sudo systemctl start mosquitto
- sudo reboot
pi@raspberrypi:~ $ sudo systemctl status mosquitto.service
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
Loaded: loaded (/etc/init.d/mosquitto)
Active: active (running) since Tue 2016-11-29 12:54:25 NZDT; 6min ago
Process: 390 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/mosquitto.service
└─399 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
Nov 29 12:54:24 raspberrypi mosquitto[390]: Starting network daemon:: mosquitto.
Nov 29 12:54:25 raspberrypi systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.
Note that by default, the HASSbian version of Mosquitto does not have a username and password set for MQTT unlike the all-in-one installer.
To add a password, follow the instructions on Ben’s video below at the 1:53s mark.
Comments
Post a Comment