MQTT embedded Broker ERROR

Since downgrading have you uninstalled the mqtt binding and reinstalled it via PaperUI?

Use the command line and see if mosquitto is installed and working on your server. You can do this by opening two windows, one for publish and one for subscribe. This will verify its working.

No, that file is for mqtt version 1.x You have mqtt versioin 2.x. If you want to try the 1.x version then enable legacy bindings in PaperUI and install it. Then add your info to the mqtt.cfg located at /ect/openhab2/services.

I really don’t have much more advice to give other than start over with a fresh OH install and add openhabian then mosquitto broker. If you have other devices working with OH you can make a backup then restore it after the fresh install.

The last commit to the github project was six months ago. I was repeating something said by one of the MQTT binding maintainers. I can’t find the thread on github any more.

1 Like

if i delete my

Bridge  mqtt:broker:pibroker [ host="192.168.1.22", port=1883, secure=false, username="xxxxx", password="xxxx" ]

after this the broker don’t have any problem.

After i reinstall the hole system, i got the same error :frowning:

22:03:05.315 [INFO ] [t.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.1.22'. Next attempt in 60000ms
22:03:05.337 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:pibroker' changed from OFFLINE (COMMUNICATION_ERROR): Timeout to OFFLINE
22:03:05.364 [INFO ] [o.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.22' with clientid f9021db3-e58f-419b-8f83-294f5a4a31ab
22:03:05.395 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:pibroker' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED.

NOT_AUTHORIZED is pretty clear. Your username/password combo is not correct.

i try it again and set my Username:PW in Openhabian → Mosquitto and in my *.things file but with the same result :frowning:

edit: if i only put the password in the field i can connect with the username openhabian and my new password.

Is it possible to change the username of the Mosquitto broker?

@mstormi you have worked with openHABian more than I have.

i found a solution.

with this code you can set your own username and password

sudo mosquitto_passwd -b /etc/mosquitto/passwd username password 

is it normal to see this message in my log very often?

10:51:04.431 [INFO ] [t.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '127.0.0.1'. Next attempt in 60000ms
10:51:04.442 [INFO ] [o.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '127.0.0.1' with clientid 6ebeb87f-9567-4867-b6db-a3740d3701f

No, you should not see this often. Only when restarting OH or the mqtt binding. If you continue to see it I recommend restarting OH a few times and see if it goes away. Otherwise you still have issues with the server and broker.

not sure if this was resolved but I ran into the same issue and finally got it fixed by editing the /etc/mosquitto/mosquitto.conf file and adding the following line: listener 1883
more information can be found in the link below
https://gist.github.com/mirhec/27e8df1b2ff52196fabb0f9ea5f4313f

Now my MQTT Broker Thing shows Online