sudo apt-get install mosquitto
Le broker mosquitto est directement installé et lancé
vérif:
sudo systemctl list-unit-files --type=service | grep mosquitto
sudo systemctl status mosquitto.service
/tmp/mosquitto.log, comme tous les fichiers de log, sera effacèe à chaque reboot de la Pi
# 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 /tmp/mosquitto.log
#log_type all
include_dir /etc/mosquitto/conf.d
Une fois fonctionnel, mosquitto sera lancé en tant que service à chaque démarrage de la Pi
sudo systemctl daemon-reload
sudo systemctl restart mosquitto.service
vérif:
sudo systemctl list-unit-files --type=service | grep mosquitto
sudo systemctl status mosquitto.service
tail -f /tmp/mosquitto.log