MQTT does not work after 0.50.1 update

I having problems with my MQTT embedded broker it was working fine on 0.49 and now its stopped on 0.50.1.

I have client_id: 1234 which i had to put in after 0.48 update.

Any Help

I also had some issues when I upgraded from 0.47.1 to 0.50.1.

For me it was the username that had changed. Before all my MQTT devices used ‘hass’ as username, but now it suddenly was ‘homeassistant’. I didn’t have any configuration that said it should be ‘hass’ or ‘homeassistant’.

Is it the broker that fails? Do you have any errors in the log or from your MQTT devices? I think we need some more information.

Same problem here. I had to update the client_id in 0.49 to get mqtt working and now my mqtt devices have stopped working with the 50.1 update.

I tried to add in a user name but still problems.

2017-07-31 06:21:23 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 235, in _step
    result = coro.send(value)
  File "/srv/hass/lib/python3.4/site-packages/hbmqtt/broker.py", line 336, in stream_connected
    yield from self.client_connected(listener_name, StreamReaderAdapter(reader), StreamWriterAdapter(writer))
  File "/srv/hass/lib/python3.4/site-packages/hbmqtt/broker.py", line 389, in client_connected
    yield from writer.close()
  File "/srv/hass/lib/python3.4/site-packages/hbmqtt/adapters.py", line 172, in close
    yield from self._writer.drain()
  File "/usr/lib/python3.4/asyncio/streams.py", line 299, in drain
    yield from self._protocol._drain_helper()
  File "/usr/lib/python3.4/asyncio/streams.py", line 190, in _drain_helper
    raise ConnectionResetError('Connection lost')
ConnectionResetError: Connection lost

I think its the broker.

The same problem after upgrading to 0.50.1, now I’m in the dark …
I can’t raise the blinds or turn on the lights … :frowning:

0.50.1? I can only find 0.50.

I’ve also had problem while upgrading to 0.50, I’m running under docker and had to add:

RUN pip3 install --upgrade paho-mqtt

to my Dockerfile (never had a problem with paho dependencies not being automatically installed before, only occurred with 0.50).

I know it’s not really a final solution but try using an external mqtt broker, you can then send message manually to the broker the next time it happens.

Or run you hass in docker container, so you can always restart an older version if the update render your install unusable.

I had no issue with Mosquitto what so ever since my first install of HASS 0.45. I did normal installation, no All in one, no docker, no hassbian… so to me, its seems like the most reliable way to install HASS…
But maybe I am just lucky and next time it all will blow to my face LOL

1 Like

I also don’t use the embedded mqtt broker, I had problem with hass acting as an mqtt client.

Can’t you downgrade? I always sync my config with GIT then run the upgrade procedure (Ubuntu in a virtual env, so via pip3). If HA doesn’t work after an upgrade it is really annoying, and HA has a lot of bug fix releases a day after the release (which is on a Saturday, so upgrading on Sunday before a fix brings the system down), so making sure you can downgrade is important.

It Looks like I have no mqtt working . Not sure if this is right ?

root@RPi3:/home/pi# sudo netstat -nlp | grep 1883
tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN      32645/python3

I downgraded HA version from 0.50.1 to 0.49.1 and seems the same.

2017-07-31 15:41:47 WARNING (MainThread) [hbmqtt.broker] [MQTT-3.1.0-1] (client @=xxx.xxx.xxx.xxx:59818): Can't read first packet an CONNECT: [MQTT-3.1.2-1] Incorrect protocol name: "MQIsdp"

Well I went the easy route.

Super Thanks to @bruhautomation

How-To Get Started with Mosquitto MQTT Broker on a Raspberry Pi

All working great again…

Can confirm! I followed his tutorial as well and haven’t had any issue since 0.45!

Thanks!! Changed from hbmqtt embedded default broker to mosquitto and it’s working!!!

# INSTALL MOSQUITTO:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mosquitto
sudo apt-get install mosquitto-clients

# CONFIGURATION:YAML:
mqtt:
  broker: 192.168.0.161
  port: 1883
  client_id: mosquitto
  keepalive: 60
  # If do the optional steps below:
  username: homeassistant
  password: Aa06121974

# OPTIONAL STEPS:
sudo nano /etc/mosquitto/mosquitto.conf
password_file /etc/mosquitto/pwfile
 listener 1883
sudo mosquitto_passwd -c /etc/mosquitto/pwfile username
1 Like

@IvanXXL Great. Glad you got it working its not nice when you update to get the latest and newest versions and it breaks the things you have working already. :man_dancing:

Typically if that happens I’ll blow away the install and re-install as it means a dependency didn’t update properly. I’m still running the embedded broker and I haven’t had any problems yet, but we’ll see.

I ended up installing mosquitto and using that as the MQTT broker. All my devices are working again, except for one. I’m not sure why it’s failing to communicate yet.

What error throws?

Lucky man!! Installed Mosquitto and upgraded to 0.50.1 and no more problems.