Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slows Homebridge down, leading to "no response" errors #19

Closed
beatpaul opened this issue Nov 25, 2018 · 18 comments
Closed

Slows Homebridge down, leading to "no response" errors #19

beatpaul opened this issue Nov 25, 2018 · 18 comments
Assignees
Labels

Comments

@beatpaul
Copy link

beatpaul commented Nov 25, 2018

Hi!

If there is no server connection to netatmo servers (what happens lately a lot) the plugin slows homebridge down so u can't us it any more
Same issue as
planetk/homebridge-netatmo#73

Is there a workaround?

thx in advance

@skrollme skrollme self-assigned this Nov 27, 2018
@skrollme
Copy link
Owner

Are you on the latest version of homebridge-eveatmo, @beatpaul ? For me there are currently no problems, even the history works well.

@Acemach1ne
Copy link

Acemach1ne commented Nov 27, 2018

Same here. Latest version installed.
Homebridge service is running, but all devices are not responding.

@skrollme skrollme added the bug label Nov 27, 2018
@skrollme
Copy link
Owner

It is difficult to debug this at the moment, because this does not occurs in my setup (eveatmo with some other plugins on raspberryPi), but will look into this: May reducing the connection-timeout could be an option.

@beatpaul
Copy link
Author

Hi!
Yes i used the latest Version, running on a mac mini with several other plugins like homebridge-hue e.g.

@Acemach1ne
Copy link

@skrollme
Copy link
Owner

@Acemach1ne I also get a batch of "invalid access token" messages once. After a restart everything was fine again. Does this work for you as a temporary fix if you are still facing the problems? Or did the problems disappear by themselves?

@Acemach1ne
Copy link

@skrollme
It was related to the downtime of Netatmo. After the server ran again, the problem fixed themselve. A restart of Homebridge didnt fixed the problem.

@cschildhorn
Copy link

I see these errors after a few hours last days:

[12/3/2018, 12:33:04 AM] [eveatmo platform] WARN - Netatmo: Error: getStationsDataError error: Access token expired

All Sensor do not respond and the error makes all other plugins unresponsive as well.

Restarting homebridge solves issue but the token is not renewed without the reboot.

@skrollme
Copy link
Owner

skrollme commented Dec 4, 2018

I had still no luck with debugging but in the last few days I had not a single "token expired" error in my logs. My polling interval is 540s (9min) by the way. Every now and then I got an "internal server error" from the netamo API but even then I have no freezes in the Home.app.

I will continue to look into this but at the moment if have no real clues how to start with this. Suggestions are welcome.

@skrollme
Copy link
Owner

Any new information on this, @cschildhorn ? Did it happen again? Please also take a look at this issue and my answer there: #25

I will close this soo because it seems that we can make no progress here.

@cschildhorn
Copy link

cschildhorn commented Jan 21, 2019 via email

@skrollme
Copy link
Owner

skrollme commented Jan 22, 2019

Interesting. I took a look at my homebridge log from the last weeks and I see that every now and then the following error occurred once, followed by successful data-request.
[eveatmo] WARN - Netatmo: Error: getStationsDataError error: Access token expired

So the token gets renewed automatically (as designed) and the plugin continues it's work. At the moment I have no idea how to debug this. Maybe it is a good start for you to learn nodeJS (if you are not already a pro) and start debugging ;)

Edit: Pull request are welcome...

@schroot72
Copy link

I have The same problem. Maybe the token should be refreshed ? https://dev.netatmo.com/en-US/resources/technical/guides/authentication/refreshingatoken

@skrollme
Copy link
Owner

Because I forked the plugin from the base Netatmo-plugin I never really looked/overhauled into the base-logic which fetches the data from the API.
I will take a look at this soon.

@skrollme
Copy link
Owner

I checked the used Netatmo-library:
On this line the refresh is automatically set up with a timer, if the expires_in-value is set in the first auth-response. I manually did an auth-request to check this, and expires_in is set!

The value for expires_in is 10800, which equals to 3 hours. So if the refresh would not work, the plugin would stop after 3 hours. Although I did not have the problems you describe - even in long and continously running situations - I trust your words and problem descriptions ;)

I plan to add an config-option to trigger a forced re-authenticate in the Netatmo-library. Maybe I find some time for this on this weekend. I will let you know if this is done.

@skrollme
Copy link
Owner

skrollme commented May 1, 2019

Update:
So far I did not find a working solution to regularly trigger a reauthenticate without breaking everything else. The underlying netatmo-library fires events in this case which break things else or re-calls callbacks which should not have been called a second time.

Also I would not consider myself a NodeJS pro - only "learned" this a bit for my personal homebridge projects - and so I plan to stop investigating this one here. If anyone has the knowledge and spare time, I would appreciate further research and maybe a PullRequest, but I'm sorry to say that my efforts on this will stop here.

I will keep the issue open for a while.

@vidalpascual
Copy link

Any news about this? I have the same issue described above with the same errors. It seems that Netatmo have changed something in their servers.

@skrollme
Copy link
Owner

I just looked into my homebridge-log and there was no single eveatmo-error in the last 3 days. So it does not seem to be a general issue. My polling-interval is 1 call every 9min at the moment

@skrollme skrollme closed this as completed Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants