Mosquitto : unable to change listening port 1883


I am trying to install Mosquitto add-on thanks Supervisor.
I have used standard config but I got messages :

It seems to work but there is problem with 1883 port.

So, I have changed ports in network card :

I have choosen port 1885 instead of 1883. I save, start again Mosquitto BUT always the sames messages and the standard port 1883 listened :

I can’t figure why the 1885 choosen port is not used, still 1883.

Thank for your help.

Here is my setup :

I think mosquitto still listens on port 1883 inside it’s container and docker maps it to 1885. Can you actually try connecting to your server at port 1885 and see if it is working?

Thanks for your help. Could you tell me how to test the port, please ?
I have tried like this but I am not sûr… : is HA IP :

By the way, I have lots of error messages :

This problem is known on github but it seems a few people are experiencing it and I can’t figure out a solution.
By the way, it works, I can send messages… :

ping is ICMP, you cannot ping a port (ports are a TCP/UDP thing).
I would try the command line programs from the mosquitto-clients package. E.g. mosquitto_sub -h host -p 1885 -t testtopic --verbose --debug.

To test if a port is open, you can use nc -zv 1885.

You have edited your post stating that it works and that you can send messages. Which port are you connecting to?

I have tried again with 1883 port, in the conf :
With your help, it gives :

It works, it communicates, it seems BUT there are lots of error messages :

I have found this, it seems I have the same problem :

Those error messages are probably just a device ( trying to connect to your broker and sending garbage data.

If you change the port in your config to 1885 and then try to connect with -p 1885, does it work?
Or were you trying to change the port just because of the error messages?

At the begininng, that’s why I wanted to try another port, the 1885. I hade the same messages.
I am not sûr what to do now : since several minutes, no new error messages :

I wait one hour or two to check befor other trys ?
Thanks again four your help :slight_smile:

Oh, no, it does it again…

So, I have changed port : 1885.
Here the result :

OK, so changing ports works as expected. No problems there.

From the github issue you linked, I found this: Unknown client connecting to MQTT broker · Issue #51603 · home-assistant/core · GitHub

That is the supervisor checking if the add-on is still responding as part of a health check. This is expected, not a bug and actually good.

1 Like

Oh, it’s expected and normal ? That is a good news !
By the way, the last journal :slight_smile:

I have just read the same in the github. Thanks a lot !!!