I want to avoid to use the MQTT without the password. I read all the other 21 posts with similar problrem in the comunity but unfortunally I didn’t find the solution. I tryed to reinstall mosquitto, chenge use, reset password, try different password, reboot the raspebby.
Sorry if that came across rudely, as I didn’t mean for that to be the case. There have been times when I’ve assumed someone has done something, and it turns out that they missed it. I’ve also been guilty of overlooking something simple steps. So when it’s not directly stated, it’s always worth asking the question. What’s obvious to you and me may not be obvious to someone else.
I would try using MQTT Explorer to connect to the broker with the password set up. That will at least tell you that the broker/password is working properly.
You use port 8883 instead of port 1883 because you would like to use encrypted connection ?
What does the mosquitto.log in /var/log/mosquitto show ? Any verbose error message that helps to identify the root cause ?
1666980929: mosquitto version 2.0.11 terminating
1666980929: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
1666980929: mosquitto version 2.0.11 starting
1666980929: Config loaded from /etc/mosquitto/mosquitto.conf.
1666980929: Opening ipv4 listen socket on port 1883.
1666980929: Opening ipv6 listen socket on port 1883.
1666980929: mosquitto version 2.0.11 running
1666981345: New connection from 192.168.178.35:54254 on port 1883.
1666981345: New client connected from 192.168.178.35:54254 as 093ff4cb-9068-49ba-93c3-4a24083878ba (p2, c1, k60).
1666982730: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
1666984531: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
1666985478: New connection from 192.168.178.27:47220 on port 1883.
1666985478: Client <unknown> disconnected, not authorised.
1666985505: New connection from 192.168.178.27:36112 on port 1883.
1666985505: Client <unknown> disconnected, not authorised.
1666985508: New connection from 192.168.178.27:36126 on port 1883.
1666985508: Client <unknown> disconnected, not authorised.
1666985514: New connection from 192.168.178.27:48628 on port 1883.
1666985514: Client <unknown> disconnected, not authorised.
1666985546: New connection from 192.168.178.27:47114 on port 1883.
1666985546: Client <unknown> disconnected, not authorised.
1666985550: New connection from 192.168.178.27:47118 on port 1883.
1666985550: New client connected from 192.168.178.27:47118 as mqtt-explorer-ad41685d (p2, c1, k60).
1666985612: Client mqtt-explorer-ad41685d disconnected.
1666985636: New connection from 192.168.178.27:53102 on port 1883.
1666985636: New client connected from 192.168.178.27:53102 as mqtt-explorer-ad41685d (p2, c1, k60).
1666985643: Client mqtt-explorer-ad41685d disconnected.
1666985712: Client 093ff4cb-9068-49ba-93c3-4a24083878ba disconnected.
@Wolfgang_S yes mosquitto.conf contain allow_anonymous false.
Sorry I don’t undestrand what’s wrong? And why with MQTT explorer if I don’t put the password the connection is not allowed but in openhab yes :)?
I change the listener in the mosquitto.conf from 1883 to 8883 and also disable safety connection and also disable select certificate. Now with the wrong password don’t work and with the correct password work.
Don’t ask me why this settings of selectors I just try and error but maybe someone expert of the MQTT protocol can clarify