Recently, I installed eclipse mosquitto ver 2.0.18. Inside C:Program Filesmosquittomosquitto.conf, I added these lines:
password_file C:Program Filesmosquittopasswordfile
allow_anonymous false
listener 1883
The MQTT broker on my windows 11 laptop works fine when I comment out the password_file and set allow_anonymous true, but as soon as I tried to use the password_file, my MQTT broker stopped working. When I try to manually start the broker using services, it gives this error
“The Mosquitto Broker Service on local computer started and then stopped ,Some services stop automatically if there are not in use by other services or programs”.
I have tried creating new password files in the same directory as mosquitto.conf using the command mosquitto_passwd. I also tried:
password_file “C:Program Filesmosquittopasswordfile”
password_file “C:Program Filesmosquittopasswordfile.txt”
password_file C:Program Filesmosquittopasswordfile.txt
Other than all this methods, I set per_listener_settings true which is suppose to use previous version of MQTT.
Lastly, I tested the mosquitto.conf using this command mosquitto -c “c:Program Filesmosquittomosquitto.conf” in command prompt and there is nothing displayed
Lucas Cheong Wai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.