Trouble reconnecting to MQTT after resuming from sleep
Hi! I'm having an issue with Hass.Agent 2.0.1 where everytime the computer resumes from sleep there's a problem reconnecting to the MQTT server. All other connections seem to work fine, but MQTT keeps saying "Connecting.." for about 60 seconds, then fails and subsequently reconnects immediately. Is there anything that can be done about this? Let me know if there are logs or other info I can provide to narrow down the cause.
Solution:Jump to solution
GitHub
Bug: Reconnecting MQTT not working properly · Issue #35 · hass-agen...
Please make sure that the issue you're planning to report is not already registered :) Describe the bug Ever when the device wakes up, MQTT only reconnects after the grace period of 2 mins. To ...
15 Replies
Help us Help Others!
To help others find answers, you can mark your question as solved via
Right click solution message -> Apps -> ✅ Mark Solution
Help us Help You!
Please don't delete messages or posts because it makes it impossible to understand what happened. If you don't want your messages to be seen then don't post here.
Please provide us with the version number of your client.
You can find it in the HA device info page after 'Firmware'.Make sure to provide detailed reports of bugs.
Please include error log uploads and info about the bug.
@Amadeo
As this message says, we need the version number
As for logs, there should be a tab in the config page for you to open the logs folder, just upload the most recent one here
By client I assume you mean HASS.agent? Like I said the version I'm using is 2.0.1, but I tried the 2.0.2 beta as well, and it had the same issue.
My most recent log is attached. (Did some sensoring of personal data, but that shouldn't matter.)
Yep, thanks for that. I'll change the wording of it for non-developers 😂 just realised client doesn't make sense to a lot of people.
Are going to send it? Or have you already?
Thankyou
Do you have a timestamp? Seeing as it's 35kb of raw text?
22:15 ish?
Yes, that's around the time the resume happens. Can't say I understand much of what happens after that. 🙂
All good
Nvm, tried to get a snippet but mobile sucks 😂
Afaict from 2:14ish onwards it spits out 3 or more ftl errors. Which are maybe fine but mqtt reports as failed after those stack traces tho.
@MeatBoy how much of a problem is this? Can you get by? Or is it almost unusable. Due to timezone stuffs and other annoying things Amadeo probs won't get this sorted soon. So if it's stopping you from using it we can try to get a temporary type fix.
By temporary I'm thinking like set a system event to restart hass.agent whenever it wakes from sleep. So it's quite drastic.
---
@MeatBoy actually, are you using hibernate?
No worries, the issue is stopping some of my automations from working like intended, but it's nothing important. If you guys have a look at it when you get the chance, that's awesome. And no, I'm not using hibernate, just normal sleep.
Solution
GitHub
Bug: Reconnecting MQTT not working properly · Issue #35 · hass-agen...
Please make sure that the issue you're planning to report is not already registered :) Describe the bug Ever when the device wakes up, MQTT only reconnects after the grace period of 2 mins. To ...
Looks like we already have this on gh
Oh yeah, didn't see that one. I mustn't have notifications on for the client repo 🤔
Well @MeatBoy looks like this will hopefully get a fix within the next 7 days
Awesome! Thanks a lot! 🙂