MQTT Device not connecting to home assistant mosquitto broker

Hi Everyone,

I’ve done a bit of reading in to this and can’t find an adequate answer.

I have an auto garage opener in my car in the form of a D1 Mini Pro. When it connects to the network and mosquitto broker it will open / close the garage door.

This has been working perfectly until I recently upgraded my network to a new shiny Unifi Dream Machine Pro. I’ve configured all the networks, and I’ve updated the device in question with the new wifi credentials.

The device successfully connects to the network, however I get the error
“Attempting MQTT connection to broker: 192.XXX.XXXXX
MQTT connection failed, rc=-2”

I’ve triple checked all the settings in home assistant and mosquitto, redone the mqtt user, I’ve restarted server/ broker, I’ve wiped and reflashed the d1 mini pro, I keep getting the same error.

I feel the new network setup has something to do with this. I have a firewall rule in place however that allows all my networks to communicated with the home assistant server and with mqtt via the mqtt ports. For testing purposes I’m running the d1 mini pro on the same network as the home assistant server which should mean there is no need for the port firewall rules, I’m getting no love.

Are there any suggestions from the more experienced of you out there?

Not a direct answer, but did you see this:

A lot of the issues seem to be either DHCP or DNS related.

Hey @thusassistint ,

I did come across this, I had a deeper read after you linked it. A lot of the things people are discussing in this thread are things that I haven’t even necessarily come across within my setup (though I’m sure they are certainly possible). I’ll have a bit of a play and see if I can make any headway.

Thank you for the link.

I have the same issue. I use Netgear Orbi mesh router and found the device cannot connect to MQTT server when it connects satellite router. I tried to turn off satellite and some devices could connect to MQTT server if it could connect to major Orbi router.