Linux/Mosquitto: Difference between revisions

From Wiki
mNo edit summary
Line 28: Line 28:
<pre>
<pre>
docker cp mosquitto:/mosquitto/config/mosquitto.conf .
docker cp mosquitto:/mosquitto/config/mosquitto.conf .
</pre>


<pre>
allow_anonymous true
allow_anonymous true
listener 1883
listener 1883
Line 35: Line 37:
log_dest file /mosquitto/log/mosquitto.log
log_dest file /mosquitto/log/mosquitto.log
</pre>
</pre>


== Links ==
== Links ==

Revision as of 12:03, 19 December 2021

  • usage
    • subscribe
mosquitto_sub -t "test" -h servername
mosquitto_sub -t "test" -h servername -u "username" -P "password"
mosquitto_sub -t "test" -h servername -u "username" -P "password" -p 8883 --capath /etc/ssl/certs/
  • publish
mosquitto_pub -t "test" -m "test message" -h servername
mosquitto_pub -t "test" -m "test message" -h servername -u "username" -P "password"
mosquitto_pub -t "test" -m "test message" -h servername -u "username" -P "password" -p 8883 --capath /etc/ssl/certs/


  • add user
mosquitto_passwd /etc/mosquitto/users BENUTZERNAME

config

docker cp mosquitto:/mosquitto/config/mosquitto.conf .
allow_anonymous true
listener 1883
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

Links