Valetudo: MQTT connection fails until robot is rebooted
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…”.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 35 (12 by maintainers)
42a5613d19cd46bba0e5243f656d062f8a4d4415
This commit fixes another issue with the mqtt interface that also led to it being stuck forever.
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.
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:
Okay, then I will close this issue, as it seems to not meet these criteria. Thank you for your time.
I have the same problem with my Roborock S5 as well.
Please re-read this comment. If you still have questions, re-read it again until there are no more questions. https://github.com/Hypfer/Valetudo/issues/1270#issuecomment-997337801
@Hypfer I have a similar problem with a Roborock S5 (from 2018). I’m using valetudo (2021.12.0) with Home Assistant (2021.11.05) and its Mosquitto broker addon.
It takes only hours before the connection between HA and Valetudo breaks and I can’t control it from HA anymore, Valetudo works.I had this setup for a long time and it worked great but I’m using valetudo only for some months now.
I can’t find anything obvious in the logs. Valetudo (or the S5) seem to restart each night at 3:00.
How can I help to debug?
ced9ee1b3312489c0c937723ba8744c21264f540 might fix this.
It is however still recommended to fix the network if
ECONNRESET
is a daily occurence.