So I am struggling to get MQTT working on my local instance. I have followed several directions, and I think I have it set up, but I still can not get any connections.
I can go to integrations > MQTT > Configure, and I can publish and listen without any issues. However, if I try to publish on anything else such as the terminal I am constantly getting connection refused. It is a combination of “Connection Refused”, “Unable to connect (Lookup error.)” and “Connection refused: not authorized”. I get the different errors based on how I am trying to publish.
Inside the logs, this is the only message that I get “error: received null username or password for unpwd check
1657070553: Client disconnected, not authorised.”
Earlier in the day, I did set up my system and network for port-forwarding and am using Duck DNS. This does work as expected. I am at a loss as to what simple thing I am overlooking here and would appreciate any help.
Thanks for the quick response tom. I am using the Mosquitto broker. My end game is to get hass agent up and running with MQTT which is not connecting, so I was trying to see if I could publish messages or if it is a different issue. I am not including user credentials when I tried to send from the terminal.
EDIT
just a few more minutes and I was able to get it figured out. What I had to do was supply the local IP of HA instead of using my external duckdns address.
Home assistant creates a system user for the mqtt integration and Mosquitto addon in the background and can connect using this. It is why you can’t use the usernames homeassistant or addons. From the addon documentation:
Since last nite all my Insteon devices have become unavailable in HA. They work from Alexa or thru the App only.
Im running HAOS on a windows VM. I restarted the host box, and the Insteon Hub. No change - Could not connect to Insteon modem. I restarted MQTT. The hub is up on the same IP, but HA cant connect.
This is happening with other new devices I added last nite as well:
I don’t know anything about the insteon integration. So I’m going to assume the integration connects via mqtt to the hub. If that is wrong, ignore this:
It looks like your Insteon hub has lost the mqtt user credentials. Can you check them?
No because no username or password is being supplied to the broker.
See “null username or password” highlighted in blue in your first image.
Actually that could also be the insteon integration. Did you have to supply the mqtt broker credentials when you set the insteon integration up?
I’m going to assume the integration connects via mqtt to the hub.
Yes Im pretty sure thats the case.
I see some others with similar issues here:
Still not sure if this is Insteon hub or mqtt, VM networking, SSL, or integration issue.
I’ll drop a post over there as well. I’ll also load up MQTT Explorer
The good news is, tried pinging the insteon hub and got nothing. Network scan showed it got a new IP. I re-run configure on the insteon integration with the new IP and all the devices came back
The bad news is… all the same / Fresh errors in the Mosquitto broker logs persist
Mosquitto broker
1658211220: New connection from 172.30.32.1:52686 on port 1883. error: received null username or password for unpwd check 1658211220: Client disconnected, not authorised. 1658211225: New connection from 172.30.32.1:52700 on port 1883. error: received null username or password for unpwd check 1658211225: Client disconnected, not authorised. 1658211230: New connection from 172.30.32.1:43438 on port 1883. error: received null username or password for unpwd check 1658211230: Client disconnected, not authorised. 1658211235: New connection from 172.30.32.1:43444 on port 1883. error: received null username or password for unpwd check 1658211235: Client disconnected, not authorised. 1658211240: New connection from 172.30.32.1:54794 on port 1883.
At least im back up and running for now, I’ll save this error hunt for another day. Im sure the explorer app will reveal it. If there’s anything the dev’s can do to accomodate devices/hubs changing IP’s that would be really great for us newbies. Thanks again tom!
I’ve got similag problem today. Issue solved when I chechek mqtt object configuration witihn inegrations. There is option where you need to set system user for mqtt server.
Had a similar problem today, and solved it by changing the usernames to all lowercase letters, both Broker and User account, had the problem.
In the log there is also mentioned something about the auth provider running in legacy mode, might have somthing to do with it, as it was flawless before this.