Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools:mosquitto [2024/08/29 07:27] – [Runit] darron | tools:mosquitto [2024/09/01 10:03] (current) – [Test] darron | ||
---|---|---|---|
Line 21: | Line 21: | ||
==Private LAN== | ==Private LAN== | ||
+ | |||
+ | Create and edit local config | ||
+ | |||
+ | < | ||
+ | vi / | ||
+ | </ | ||
+ | |||
+ | Add the following | ||
< | < | ||
- | echo " | + | listener |
+ | allow_anonymous | ||
</ | </ | ||
==Public WAN== | ==Public WAN== | ||
+ | |||
+ | Create password file and add a user | ||
< | < | ||
- | TODO | + | touch / |
+ | mosquitto_passwd -b / | ||
+ | </ | ||
+ | |||
+ | Create and edit local config | ||
+ | |||
+ | < | ||
+ | vi / | ||
+ | </ | ||
+ | |||
+ | Add the following | ||
+ | |||
+ | < | ||
+ | listener 8883 | ||
+ | allow_anonymous false | ||
+ | password_file / | ||
+ | |||
+ | certfile / | ||
+ | cafile | ||
+ | keyfile | ||
</ | </ | ||
Line 38: | Line 68: | ||
sleep 1 | sleep 1 | ||
- | mkdir -p / | + | #LOG |
- | chown -R mosquitto mosquitto / | + | exec 2>& |
+ | ulimit -l unlimited | ||
+ | ulimit -i unlimited | ||
+ | ulimit -q unlimited | ||
+ | ulimit | ||
+ | ulimit | ||
- | mkdir -p /var/run/ | + | #RUN |
- | chown -R mosquitto mosquitto /var/run/ | + | mkdir -p /var/lib/ |
- | + | chown -R mosquitto:mosquitto /var/lib/ | |
- | exec /usr/sbin/mosquitto -c /etc/ | + | mkdir -p / |
+ | chown -R mosquitto: | ||
+ | mkdir -p /run/mosquitto | ||
+ | chown -R mosquitto:mosquitto | ||
+ | exec / | ||
</ | </ | ||
===Test=== | ===Test=== | ||
- | MQTT host is listening at 192.168.0.13 | + | ==Private LAN== |
< | < | ||
mosquitto_sub -h 192.168.0.13 -t '#' | mosquitto_sub -h 192.168.0.13 -t '#' | ||
</ | </ | ||
+ | |||
+ | ==Public WAN== | ||
+ | |||
+ | < | ||
+ | mosquitto_sub -v -h hostname.example.com -p 8883 -u username -P password -t '#' | ||
+ | </ | ||
+ | |||
+ | The hostname must match the name in the TLS certificate. |