had to install my HA again and just used a backup-file. Nevertheless I am stuck with MQTT, I
am not able to get it connected to HA in docker.
I installed the MQTT package on my synology, then changed the misquitto.conf accordingly (listener 1883, allow_anonymous false, password_file /var/packages/mosquitto/var/password and created a password file (user:password) and then encrypted it.
At my synology port 1883 at the firewall is open
In HA I used the MQTT integration to connect, but always with no success…it always says:
It would help if you could post your Docker compose file and full MQTT conf file. As a first step, it might be worth trying with allow_anonymous true just to see if you can make a connection. That would at least narrow down the problem. Just for reference here are my Docker compose and MQTT conf files, and MQTT is running fine for me on my Synology.
@pkscout: thank you! One step foreward: I changed allow anonymus to true and now it seems to work…this would mean I made a mistake with the password file…
I created it via console:
in the conf file:
password_file /var/packages/mosquitto/var/passwd
then:
vi passwd
Admin:1234>
and then to encrypt:
/volume1/@appstore/mosquitto/bin/mosquitto_passwd -U passwd
I’m hoping someone else can help with that. One of the reasons I do MQTT with anonymous is so I don’t have to deal with the authentication stuff. I figure if someone has managed to get on my network, having MQTT authenticated isn’t really going to help me much, and all someone could really do is cause my clocks to dim and brighten. I decided that was low risk enough to not worry about it.
I had to create an empty file which is the basis for user and pw
example - vi passwordfile (then save it empty → ESC + :wq)
and then use your command: mosquitto_passwd -c passwordfile user1 mosquitto_passwd -c passwordfile user2
I tested it,and it requested a password (twice). But in the file is no password or username and when I try to login with these credentials it did not work.
But I have to tell it is a synology package and not a docker container…
I got it working: It was a mix of both…
Changes mosquitto.conf
then created via: vi passfile
entered name:password --ESC :wq
then used your command: mosquitto_passwd passfile user1