Mosquitto MQTT 4.1 doesnt work after update

Two hardboot’s of my Pi3 and i’m back in action, like nothing ever happened :thinking::thinking:

I am having no issues with my clients w/o TLS, however my ESP32 that using TLS cannot connect to the MQTT broket 4.1. It is just trying to connect and stucked in the loop, no error message about TLS. When I reboot MQTT broker using hass.io, nothing happens, but whenever I restart HA my ESP32 immediately connects to the broker.

Any idea on how to troubleshoot this issue?

I cannot go back to 4.0 as I have a fresh installation and have no snapshots.

Thanks,
Balazs

So what’s the current status on this? I’ve held off upgrading to 4.1 because of this thread, but wondering about going forward. My main users of MQTT are some Sonoff/Tasmota devices. Just updated them all to 6.5.0 (core 2.3.0), is that sufficient to resolve the issue? Or do I need to do more?

1 Like

I did get it working in the end, for me there was a collection of slight tweaks needed but I think the main issue was not configuring the ACL files correctly.

Spend hours in my code thinking something was wrong but it turns out any topic with a dash - in it was causing problems for me. I switched to mosca broker and had no issues. It was also inconsistent. Some packets were sent on to client others no. Too buggy. Will use mosca until there is evidence that mosquitto broker is not broken.

1 Like

Hi Guys,

did you experience similar problems with mosquitto after the update?
I have a huge issue with connection times. mosquitto added +3 seconds for establishing a connection.

Anyone else have this problem?

I have problem with 4.1 and 4.2 version. I have ALC enable. It work for sometimes and stop working with the same config, full restore with snapshot create when it work not help . It is confuse me. Is there anyway to downgrade hassio mosquitto addon to 4.0 or even 3.0?

youre my hero!
Thanks, it works for me also :slight_smile:

Thanks for explaining on how to roll back. Going back to version 4 fixed the issue.
I think I will make this my first rule before I update to create a snapshot. :relieved:

I have HA 0.92.2 and I wanted to install Mosquitto broker from official add-ons store, but when I click on “install" button – nothing happens. HA log show no errors related to MQTT install. What can cause installation problem? What should I check?

I want to share my experience with Mosquitto 4.1 and 4.2 for that matter.
I lost days trying to make it work, verifying all methods (including downgrading the 0.92). No luck. 4.0 worked fine, 4.1 not. Neither 4.2.
Eventually, I decided to reinstall everything from scratch, system, HA, mosquitto.
I have saved the config files, then rebuild everything by copying the yaml files, step by step (not using the snapshots).
I have created a user for mosquitto and created the ACL files as stated in doc.
Magically, it works.
It looks to me that upgrading HA from version to version, leaves something behind mosquitto doesn’t like.

Cheers,
us

Hi,
After reading the entire thread I’m still struggling with a solution to getting the broker to respond, there are a couple of questions I have that would help in clarifying the issue for me.

  • regarding the username/password in MQTT Config: I assume that these can be the same as a “user” defined in Home assistant as viable users or is this the user specifically setup for the MQTT broker?

  • In the documentation there are ambiguous statement regarding the location from /root of the acl.conf & accesscontrollist files. In the forum, mentions are referring to two possible directory locations (1) “/usr/share/hassio/share/mosquitto” where hassio/share/mosquitto don’t exist and would need to be created and (2) what you mention i.e “/share/mosquitto” which one could assume is “/usr/share/mosquitto”
    Could you clarify which one is it?

Thank you

Hi,

  1. I have a “Home Assistant user” with password: I have used this crential in configuration.yaml MQTT session and add-on config session.
  2. I access /share path from windows PC using Samba add-on on Hassio. You can also use Configuration add-on directly from UI web interface.

Bye

Hi Umberto, Thanks for your assistance. After 2.5 days trying to resolve the issue i eventually got it working.
Cheers

Your hint did it for me!
I’ve tried all the above and in the end, I needed to remove the “-” from my MQTT Topic.
I’ve used to use: “sonoff-cave-lamp” --> stopped working
now with “sonoffCaveLamp” all works fine again…

Thx m8!

