MQTT Error COMMUNICATION_ERROR

Hey there, sorry for my bad English.
I have a problem with MQTT.
I had the same Problem already with obenhab 2 and now with openHAB 3.
I installed openHAB 3 on my Raspberry PI 4 an added an Broker.
all worked fine but after a time might a restart the broker wont work.

COMMUNICATION_ERROR
CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED.

I would be very happy if someone could help me.

Thank you

  • Are you using openhabian?
  • What is your MQTT Broker? Mosquitto? Have you confirmed that your broker has actually started? What is your broker configuration? Does it have a username and password?
  • What is your openHAB MQTT configuration?

When sharing code or configuration make sure to use code fences.

hi @hafniumzinc, I have the same problem with mqtt broker.
I use mosquitto and it’s active, I don’t have username and password, I’m using openhabian 3.2.0, broker configuration in oh it’s my raspberry ip, port 1883.
Hope you can help me
thank you

What is permission of the dirctory /var/log/mosquitto: ls -ld /var/log/mosquitto/
What is the content of your log file /var/log/mosquitto/mosquitto.log ?
What is the output of sudo netstat -tulpn | grep 1883

[RESOLVED]

What is permission of the dirctory
drwxr-xr-x 2 mosquitto root 4096 Jan 5 12:45

What is the content of your log file
1641383153: mosquitto version 2.0.11 starting

1641383153: Config loaded from /etc/mosquitto/mosquitto.conf.

1641383153: Starting in local only mode. Connections will only be possible from clients running on this machine.

1641383153: Create a configuration file which defines a listener to allow remote access.

1641383153: For more details see Authentication methods | Eclipse Mosquitto

1641383153: Opening ipv4 listen socket on port 1883.

1641383153: Opening ipv6 listen socket on port 1883.

1641383153: mosquitto version 2.0.11 running

1641384954: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.

1641386755: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.

1641388556: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.

1641389280: mosquitto version 2.0.11 terminating

1641389280: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.

What is the output of
tcp 0 0 127.0.0.1:1883 0.0.0.0:* LISTEN 3211 / mosquitto
tcp6 0 0 :: 1: 1883 ::: * LISTEN 3211 / mosquitto

This means that mosquitto is running and listening only to MQTT traffic on the host itself.
Traffic and requests from local network via ethernet are not taken into account as it is not listening on the ethernet internface.

Check e.g. this thread:

I try thanks

I tried it but don’t work same

What does that mean ?
I understand that it does not work but does also the netstat command deliver the same result or a different one ? In case it is different how does it look now ?

Thanks I have resolved