question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MQTT connection fails until robot is rebooted

See original GitHub issue

Describe the bug

From time to time, Valetudo is not able to reconnect to MQTT broker after losing the connection, unless the robot is manually rebooted.

To Reproduce

Cannot be reproduced, happens randomly.

Screenshots

Logs

2021-12-09T03:26:49.230Z
Info
MQTT configured
2021-12-09T11:41:49.850Z
Info
Connection to MQTT broker closed
2021-12-09T11:41:50.850Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:42:02.049Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:42:13.495Z
Info
Connected successfully to MQTT broker
2021-12-09T11:44:14.639Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:44:17.692Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:44:20.764Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:44:23.836Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:44:26.908Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:44:29.980Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:44:30.082Z
Info
Connected successfully to MQTT broker
2021-12-09T11:44:30.341Z
Info
MQTT configured
2021-12-09T11:48:47.426Z
Error
MQTT error: Error: read ECONNRESET
2021-12-09T11:48:48.428Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:50:58.745Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:01.820Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:04.892Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:07.964Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:11.036Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:14.108Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:17.180Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:20.252Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:23.324Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:26.396Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:29.468Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:32.540Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:35.612Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:38.684Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:41.756Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:44.828Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:47.900Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:50.972Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:51:54.044Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:52:25.047Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:52:36.412Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:52:40.476Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:52:43.547Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:52:46.620Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:53:06.108Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:53:10.212Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:53:13.244Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:53:16.316Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:53:19.388Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:53:22.460Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:53:24.157Z
Info
Connected successfully to MQTT broker
2021-12-09T11:53:24.266Z
Info
MQTT configured
2021-12-09T11:55:45.123Z
Error
MQTT error: Error: read ECONNRESET
2021-12-09T11:55:46.124Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T11:55:46.810Z
Info
Connected successfully to MQTT broker
2021-12-09T11:55:46.896Z
Info
MQTT configured
2021-12-09T11:55:47.634Z
Info
MQTT configured
2021-12-09T12:20:58.799Z
Error
MQTT error: Error: read ECONNRESET
2021-12-09T12:20:58.812Z
Info
Connection to MQTT broker closed
2021-12-09T12:20:59.813Z
Info
Attempting to reconnect to MQTT broker
2021-12-09T12:21:01.424Z
Info
Disconnecting from the MQTT Broker...
2021-12-09T15:55:41.365Z
Info
Disconnecting from the MQTT Broker...
2021-12-09T15:55:45.240Z
Info
Disconnecting from the MQTT Broker...
2021-12-09T17:01:59.323Z
Info
Disconnecting from the MQTT Broker...
2021-12-09T17:03:17.949Z
Info
Disconnecting from the MQTT Broker...

Vacuum Model

Roborock S5 and Dreame Z10 Pro

Valetudo Version

2021.12.0, but also happenend on every earlier version since approx 5 months

Expected behavior

After losing connection to the MQTT broker, the device should properly reconnect.

Additional context

After some days of everything working fine, suddenly the robot loses connection to MQTT and is not able to reconnect, until I manually reboot it via power button. The network connection is fine and the issue appears when the robot is in it’s dock. Valetudo web interface can still be accessed and the device is fully functional. Only MQTT does not work anymore. Disabling and re-enabling MQTT does not solve the issue, only a reboot of the robot. Rebooting my MQTT server does also not help, and other MQTT devices keep on working, so it is definitely nothing with my MQTT server.

The issue faces also on both of my robots, but randomly and not at the same time. It happens approx. 1 - 2 times a week / per robot.

According to the log, it looks like, that after some connection retries, it keeps stuck in “Disconnecting from the MQTT Broker…”.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:35 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
Hypfercommented, Dec 29, 2021

42a5613d19cd46bba0e5243f656d062f8a4d4415

This commit fixes another issue with the mqtt interface that also led to it being stuck forever.

2reactions
Apocrathiacommented, Dec 19, 2021

I am also having this issue with the Dreame Z10 Pro that I just got yesterday to replace my Roborock S5 (which never had this issue). It would appear that it went dark around 0500 MST and didn’t come back up until I rebooted the unit over SSH. I’ve set the logging level to debug (The log viewer in 2021.12.1 was a great addition), and will report back once I see it happen again.

The following screenshot is from my Home Assistant instance where the device is connected via MQTT

While I understand that Hypfer (Not tagging them so they don’t get pinged) hasn’t experienced this issue, it’s clear that a subset of users are. Therefore, it will be on the community to troubleshoot this issue. So far, this issue has been reported with the following vacuums:

  • Roborock S5
  • Dreame Z10 Pro
  • Viomi v7
Read more comments on GitHub >

github_iconTop Results From Across the Web

MQTT connection to broker not restored after power loss
Hello, the problem is that the devices that are connected with mqtt are unavailable after restarting when power goes out in my house....
Read more >
Subscribe to get messages not working in Robot framework ...
In your I Publish an MQTT request you do a connect so that succeeds, but then you do a disconnect as well so...
Read more >
Cron is not starting my python MQTT script correctly
I'm trying to start a script at reboot that reads my BME680 and sends the data to an MQTT broker. The script runs...
Read more >
Paho MQTT 5 - Apache Camel
Communicate with MQTT message brokers using Eclipse Paho MQTT v5 Client. ... client will wait until the network connection is made successfully or...
Read more >
Tutorials - Rhasspy - Read the Docs
Once you click "Save Settings", Rhasspy will restart and try to connect to your MQTT broker. This will fail if you are running...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found