Mosquitto MQTT 4.1 doesnt work after update

did you try this method…?

I did, yes.
I still get a ton of errors/warnings in my log.
But everything seems to work ok.

your welcome

For what?

It was working before and always has been. I just get hundreds of log messages as my previous conversation in this post this morning with @DavidFW1960 shows.

(yeah, @DavidFW1960, before you say, it was evening for you :slight_smile: )

1 Like

Was the 4.1 MQTT broker removed from the updates?

I just spun up a VM install HassIo (supervisor Version 150, System: HassOS 2.11) to test some things with Ver. 4.1 MQTT. However I see no Ver. 4.1 from that system. Only Ver. 4 is available.

I have the 4.1 MQTT broker installed on my production system. Its working ok.
wierd.

Hi all. I had the v4.1 horrors too. The solution for me was a thermo nuclear one. Had to start a new install from scratch. My best guess is that there are some sort of remnants/artifacts in an existing installation that make upgrading to v4.1 haphazard. I really think it has a lot to do with what your pre-4.1 setup was. Whether you had a manual MQTT setup in configuration.yaml, whether you had a MQTT setup via discovery, whether you had Home Assistant user, whether you had Local Users, etc.
This was my bad start point…

This was my way to happiness…

Clearly there are so many users complaining about one setup working for them, then not for others that try and follow the same steps. I believe my process follows the official docs/instructions accurately and delivers a stable working Mosquitto broker v4.1. Good luck!

Hello guys,

I ran into problems after updating to Mosquitto 4.1, but after hours of debugging I finally got it to work ! I´m using the MQTT broker with zigbee2mqtt to communicate with my xiaomi sensors.

The zigbee2mqtt addon is getting values from my sensors, no error:

zigbee2mqtt:info 3/24/2019, 2:11:59 PM MQTT publish: topic ‘zigbee2mqtt/0x00158d0002e98c12’, payload ‘{“temperature”:19.35,“linkquality”:84,“humidity”:41.39,“pressure”:1016,“battery”:86,“voltage”:2975}’

… The same with the mosquitto addon, no error.

1553436204: New connection from 192.168.XXX.XXX on port 1883.
1553436204: |-- mosquitto_auth_unpwd_check(rod)
1553436204: |-- ** checking backend http
1553436204: |-- url=http://127.0.0.1:8080/login
1553436204: |-- data=username=rod&password=secret!&topic=&acc=-1&clientid=
[INFO] found rod on local database
1553436205: New client connected from 192.168.XXX.XXX as be7a1bd9-e114-4c80-b2a6-97f3836c95bb (c1, k60, u’rod’).
1553436205: |-- getuser(rod) AUTHENTICATED=1 by http

I´m not able to add the sensors to the integration, it´s always empty !
In the “integration” I´m using the same username/password as for the mosquitto broker; I created a new user in the “Users” section.

When I click the MQTT config in the “integrations” tab I always get:
" This integration has no devices. "

All this was working with HA 0.86 and older versions of mosq and zigbee2mqtt

Do you have any idea how to integrate the sensors ?? I´m using HA 0.90.1, mosquitto 4.1 and zigbee2mqtt 1.2.1.

Hi. Welcome to the forum! What does your full mqtt log look like? Is it stable, ie. After it does its start up and registers your clients - does it settle down and stop broadcasting messages? Ideally getting to a stage where it says something like…
1553507143: Saving in-memory database to /data/mosquitto.db.
Or does it go on and on and on, with the same clients connecting then disconnecting over and over? If the latter, you don’t seem to have v4.1 running in a stable manner. More debugging…

Hi and thanks for the reply. I restarted the MQTT last nigth, this log is for 10 hours:

