Unable to get MQTT running (Now fixed!)

The Mosqitto log shows multiple entries as follows:

2022-12-06 12:56:30: New connection from 192.168.1.39:37206 on port 1883.
error: received null username or password for unpwd check

Here is the diagnostic entry:

 "integration_manifest": {
    "domain": "mqtt",
    "name": "MQTT",
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/mqtt",
    "requirements": [
      "paho-mqtt==1.6.1"
    ],
    "dependencies": [
      "file_upload",
      "http"
    ],
    "codeowners": [
      "@emontnemery"
    ],
    "iot_class": "local_push",
    "is_built_in": true
  },
  "data": {
    "connected": true,
    "mqtt_config": {
      "birth_message": {
        "topic": "homeassistant/status",
        "payload": "online",
        "qos": 0,
        "retain": false
      },
      "discovery": true,
      "discovery_prefix": "homeassistant",
      "port": 1883,
      "protocol": "3.1.1",
      "tls_version": "auto",
      "will_message": {
        "topic": "homeassistant/status",
        "payload": "offline",
        "qos": 0,
        "retain": false
      },
      "keepalive": 60,
      "broker": "core-mosquitto",
      "username": "**REDACTED**",
      "password": "**REDACTED**"
    },
    "devices": [],
    "mqtt_debug_info": {
      "entities": [],
      "triggers": []
    }
  }
}

I’ve just got the user and password set for MQTT, because at this stage I’m not bothered about security.
(Ive set up MQTT before on an earlier iteration of HA, but I don’t recall the difficulty I’m having this time!)

I’d be grateful for some help, please.

Jim

I assume you have created that username and password on the broker? I know you can use built HA users, but I never have, I’ve only ever used ones I’ve created on the broker config.

Have you tried using mqtt explorer or similar to connect using your username and password. This would validate that the broker is running and the credentials are fine. You’d need to connect using the external ip of the box.

Then try using the same login details to configure the mqtt integration. If mqtt explorer works and the integration doesn’t then you are doing the config wrong.

Thanks for the reply Roger.

I’ll give your suggestion a try, but at the moment I’m pretty pissed off with the problem of getting MQTT working on HA. When I used HA a couple of years ago I had no problem - MQTT just worked, until a HA update wrecked the whole system.

This has almost got me gibbering with rage!**#

I’m now getting:

2022-12-08 17:14:45: New connection from 172.30.32.1:56104 on port 1883.
error: received null username or password for unpwd check
2022-12-08 17:14:45: Client <unknown> disconnected, not authorised.

Where did that IP address come from - the range I use is 192.168.1 etc.

Jim

All sorted now!

I don’t know what fixed it, maybe the repeated reinstallations.

Jim

That is the internal docker network address. See: