NightscoutFoundation / xDrip

Nightscout version of xDrip+
https://jamorham.github.io/#xdrip-plus
GNU General Public License v3.0
1.42k stars 1.15k forks source link

Wake up for G7 once a minute #3461

Closed Navid200 closed 6 months ago

Navid200 commented 6 months ago

A G7 could shift the time stamp off the one-per-5-minute grid as a result of a disconnect. xDrip uses the timestamp and wakes up 5 minutes after. However, considering the timestamp may not be on the correct grid, xDrip may wake up when G7 does not transmit.

There are many reports of users having disconnect issues.

This PR changes the wake schedule from once every 5 minutes to every minute for a G7 or One+ only. My concern is if battery consumption may go up. My hope is that the impact on battery will be negligible.

Navid200 commented 6 months ago

This clearly raised the power consumption for me. We cannot do this. I wanted to avoid adding complicated logic. But, we have no choice. We cannot raise the xDrip power consumption like that. I will need to monitor the times of the incoming readings and keep a tally for the last two. If they are ever apart by a value less than 5 minutes, only then, should we scan once a minute. This will avoid scanning once a minute when you walk away from your phone and should keep the battery consumption effectively unchanged.

I will need time to come up with the change.

Navid200 commented 6 months ago

I have an idea. I should have an update in a few hours.

Navid200 commented 6 months ago

This is getting a little bit complicated! There has been a suggestion that it is xDrip that messes up the timestamps. The suggestion is that when G7 starts transmitting once a minute, it just transmits the same value and time over and over again until the time comes for the next reading in 5 minutes. But, xDrip clearly shows timestamps that are off grid.

I cannot fix it if I am not 100% sure what's going on. I need more time sorry.

TWilhoWI commented 6 months ago

Hi Navid, any development about this?

Navid200 commented 6 months ago

@TWilhoWI This has been fixed by our lead developer. It is being tested now. It should come out as a Nightly hopefully some time this week.

TWilhoWI commented 6 months ago

Perfect! Please do keep me posted!

Navid200 commented 6 months ago

There is no reason for this PR any longer. The problem has been fixed by JamOrHam in any release at or after May 22, 2024. Please update if you are using xDrip to collect from G7.