This is an old revision of the document!


Mosquitto MQTT

Install

sudo apt install mosquitto mosquitto-clients mosquitto-dev

Disable

Stop and disable mosquitto server for now. Later start it using `runit'

/etc/init.d/mosquitto stop
update-rc.d mosquitto disable
systemctl disable mosquitto
systemctl mask mosquitto

Setup

Private LAN

Append to /etc/mosquitto/mosquitto.conf

listener 1883
allow_anonymous true
Public WAN
TODO

Runit

#! /bin/bash
sleep 1

mkdir -p /var/log/mosquitto
chown -R mosquitto mosquitto /var/log/mosquitto

mkdir -p /run/mosquitto
chown -R mosquitto mosquitto /run/mosquitto

exec /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Test

MQTT host is listening at 192.168.0.13

mosquitto_sub -h 192.168.0.13 -t '#'
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies