{solved} Disconnected from MQTT server core-mosquitto:1883

Hi everyone!

I have problem with my MQTT broker, I can’t get any data to it. It was working fine for approximate 5 days and I think that it stop working after I updated HA.

My setup:
Raspberry pi 4 Model B 4GB
HassOS 4.11, version 0.112.4
Mosquitto broker V5.1 ( Add-on)

My configuration for the Mosquitto is:

logins: []
anonymous: true
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

When I connect one of my ESP8266 (using the PubSubClient/mqtt_esp8266 example in Arduino) it states that it is connected to the MQTT broker but if i tried to listning to the topic in HA nothing pops up. I tried to reinstall Homeassistant and I have followed the “How to use” guide in home assistant for installing MQTT but no succses.

The waring message that is shown before HA log is Disconnected from MQTT server core-mosquitto:1883 (0).

This it my log from the MQTT broker

[20:36:35] INFO: Setup mosquitto configuration
[20:36:35] WARNING: SSL not enabled - No valid certs found!
[20:36:35] INFO: No local user available
[20:36:35] INFO: Initialize Hass.io Add-on services
[20:36:35] INFO: Initialize Home Assistant discovery
[20:36:35] INFO: Start Mosquitto daemon
1594406195: mosquitto version 1.6.3 starting
1594406195: Config loaded from /etc/mosquitto.conf.
1594406195: Loading plugin: /usr/share/mosquitto/auth-plug.so
1594406195: |-- *** auth-plug: startup
1594406195:  ├── Username/password checking enabled.
1594406195:  ├── TLS-PSK checking enabled.
1594406195:  └── Extended authentication not enabled.
1594406195: Opening ipv4 listen socket on port 1883.
1594406195: Opening ipv6 listen socket on port 1883.
1594406195: Opening websockets listen socket on port 1884.
1594406195: Warning: Mosquitto should not be run as root/administrator.
1594406196: New connection from 192.168.68.115 on port 1883.
1594406196: New client connected from 192.168.68.115 as ESP8266Client (p2, c1, k15).
1594406196: New connection from 192.168.68.105 on port 1883.
1594406196: New client connected from 192.168.68.105 as ESP8266Client-ac90 (p2, c1, k15).
1594406197: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1594406197: New client connected from 172.30.32.1 as auto-7EE71028-4504-B8C6-9EA0-DEB11F870FA5 (p2, c1, k60, u'homeassistant').

When I restart my MQTT broker the ESP8266 (IP: 192.168.68.105) losses the connection and then reconnect to the broker.

Does anyone have an idea of what could be wrong? Any advice would be appreciated!

isn’t it because core mqtt has been removed from HA since v0.112

He’s not using the core broker:

The mosquitto add-on does not work well with

anonymous: true

Read the documentation for the add-on. Simply create a user for mqtt in HA and use that one.

Thank you @francisp, you solution worked great!