Why oh why can’t i get anything above MQTT 4.0 to work I’ve wasted the last 5 nights trying to work it out… I’m getting nothing no partial connections when i try useing MQTT explorer app i can’t connect to the server ?? Downgrade 4.3 to 4.0 and everything works… ive even gone down the root of trying a fresh home assistant install to a spare micro SD card… and i still can’t get it to work

acl.conf

containing…

acl_file /share/mosquitto/accesscontrollist

accesscontrollist

containing…

user [HomeAuto]
topic readwrite #

location on pi…

MQTT SETTINGS, user name HomeAuto has user HomeAuto & Password matching what’s *** below… These are my MQTT settings i have used for the past year with no problems…

    {
      "logins": [
        {
          "username": "HomeAuto",
          "password": "***"
        }
      ],
      "anonymous": false,
      "quiet_logs": true,
      "customize": {
        "active": true,
        "folder": "mosquitto"
      },
      "certfile": "fullchain.pem",
      "keyfile": "privkey.pem"
    }

Log…

[INFO] Setup mosquitto configuration
[WARN] SSL not enabled - No valid certs found!
[INFO] Found local users inside config
[INFO] Initialize Hass.io Add-on services
[INFO] Initialize Home Assistant discovery
[INFO] Start Mosquitto daemon
1559855697: mosquitto version 1.5.6 starting
1559855697: Config loaded from /etc/mosquitto.conf.
1559855697: |-- *** auth-plug: startup
1559855697: Opening ipv4 listen socket on port 1883.
1559855697: Opening ipv6 listen socket on port 1883.
1559855697: Opening websockets listen socket on port 1884.
1559855697: Warning: Mosquitto should not be run as root/administrator.
1559855702: New connection from 192.168.86.42 on port 1883.
[INFO] found HomeAuto on local database
1559855703: Socket error on client <unknown>, disconnecting.
1559855703: New connection from 192.168.86.39 on port 1883.
1559855703: New connection from 192.168.86.31 on port 1883.
1559855703: New connection from 192.168.86.21 on port 1883.
[INFO] found HomeAuto on local database
1559855704: Socket error on client <unknown>, disconnecting.
[INFO] found HomeAuto on local database
1559855705: Socket error on client <unknown>, disconnecting.
[INFO] found HomeAuto on local database
1559855706: Socket error on client <unknown>, disconnecting.
1559855706: New connection from 192.168.86.30 on port 1883.
[INFO] found HomeAuto on local database
1559855707: Socket error on client <unknown>, disconnecting.
1559855707: New connection from 192.168.86.26 on port 1883.
1559855707: New connection from 192.168.86.28 on port 1883.
1559855707: New connection from 192.168.86.75 on port 1883.
1559855707: New connection from 192.168.86.78 on port 1883.
[INFO] found HomeAuto on local database
1559855708: Socket error on client <unknown>, disconnecting.
[INFO] found HomeAuto on local database
1559855709: Socket error on client <unknown>, disconnecting.
[INFO] found HomeAuto on local database
1559855710: Socket error on client <unknown>, disconnecting.
[INFO] found HomeAuto on local database
1559855711: Socket error on client <unknown>, disconnecting.
1559855711: New connection from 192.168.86.57 on port 1883.
[INFO] found HomeAuto on local database

on the new install when i try go through integrations to setup MQTT i get an error…

On my main home assistant install (the one that works perfectly with mosquitto 4.0) this is in my configuration.yaml

mqtt:
broker: core-mosquitto
discovery: true
protocol: 3.1
keepalive: 60
client_id: hass-1
username: HomeAuto
password: ***
birth_message:
topic: ‘hass/status’
payload: ‘online’
will_message:
topic: ‘hass/status’
payload: ‘offline’

my setup user names…

Add homeassistant to the accesscontrol list readwrite #

Also if HomeAuto is a ha user you don’t define it as a local user in the broker settings.

The square brackets look misplaced/misused.

My user name is not encapsulated as yours is.

Also the MQTT broker take a min. or two to quiet down after a restart. At least my broker does .

Thanks guys i think this has got me closer i think the brackets where a real school boy error :smile: but it still isn’t workinging and again MQTT Explorer (app) isn’t connecting to it and all my lights are unavailable

user HomeAuto
topic readwrite #
user homeassistant
topic readwrite #

