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:34] – [Runit] darron | tools:mosquitto [2024/09/01 10:03] (current) – [Test] darron | ||
---|---|---|---|
Line 22: | Line 22: | ||
==Private LAN== | ==Private LAN== | ||
+ | Create and edit local config | ||
+ | |||
+ | < | ||
+ | vi / | ||
+ | </ | ||
+ | |||
+ | Add the following | ||
- | Append to / | ||
< | < | ||
listener 1883 | listener 1883 | ||
allow_anonymous true | allow_anonymous true | ||
- | pid_file / | ||
</ | </ | ||
==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 42: | 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 | ||
+ | #RUN | ||
+ | mkdir -p / | ||
+ | chown -R mosquitto: | ||
+ | mkdir -p / | ||
+ | chown -R mosquitto: | ||
mkdir -p / | mkdir -p / | ||
- | chown -R mosquitto mosquitto / | + | chown -R mosquitto:mosquitto / |
- | + | exec / | |
- | 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. |