Getting started with mosquitto mqtt server #114
jbbjarnason
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Starting
Using package manager
Either use system mosquitto package and init system, example:
Using docker
A neat feature of docker is to run inspect to get the ip address of the container (given the name arg from above):
Configuration
Depending on the startup method you would either place it relative to where the docker container is started, when using package manager the default path is
/etc/lib/mosquitto
Minimal config example
A non secure config example,
mosquitto.conf
:Simulating offline state
Forwarding the TCP traffic through
socat
can be used to simulate offline state, however, if you are using database and gracefully exit the broker it should write clients to database and clients can then regain session(of course depending on configuration). Example of usingsocat
with docker based mosquitto server running at172.18.0.2
:Clients can then connect to localhost:1234
Debugging database
Make a debugging database executable,
Of course you need to point to your instance of database file.
Wireshark
Install it with your package manager and add your user to the wireshark group, example:
If you are using docker than the traffic is only on that interface (given that you are not running other containers).
TODO move to repository readthedocs
Move this later to repo
Beta Was this translation helpful? Give feedback.
All reactions