{
“logins”: ,
“anonymous”: false,
“quiet_logs”: true,
“customize”: {
“active”: true,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

mqtt log

[INFO] Setup mosquitto configuration
[INFO] No local user available
[INFO] Initialize Hass.io Add-on services
[INFO] Initialize Home Assistant discovery
[INFO] Start Mosquitto daemon
1559887966: mosquitto version 1.5.6 starting
1559887966: Config loaded from /etc/mosquitto.conf.
1559887966: |-- *** auth-plug: startup
1559887966: Opening ipv4 listen socket on port 1883.
1559887966: Opening ipv6 listen socket on port 1883.
1559887966: Opening websockets listen socket on port 1884.
1559887966: Opening ipv4 listen socket on port 8883.
1559887966: Opening ipv6 listen socket on port 8883.
1559887966: Opening websockets listen socket on port 8884.
1559887966: Warning: Mosquitto should not be run as root/administrator.
1559887967: New connection from 172.30.32.1 on port 1883.
1559887968: New connection from 192.168.86.75 on port 1883.
[INFO] found HomeAuto on Home Assistant
1559887970: New client connected from 192.168.86.75 as DVES_CD9209 (c1, k10, u'HomeAuto').
1559887970: New connection from 192.168.86.21 on port 1883.
1559887970: New connection from 192.168.86.42 on port 1883.
1559887970: New connection from 172.30.32.1 on port 1883.
1559887970: New connection from 192.168.86.78 on port 1883.
1559887970: Socket error on client <unknown>, disconnecting.
[INFO] found HomeAuto on Home Assistant
1559887972: New client connected from 192.168.86.21 as DVES_A7CC54 (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559887974: New client connected from 192.168.86.42 as DVES_4E7BBE (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559887976: New client connected from 172.30.32.1 as hass-1 (c1, k60, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559887978: New client connected from 192.168.86.78 as DVES_24AA9F (c1, k10, u'HomeAuto').
1559887978: New connection from 192.168.86.56 on port 1883.
1559887978: New connection from 192.168.86.67 on port 1883.
1559887978: New connection from 192.168.86.43 on port 1883.
1559887978: New connection from 192.168.86.83 on port 1883.
1559887978: New connection from 192.168.86.38 on port 1883.
1559887978: New connection from 192.168.86.85 on port 1883.
1559887978: New connection from 192.168.86.46 on port 1883.
1559887978: New connection from 192.168.86.44 on port 1883.
1559887978: New connection from 192.168.86.31 on port 1883.
1559887978: New connection from 192.168.86.80 on port 1883.
1559887978: New connection from 192.168.86.37 on port 1883.
1559887978: New connection from 192.168.86.26 on port 1883.
1559887978: New connection from 192.168.86.39 on port 1883.
1559887978: New connection from 192.168.86.69 on port 1883.
1559887978: New connection from 192.168.86.64 on port 1883.
1559887978: New connection from 192.168.86.250 on port 1883.
1559887978: New connection from 192.168.86.28 on port 1883.
1559887978: New connection from 192.168.86.57 on port 1883.
[INFO] found HomeAuto on Home Assistant
1559888002: New client connected from 192.168.86.26 as DVES_45421D (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888004: New client connected from 192.168.86.39 as DVES_9233A1 (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888006: New client connected from 192.168.86.69 as DVES_CD948C (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888008: New client connected from 192.168.86.64 as DVES_0F4B61 (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888010: New client connected from 192.168.86.250 as DVES_A71B19 (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888012: New client connected from 192.168.86.28 as DVES_454FF1 (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888015: New client connected from 192.168.86.57 as DVES_1852BA (c1, k10, u'HomeAuto').
1559888015: Client DVES_CD9209 has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_CD9209, disconnecting.
1559888015: Client DVES_A7CC54 has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_A7CC54, disconnecting.
1559888015: Client DVES_4E7BBE has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_4E7BBE, disconnecting.
1559888015: Client DVES_24AA9F has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_24AA9F, disconnecting.
1559888015: Client DVES_9B8AA0 has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_9B8AA0, disconnecting.
1559888015: Client DVES_7E2A11 has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_7E2A11, disconnecting.
1559888015: Client DVES_44F92B has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_44F92B, disconnecting.
1559888015: Client DVES_44F928 has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_44F928, disconnecting.
1559888015: Client DVES_97402E has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_97402E, disconnecting.
1559888015: Client DVES_934818 has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_934818, disconnecting.
1559888015: Client DVES_A719C3 has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_A719C3, disconnecting.
1559888015: Client DVES_98997D has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_98997D, disconnecting.
1559888015: Client DVES_AC8640 has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_AC8640, disconnecting.
1559888015: Client DVES_A2FA0B has exceeded timeout, disconnecting.
1559888015: Socket error on client DVES_A2FA0B, disconnecting.
1559888015: Socket error on client DVES_CD4ABE, disconnecting.
1559888015: Socket error on client DVES_45421D, disconnecting.
1559888015: Socket error on client DVES_9233A1, disconnecting.
1559888015: Socket error on client DVES_CD948C, disconnecting.
1559888015: Socket error on client DVES_0F4B61, disconnecting.
1559888015: Socket error on client DVES_A71B19, disconnecting.
1559888015: Socket error on client DVES_454FF1, disconnecting.
1559888015: Socket error on client DVES_1852BA, disconnecting.
1559888015: New connection from 192.168.86.62 on port 1883.
1559888015: New connection from 192.168.86.60 on port 1883.
1559888015: New connection from 192.168.86.59 on port 1883.
1559888015: New connection from 192.168.86.50 on port 1883.
1559888015: New connection from 192.168.86.30 on port 1883.
1559888015: New connection from 192.168.86.61 on port 1883.
1559888015: New connection from 192.168.86.34 on port 1883.
1559888015: New connection from 192.168.86.41 on port 1883.
1559888015: New connection from 192.168.86.63 on port 1883.
1559888015: New connection from 192.168.86.89 on port 1883.
1559888015: New connection from 192.168.86.75 on port 1883.
1559888015: New connection from 192.168.86.21 on port 1883.
1559888015: New connection from 192.168.86.42 on port 1883.
1559888015: New connection from 192.168.86.38 on port 1883.
1559888015: New connection from 192.168.86.83 on port 1883.
1559888015: New connection from 192.168.86.85 on port 1883.
1559888015: New connection from 192.168.86.46 on port 1883.
1559888015: New connection from 192.168.86.44 on port 1883.
1559888015: New connection from 192.168.86.31 on port 1883.
1559888015: New connection from 192.168.86.80 on port 1883.
1559888015: New connection from 192.168.86.78 on port 1883.
1559888015: New connection from 192.168.86.37 on port 1883.
1559888015: New connection from 192.168.86.69 on port 1883.
1559888015: New connection from 192.168.86.64 on port 1883.
1559888015: New connection from 192.168.86.39 on port 1883.
1559888015: New connection from 192.168.86.26 on port 1883.
1559888015: New connection from 192.168.86.56 on port 1883.
1559888015: New connection from 192.168.86.250 on port 1883.
1559888015: New connection from 192.168.86.28 on port 1883.
1559888015: New connection from 192.168.86.57 on port 1883.
1559888015: New connection from 192.168.86.67 on port 1883.
1559888015: New connection from 192.168.86.62 on port 1883.
1559888015: New connection from 192.168.86.43 on port 1883.
1559888015: New connection from 192.168.86.60 on port 1883.
1559888015: New connection from 192.168.86.59 on port 1883.
1559888015: New connection from 192.168.86.50 on port 1883.
1559888015: New connection from 192.168.86.30 on port 1883.
1559888015: New connection from 192.168.86.61 on port 1883.
1559888015: New connection from 192.168.86.34 on port 1883.
1559888015: New connection from 192.168.86.41 on port 1883.
1559888015: New connection from 192.168.86.63 on port 1883.
1559888015: New connection from 192.168.86.89 on port 1883.
[INFO] found HomeAuto on Home Assistant
1559888017: New client connected from 192.168.86.62 as DVES_9D15B9 (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888019: New client connected from 192.168.86.60 as DVES_9AF471 (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888021: New client connected from 192.168.86.59 as DVES_A7466F (c1, k10, u'HomeAuto').
[INFO] found HomeAuto on Home Assistant
1559888022: New client connected from 192.168.86.50 as DVES_489F9D (c1, k10, u'HomeAuto').

im back to trying this on my main original home assistant install here are my users…

i did have a user name : chris and then user HomeAuto and my password

i changed this for user name HomeAuto user HomeAuto and my password