Brandawg93 / homebridge-fordpass

Control your Ford vehicle in HomeKit using Homebridge.
GNU General Public License v3.0
62 stars 15 forks source link

plugin sometimes gets 402 response from Ford servers #135

Closed paulw11 closed 2 years ago

paulw11 commented 3 years ago

It seems that in some cases frequent requests against Ford's servers result in a 402 response - Payment required. It seems that a rate-limiting threshold is being exceeded.

Once the 402 status is returned, homebridge-fordpass continues to make requests attempting to get vehicle status updates, continuing the problem. This state persisted for days for me.

I was able to restore operation by disabling the FordPass plug in for about an hour (I actually just changed my username so that authentication failed). This restored correct operation.

Perhaps some sort of exponential back off could be implemented such that if a 402 response is received, no further server requests are made for a time. This will result in temporarily stale date in Homebridge, but hopefully operation will eventually resume. This is preferable to the current case where the 402 state is never cleared.

github-actions[bot] commented 3 years ago

@paulw11 - this issue is being automatically closed because it does not follow either the feature request or bug report issue template. The issue templates have been designed to help in the troubleshooting (or feature request) process. Please use them and populate it as completely as possible to streamline troubleshooting or feature request discussions.

Brandawg93 commented 3 years ago

Don't worry about the automated response. I'll look into this.

paulw11 commented 3 years ago

Yeah, I'm not sure what I did to trigger the 402 state. It could have been because I restarted Homebridge a few times in a short period, or something else. I'll try and provide more information if I can reproduce it reliably

paulw11 commented 3 years ago

I have the 402 error again now. I don't have auto refresh enabled. The refresh rate is set at 180, but as I understand it with auto refresh false that shouldn't do anything.

paulw11 commented 3 years ago

I still don't know what triggers the 402 state, but I found out how to clear it - If I use the FordPass app on my phone and update my vehicle status then it clears the 402 and starts returning the full status. In theory the app and Homebridge will be using different JWTs, so I presume that my IP address is somehow being blacklisted but using the app clears that.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 3 days

Brandawg93 commented 2 years ago

Fixed in #187