[INFO] Setup mosquitto configuration [INFO] Found local users inside config [INFO] Initialize Hass.io Add-on services [INFO] Initialize Home Assistant discovery [INFO] Start Mosquitto daemon 1553472824: mosquitto version 1.5.6 starting 1553472824: Config loaded from /etc/mosquitto.conf. 1553472824: |-- *** auth-plug: startup 1553472824: |-- ** Configured order: http 1553472824: |-- with_tls=false 1553472824: |-- getuser_uri=/login 1553472824: |-- superuser_uri=/superuser 1553472824: |-- aclcheck_uri=/acl 1553472824: |-- getuser_params=(null) 1553472824: |-- superuser_params=(null) 1553472824: |-- aclcheck_params=(null) 1553472824: |-- retry_count=3 1553472824: Opening ipv4 listen socket on port 1883. 1553472824: Opening ipv6 listen socket on port 1883. 1553472824: Opening websockets listen socket on port 1884. 1553472824: Opening ipv4 listen socket on port 8883. 1553472824: Opening ipv6 listen socket on port 8883. 1553472824: Opening websockets listen socket on port 8884. 1553472824: Warning: Mosquitto should not be run as root/administrator. 1553472825: New connection from 172.30.32.1 on port 1883. 1553472825: New client connected from 172.30.32.1 as mqttjs_e702c387 (c1, k60). 1553472827: New connection from 192.168.108.202 on port 1883. 1553472828: Socket error on client <unknown>, disconnecting. 1553472828: New connection from 192.168.108.202 on port 1883. 1553472828: |-- mosquitto_auth_unpwd_check(rod) 1553472828: |-- ** checking backend http 1553472828: |-- url=http://127.0.0.1:8080/login 1553472828: |-- data=username=rod&password=XXX&topic=&acc=-1&clientid= [INFO] found rod on local database 1553472829: |-- getuser(rod) AUTHENTICATED=1 by http 1553472829: New client connected from 192.168.108.202 as 784d5d1c-e924-4f8b-936c-a51920f3d682 (c1, k60, u’rod’). 1553474624: Saving in-memory database to /data/mosquitto.db. 1553476425: Saving in-memory database to /data/mosquitto.db. 1553478226: Saving in-memory database to /data/mosquitto.db. 1553480027: Saving in-memory database to /data/mosquitto.db. 1553481828: Saving in-memory database to /data/mosquitto.db. 1553483629: Saving in-memory database to /data/mosquitto.db. 1553485430: Saving in-memory database to /data/mosquitto.db. 1553487231: Saving in-memory database to /data/mosquitto.db. 1553489032: Saving in-memory database to /data/mosquitto.db. 1553490833: Saving in-memory database to /data/mosquitto.db. 1553492634: Saving in-memory database to /data/mosquitto.db. 1553494435: Saving in-memory database to /data/mosquitto.db. 1553496236: Saving in-memory database to /data/mosquitto.db. 1553498037: Saving in-memory database to /data/mosquitto.db. 1553499838: Saving in-memory database to /data/mosquitto.db. 1553501639: Saving in-memory database to /data/mosquitto.db. 1553503440: Saving in-memory database to /data/mosquitto.db. 1553505241: Saving in-memory database to /data/mosquitto.db. 1553507042: Saving in-memory database to /data/mosquitto.db. 1553508843: Saving in-memory database to /data/mosquitto.db.

What kinda file should the accesscontrollist be? should this be an .txt file? (with or without the extension?)
I mean the file where I should put: topic readwrite #

Just a txt file with no filename extension. I’m always worried about file permissions, so copy an existing .yaml or .conf file from my config folder, wipe the contents, edit and rename as required.

Thanks for your reply Milster,

I get this in the logs, should this be a problem?

1553543944: Warning: Mosquitto should not be run as root/administrator.

I have solved with this configuration:
Home assistant v. 0.90.1
MQTT broker v. 4.1
zigbee2mqtt v 1.2.1

On home assistant i have created another user with administrator priviliges. (on home assistant → settings → User)
On mosquito borker i use this config:

{
“logins”: [
{
“username”: “user”,
“password”: “pass”
}
],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

On zigbee2mqtt i have use this config:

{
  "data_path": "/share/zigbee2mqtt",
  "homeassistant": true,
  "permit_join": true,
  "mqtt_base_topic": "zigbee2mqtt",
  "mqtt_server": "mqtt://homeassistant",
  "serial_port": "/dev/ttyACM0",
  "devices": [],
  "network_key": [],
  "mqtt_user": "user",
  "mqtt_pass": "pass"
}

User and pass used on the 2 config are the same created on home assistant → settings → Users

I created the files in the “Configurator” enviroment. I wasn´t able to create a file without extension in MAC…

YES !! It worked ciccio88it :slight_smile: Thanks a lot ! I´ve used many hours trying to get this working again after update !

I’m glad it works! :mega:
Don’t tell me. I have tried every combinations of false, true, accesscontrollist. I have also reinstalled the system several times. :ok_man:

Maybe, maybe not. @rdavidsson had that in his log also, but later with some help got things going.

Out of curiosity, is your broker integrated by Discovery or by configuration.yaml ? And by “reinstalled” - you started from scratch with new SD or new VM drive?

In the configuration.yaml of home assistant, under “discover:” i have insert:

mqtt:
discovery: true

after, on setting → integrations i have configured manualy the mqtt integration, added ip user and password.

I have tried to restore many time from snapshots, but I believe that because of self-updates of add ons, the problem reappears. From last i have used VM drive, and now i stay on VM. it is much faster than the raspberry pi 2! :smile:

This is how the configuration.yaml is:

mqtt:
discovery: true
broker: 192.168.108.202 # Remove if you want to use builtin-in MQTT broker
username: XX
password: XX
birth_message:
topic: ‘hass/status’
payload: ‘online’
will_message:
topic: ‘hass/status’
payload: ‘offline’

I saw this in the guide from zigbee2mqtt at Github. In the old setup only had discovery: true like ciccio88it has it.