hjdhjd / homebridge-myq

:car: myQ Liftmaster and Chamberlain Plugin for Homebridge https://github.com/nfarina/homebridge
Other
568 stars 44 forks source link

ECONNRESET - Error polling MyQ servers: FetchError: #21

Closed TheEngineerGuy closed 4 years ago

TheEngineerGuy commented 4 years ago

Error polling MyQ servers: FetchError: request to https://myqexternal.myqdevice.com/api/v4/UserDeviceDetails/Get failed, reason: read ECONNRESET

Hi Byron, I saw this error this morning at 9:14AM, which made the plugin miss door status changes at 10:05AM. Till I triggered it manually by opening Home app, plugin was missing all status changes(as per the logs). This makes me think that the error made the plugin to stop and not retry.

I understand that these errors can happen as we don't have much control over MyQ servers, but if we can build a retry logic after these errors, it might help.

What do you think?

hjdhjd commented 4 years ago

Thanks for the input. I haven’t seen this behavior aside from occasional server issues on Liftmaster’s side. They will occasionally miss notifications because of their own server maintenance and uptime. Are you still seeing this behavior?

TheEngineerGuy commented 4 years ago

I am still facing the problem. I made a hack script to fix it. It tail's the log, and when ECONNRESET shows up, it restarts HomeBridge service. The only way I can think of automating a "fix".

If I don't do it, it never retries a connection back to server.

EDIT: I think I know why you don't see this problem. Because after ECONNRESET, if you open the HomeKit app, it will force the plugin to do a poll, and it "fixes" it. But If after ECONNRESET, if you don't open home app, or restart HB, no more notifications from garage door.

hjdhjd commented 4 years ago

This should be fixed In 1.2.19 that I just released...let me know. Thanks @TheEngineerGuy!

TheEngineerGuy commented 4 years ago

Ok. Let me test it out. Will report after the next ECONNRESET.

EDIT: Thanks again for a quick update.

hjdhjd commented 4 years ago

No worries!

lherlitz commented 4 years ago

I'm still having this issue:

[MyQ2] Error setting the target: FetchError: request to https://myqexternal.myqdevice.com/api/v4/DeviceAttribute/PutDeviceAttribute failed, reason: connect ETIMEDOUT

TheEngineerGuy commented 4 years ago

Getting Errors is fine. Because we don't control MyQ servers. Handling these errors gracefully is what we can control. So, if plugin keeps working after this error, kindly ignore.

hjdhjd commented 4 years ago

You beat me to it. @TheEngineerGuy :)

I also suspect that part of the weirdness we will start to see more and more of is that we’re still using the older API. A new API came out last fall...I’ve been putting off dealing with it, but I think that’s the work ahead in the coming weeks. It’s effectively a rewrite of the API portion of the plugin, so yay for more work. Thanks Liftmaster / Chamberlain.

TheEngineerGuy commented 4 years ago

LOL!! All good my man.

In regards to new API, I got out of coding quite a few years ago, so if I decided to help I would only make matters worse. Good luck though.

hjdhjd commented 4 years ago

Me too. :) This is what I do to relax and keep my mind somewhat sharp. I miss the days of elegant languages like C. Node and their ilk are...inelegant is probably the nicest word I can think of. Yeah, they work, but I always find myself thinking "and the younger generations think THIS is an upgrade from the days of structured programming languages?!".

Alright...back to the show.

TheEngineerGuy commented 4 years ago

I miss C and C++, the Borland compiler. Good old days. Young folks would never know the joy of coding their own header file when a function in math.h doesn't exist to calculate a factorial.

github-actions[bot] commented 1 year ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.