Ixam97 / CarStatsViewer

MIT License
98 stars 54 forks source link

Feature: slow down send interval to ABRP when errors occur #177

Closed CONSULitAS closed 1 year ago

CONSULitAS commented 1 year ago

Errors like this could point to congestion at ABRP which should be gracefully avoided:

07.07.2023 12:54:51.781 E: [ABRP] Network timeout error

Solution: adapt send interval dynamically, but

CONSULitAS commented 1 year ago
  • send no more than every 5 seconds

from API description

The desired data rate is one point every 5 seconds, but slower rates are accepted. Less than one every 30 seconds is recommended against.

So I would suggest:

CONSULitAS commented 1 year ago

If the car is offline, the send interval should not be changed.

Perhaps here is a way to detect?

https://stackoverflow.com/questions/23084389/how-to-detect-device-status-offline-online-in-android

Ixam97 commented 1 year ago

If the car is offline, the send interval should not be changed.

I've now limited timeout increases to only occure on timeout exceptions. All other connection errors do not increase the interval.