hoka
Posts: 11
Joined: Sat Nov 11, 2017 12:05 pm

Mosquitto password not working

Wed Mar 07, 2018 1:05 pm

hi
i am still very new to pi and need help setting up Mosquitto with a password
i have set up Jessie and Mosquitto and both work well
my problem comes when i try to use a username / password with mosquitto
i have modified mosquitto.conf to:
allow_annonymous false
passwordfile pwfile
then created the pwfile using:
sudo mosquitto_passwd -c /etc/mosquitto/pwfile XXXXXXXXX
everything seems to work ok until i try to log in using
mosquitto_sub -u username -P password -t topic
i get the error connection refused
if i edit mosquitto.conf and comment out annonymous and passwordfile i can log in either with or without the user / password but i think that is to be expected
my problem is getting the password working correctly, i have removed the password file and tried again several times, i think my problem is something basic which i am missing

any help would be much appreciated
dave

User avatar
DougieLawson
Posts: 39296
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Mosquitto password not working

Wed Mar 07, 2018 2:00 pm

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

hoka
Posts: 11
Joined: Sat Nov 11, 2017 12:05 pm

Re: Mosquitto password not working

Wed Mar 07, 2018 5:20 pm

hi Dougie
BIG thanks for coming back to me
i tried your 'method one' as i had already tried the second method and this one seemed far simpler (all visible)
unfortunately i am getting exactly the same result, Error connection refused when i try to:
sub - mosquitto_sub -u dave -P passwd -t hello/world
pub - mosquitto_pub -u dave -P passwd -t topic -m hello

after setting annonymous & pwfile in mosquitto.conf
i'm sure i'm missibg something really basic but i dont really know where to look

thanks for the interest
dave

User avatar
DougieLawson
Posts: 39296
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Mosquitto password not working

Wed Mar 07, 2018 11:06 pm

This is the sort of thing that needs to be discussed on the Mosquitto-Dev mailing list at: https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

hoka
Posts: 11
Joined: Sat Nov 11, 2017 12:05 pm

Re: Mosquitto password not working

Thu Mar 08, 2018 5:20 pm

ok thanks i'll take it there to look for a solution, thanks for your help

Return to “Troubleshooting”