COMMUNICATION_ERROR Broker MQTT

Hi everyone, I’m new here on the community and I hope I have complied with all the rules for the application.
For about 6 months I have installed OH3 on a Raspberry Pi4, created my MQTT broker to which I connected all my sonoff devices and everything worked perfectly, 4 days ago I updated OH3 to version 3.2.0 and from that moment i have offline MQTT broker with following message: COMMUNICATION_ERROR
io.netty.channel.AbstractChannel $ AnnotatedConnectException: Connection refused: /192.168.2.85:8883.
I also leave a screnn with the status of my mosquitto which is active, I also tried to reinstall all OH3 from scratch but without success.
I hope for your help, thanks.

Hello Andrea, could you try to set the port in the MQTT Broker thing? I see the error says that openhab tries to connect on the SSL port (8883) but you have not specified this in you post so I assume the broker listens on 1883?

You’re right I didn’t specify the port, I had set 8883 and it gives me that error, changing port for example 1883 the error is the same (obviously change the port) … I also tried to remove Secure Connection but the error persists .
I have not created any credentials for the MQTT broker.

I’m not sure if I understand correctly. Do you mean that your mqtt broker listens on 8883?

Have you tried cleaning the openhab cache after the update?

If your Mosquitto has upgraded too, you might need to allow anonymous connection.

The port of my broker is 1883, I wanted to say that even changing the door the error remains, I’m sorry but I don’t speak English very well.
I cleaned the cache after the update.
I am also attaching other screenshots I made of the mosquitto conf folder, as you can see I added the listener entries 1883 and allow_anonymous true as to allow authentication and connection without password to all users.
Nano

As you can see from its log, Mosquitto does not seem to be reading your config file. Name, location, permissions?

How can I do to give you the information you asked for?
I’m sorry but I’m not very well versed in codes.

Basically its a mosquitto issue as per you last screenshot create a configuration file which defines a listener(port connection) and allow remote access. To get openHAB connected in this state you would need to set the host to localhost but nothing else will connect to it.

It looks like during the upgrade Mosquitto also upgraded to v2 which has changed the way it allows connections.

See here for more info.

1 Like

I followed your instructions and reinstalled everything, now it works fine but I had to set up “listeners 1883 and allow_anonymous true” as first two lines in mosquitto conf.
thank you.

That is step 1a in the linked instructions. Are you saying that those two lines only worked if you put them as the first two lines of the config, rather than the last two?

Exactly, if I put them at the end the broker remains offline, writing them over and doing a restart of mosquitto goes online immediately.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.