Mosquitto MQTT 4.1 doesnt work after update

@david
active:false

image

Why is port forwarding an issue? It’s all local network…
Yes I use a reverse proxy (caddy)

Isn’t 8080 a SABNZBD port? What else do you have running?

look at the logging… 127.0.0.1: 8080
Everyone has this in their logging they report. It’s the local account trying to verify the users… 127.0.0.1 (home) is trying to confirm the username on port 8080…

eventually it fails out and disconnects. It later tries and disconnects.
What do you have for port settings?
Is yours working fine?
What addons do you have installed that I don’t?
I’ve got basically, SAMBA, SSH, NGINX, DuckDNS, MQTT, CONFIGURATOR.

yes, port 8080 is generally a pretty basic port:

Port 8080 is an alternative to port 80 and is used primarily for http traffic. … Port 8080 is commonly used as proxy and caching port . It is also above the service port range. Port 8080 also can run a Web server as a nonroot user. Other assignments for port 8080 include Apache Tomcat, an M2MLogger and a Web GUI.

I have those except nginx and duckdns and a bunch of others. Yours is Hassio right? With the Mosquitto broker addon? HassOS?

So 8080 is sab- I have that running on same machine as HA and there’s no conflict.

Actually I have that in my log as well… how odd. No idea why it has that.

I have others installed too… I installed NODERED and TASMOADMIN recently, but my problems were before they were installed, that’s why i didn’t include them.

How are you accessing your system outside of your home network? Letsencrypt?
Home webhosting?
I installed HASSIO.
What do you mean “sab”? NZB sites? So, a basic port ID? Do you have 8080 >> 8123?

YES, you do!! have that in your log, which is why i was wondering if you were still having issues, do you?
You have that 8080 trying to authenticate using the MQTT device usernames… and passwords, not sure if yours fails like mine does

Your answer has me worried you haven’t made any Snapshots. HA has a backup and recovery system called SNAPSHOTS. You create and restore them from within HA (or SSH commands). It’s located on the next tab along from your Hass.io DASHBOARD. ie. where your installed ADDONS are listed.

@Milster
lol, yes, I have snapshots created on my other SD card. I’ve already rolled back using snapshots before. I’m on a bigger SD card now. Snapshots are just pointers to old storage LBA’s. LBA stands for Logical block address. SD cards don’t actually have LBA’s, they’re saved in pages and pools… I work for Dell in storage, if you don’t understand snapshots, you wouldn’t understand how a snapshot could be physically transported from one SD (or Hard drive) onto another storage platform. If HA makes “backups” and calls them “snapshots”… they’re not really snapshots, they’re backup copies… RAID is not a backup, just like, snapshots are not a backup… I understand the concept. HA dev’s may not be labeling things correctly, that’s fine. I’m okay with that, technically speaking… snapshots aren’t something that can be copied from one platform to another…

I use Caddy… I do have duckdns but not via the addon… I’m on a IPv6 address that doesn’t change and my IPv4 address is static as well… they are configured at duckdns but don’t change.

I have my home assstant NUC port 443 open (on IPv6) Actually my HA can only be reached via IPv6 as it doesn’t have an IPv4 address on that domain. (I have the IPv4 address on a different domain and on that one, a high port is forwarded to 443 as well). I have 80 open as well so I can get LetsEncrypt certificates renewed. (Opened, not forwarded)

No other ports opened or forwarded.

I have that in the mosquitto log but nothing at all fails. No errors at all.

your MQTT logs don’t show like mine do?
you hushed them by adding the acl’s?
“hushing” would insinuate that the problem still exists but you just found a way to silence the logs/alerts… how’d you fix the issue? ACL? I have that setup too??? I think we’re beginning to see the differences from your setup and mine, but I’m not really sure how they differ so much that I can’t recognize the issue I have that’s causing issue

I’m not hushing them- I have acl working. I also have no local users - just one user defined in home assistant and used for all my devices.

But when I had active false it also worked without acl although there were log messages about it it worked perfectly.

ACL in fact would not work until I added a homeassistant user as I showed up above. I only have 4 lines in my accesscontrolfile as shown.

I really wish I had a better understanding of this but no one seems to know and just like us everyone is guessing.

When 4.1 came out, I didn’t change a thing from 4. I also use MQTT discovery and have no manual MQTT anywhere and no manually defined devices. Everything works 100%. I was also publishing a json string to MQTT using mosquitto_pub and the same user and it all worked as well.

1 Like

I have everything set as per official instructions and now none of my mqtt sensors show up under states…?

i deleted mofficial mosquito integration and addon and swapped to this one and all is working fine.

I uninstalled Mosquitto and tried this one, I can connect which is more than Mosquitto would allow but get socket errors when trying to do a test publish from the web UI. I click connect on the web interface and get a green connection indicator but when I do a test publish it disconnects?
Also my mqtt sensors still dont show up under states?

I have this in configuration.yaml

  - platform: mqtt
    state_topic: "homeassistant/indoor/temp"
    name: 'Indoor Temp'
    unit_of_measurement: "C"

I have this is ’ MQTT Server & Web client’ Config:

{
  "log_level": "info",
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "web": {
    "enabled": true,
    "ssl": false
  },
  "broker": {
    "enabled": true,
    "enable_ws": true,
    "enable_mqtt": true,
    "enable_ws_ssl": false,
    "enable_mqtt_ssl": false,
    "allow_anonymous": true
  },
  "mqttusers": [
    {
      "username": "fred",
      "password": "fred",
      "readonly": false,
      "topics": [
        "#homeassistant/indoor/temp"
      ]
    }
  ]
}

Log Error:

1554072209: New client connected from 192.168.1.8 as home-assistant (c1, k60, u’fred’).
1554072213: Socket error on client home-assistant, disconnecting.

UI Screenshot:

Any ideas appreciated…

No suggestions sorry! My Matt switches keep going unavailable which is kind of annoying. Will need to swap back to official mosquito add-on but doubt it will work.

Keep getting socket errors and disconnections but client ID’s are all unique

This is crazy! Surely someone out there has MQTT working?
Any developers care to jump in, Im at the point where I happy to pay for this to be sorted

Are you using Tasmota? Which firmware version/core version?

Yes, very 6.4.1

6.4.1 is probably core 2.4.2 which is the cause of your problems. Upgrade to 6.5.0 based on core 2.3.0 and most of your problems will go away.

I managed to fix my issues by purging all retain messages and swapping to tasmota 6.5.0.

No socket errors or disconnections :ok_hand:.

I followed @DavidFW1960 advice on another topic to purge MQTT messages but I can’t find it now sorry

(The advice was probably to ) Use MQTT Explorer. Get it here, GitHub - thomasnordquist/MQTT-Explorer: An all-round MQTT client that provides a structured topic overview