How to set username/password mosquitto?
By default, Mosquitto will still allow anonymous connections, i.e. connections where no username/password is provided. In addition to the password_file entry, you also need: allow_anonymous false
By default, Mosquitto will still allow anonymous connections, i.e. connections where no username/password is provided. In addition to the password_file entry, you also need: allow_anonymous false
In separate terminal windows do the following: Start the broker: mosquitto Start the command line subscriber: mosquitto_sub -v -t ‘test/topic’ Publish test message with the command line publisher: mosquitto_pub -t ‘test/topic’ -m ‘helloWorld’ As well as seeing both the subscriber and publisher connection messages in the broker terminal the following should be printed in the … Read more
Subscribing to # gives you a subscription to everything except for topics that start with a $ (these are normally control topics anyway). It is better to know what you are subscribing to first though, of course, and note that some broker configurations may disallow subscribing to # explicitly.