Can only connect with MQTT default credentials

OK, so just for anyone else who is reading this, I think I’ve got it sussed.

Create a new password file using

sudo mosquitto_passwd -c /etc/mosquitto/passwd emonpi

Then use the default password emonpimqtt2016

If you want to add new users, use the same command but without the -c so it doesn’t create a new file each time.

Once you have added all the new users you want to, you need to restart the Mosquitto service for it to pickup the changes.

sudo mosquitto service stop
sudo mosquitto service start

When I did this, all the added users started working. No clue why the default user was connecting when it wasn’t in the passwd file, but hey, it was working so thats what matters.

Great result!

2 Likes