nightscout / nightguard

iOS and WatchOS Client for the Nightscout CGM System
GNU Affero General Public License v3.0
243 stars 159 forks source link

feature request: increase refresh rate to 1min #211

Closed zibra closed 5 months ago

zibra commented 2 years ago

We are using Freestyle Libre 3 sensor which gives BG reading to nightscout every minute. Is it possible to increase refresh rate on Nightguard as well to 1min?

zibra commented 2 years ago

I've found backgroundTaskScheduleRate setting, but it seems like the only way to configure it to make custom app build? It will be best to expose this as configurable setting

dhermanns commented 2 years ago

Yes - this is currently not supported, since no sensor was able to send every minute data. Problem is I don't have a freestyle libre to continuously test such a feature.

zibra commented 1 year ago

@dhermanns could you build IPA with such settings so I will test it on my end? I've tried to build project on my end but getting this error:

obraz
dhermanns commented 1 year ago

I had to make a small Addon to the Eureka SliderRow:

public final class SliderRow: Row<SliderCell>, RowType {

    public var steps: UInt = 20
    public var shouldHideValue = false
    public var lastSelectedValue : Float?

    required public init(tag: String?) {
        super.init(tag: tag)
    }
}

That should fix it. Would be great if you can provide a Configuration-Option for that.

Evs-nazgul commented 12 months ago

Hello, Just curious....is there an update on this question, as it is open since dec2022? Many libre 3 are being used now.

Fakhori commented 10 months ago

Hello, Just curious....is there an update on this question, as it is open since dec2022? Many libre 3 are being used now.

I was going to ask the same thing. My son at school uses the libre3 now and it would be great to be able to have a toggle to decrease the refresh time

dhermanns commented 10 months ago

For me it's still the same: I don't have a libre3 and therefore cannot implement and test this. So we need someone who can test and support this.

poml88 commented 8 months ago

I have libre3 and can test this. But I would need some input, I am not a skilled programmer. I have a working build environment here.

It seems that backgroundTaskScheduleRate was removed in the meantime? Can the 5 minute intervall be changed somewhere now?

I also noticed, that, when the app on the watch is open, it is updated rather often, but it seems to get stuck also often, then I have to use the reload arrow on the second page. Is that normal behaviour? While the app is in forground should it not continue to update?

dhermanns commented 8 months ago

A lot of refactorings in the meantime. But the updates frequency should still be changed very easily, since its done using a timer.

Never noticed that updates on the watch should get stuck. Yes, I would expect them to be updated every 5 minutes if the app stays in foreground.

poml88 commented 8 months ago

Ok, I see. I am still not so familiar with the code. I did not find that timer yet. If you have a hint... ;-)

dhermanns commented 8 months ago

In the iOS App the timer is in the MainViewController. It already activates every 30 seconds. It uses the NightscoutCacheService.singleton.loadCurrentNightscoutData to get the latest data.

The method checkIfRefreshIsNeeded in this Service restricts the updates to 5min only.

poml88 commented 8 months ago

Thanks, ok, found it. The currentNightscoutData.isOlderThan5Minutes() is quite hard coded... And the app quite complex. I will see if I can come up with something. A func isOlderThanXMinutes(_ minutes : Int) is already there and could be used. Have to add the switch in the preferences...

poml88 commented 6 months ago

So, I made a testflight build with an option to select 1 minute updates. Seems to work. Where do we go from here? You want to try it out? I would have some other questions as well, Is there a way to get in touch?

dhermanns commented 6 months ago

Hi Phil! Simply provide a Pull Request. I will have a look. But keep in mind that you will have to provide support for this feature, since I'm not able to test this.

Evs-nazgul commented 6 months ago

Hey,Altough I’m nit able to write the codes, I’m willing to try if it can help?ErwinOp 20 mei 2024 om 08:47 heeft dhermanns @.***> het volgende geschreven: Hi Phil! Simply provide a Pull Request. I will have a look. But keep in mind that you will have to provide support for this feature, since I'm not able to test this.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

dhermanns commented 6 months ago

A single test won't help. We will need someone who checks this with every new TestFlight release. Not much work, but someone has to have an eye on this for years.

Evs-nazgul commented 6 months ago

Ok no problem.I’m using a freebstyle libre 3, and can test the functionality on a 24/7 base, if youvare looking for results and sustainability.All I can do is  offer the help to report if it provides results if it works.ErwinOp 20 mei 2024 om 08:58 heeft dhermanns @.***> het volgende geschreven: A single test won't help. We will need someone who checks this with every new TestFlight release. Not much work, but someone has to have an eye on this for years.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

dhermanns commented 6 months ago

Great 👍

poml88 commented 6 months ago

Hi, ok, what is the best way? It is really only 2 lines of code or so. I do another fork, just change the lines of code? If I use my current fork it will have millions of changes in the xcode workspace.

I will for sure not win a price for beautiful coding! And I also don't know the finish translation.

Are you sure you can't test? Will you not see the app look for another value, just not find one? Anyway, I think there are plenty of libre3 users out there that will report an issue. And I am also wearing a libre3 and will be around for a while, but who knows.

We can also have libre3 users test my testflight first and see if everyone is happy, if that helps.

dhermanns commented 6 months ago

Then a new fork with a PR would be easiest. You can omit the finnish translation.

Basic testing ist not the problem. But I would need to have a developer in case of troubleshooting. When Bugs are reported with the freestyle I wouldn't be able to reproduce them.

poml88 commented 6 months ago

Ok, agreed for the FSL3. This very feature here is more universal I think, can work for any sensor that delivers values more often than every 5 minutes. Let's see if I can manage with this PR thingy.... :)

dhermanns commented 6 months ago

Great - I prepared a Testflight V3.9.2. It is available soon: https://testflight.apple.com/join/Ub8WcpcE

Let me know if that works for everybody with 1-minute-update sensors...

Evs-nazgul commented 6 months ago

Hello,When I use the linknit says the beta does not accept any more testers.Is that normal?Kind regardsErwinOp 21 mei 2024 om 21:37 heeft dhermanns @.***> het volgende geschreven: Great - I prepared a Testflight V3.9.2. It is available now: https://testflight.apple.com/join/Ub8WcpcE Let me know if that works for everybody with 1-minute-update sensors...

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

dhermanns commented 6 months ago

Should work as soon as apple has approved the testflight ;-)

Evs-nazgul @.***> schrieb am Di. 21. Mai 2024 um 22:36:

Hello,When I use the linknit says the beta does not accept any more testers.Is that normal?Kind regardsErwinOp 21 mei 2024 om 21:37 heeft dhermanns @.***> het volgende geschreven: Great - I prepared a Testflight V3.9.2. It is available now: https://testflight.apple.com/join/Ub8WcpcE Let me know if that works for everybody with 1-minute-update sensors...

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/nightscout/nightguard/issues/211#issuecomment-2123399760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYPBFOVGM4CH2CSVEYSJOTZDOV4TAVCNFSM6AAAAAASLSXWR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGM4TSNZWGA . You are receiving this because you were mentioned.Message ID: @.***>

Evs-nazgul commented 6 months ago

Test just launched as test flight just announced activation.No idea what to except faster update in dataErwinOp 21 mei 2024 om 22:40 heeft dhermanns @.***> het volgende geschreven: Should work as soon as apple has approved the testflight ;-)

Evs-nazgul @.***> schrieb am Di. 21. Mai 2024 um 22:36:

Hello,When I use the linknit says the beta does not accept any more

testers.Is that normal?Kind regardsErwinOp 21 mei 2024 om 21:37 heeft

dhermanns @.***> het volgende geschreven:

Great - I prepared a Testflight V3.9.2. It is available now:

https://testflight.apple.com/join/Ub8WcpcE

Let me know if that works for everybody with 1-minute-update sensors...

—Reply to this email directly, view it on GitHub, or unsubscribe.You are

receiving this because you commented.Message ID: @.***>

Reply to this email directly, view it on GitHub

https://github.com/nightscout/nightguard/issues/211#issuecomment-2123399760,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAYPBFOVGM4CH2CSVEYSJOTZDOV4TAVCNFSM6AAAAAASLSXWR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGM4TSNZWGA

.

You are receiving this because you were mentioned.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Evs-nazgul commented 6 months ago

Hello, I have send 1 picture with beta return, I could lot add more pictures therefore a separate mailScan above is from freestyle libre app.Reading just before on nightscouttime reading 1 min later1 min later samenreading, although freestyle is raisingThe data is update faster, I can not say for sure it changes every minute on nightscout and for sure not every minute on the iwatchFirst impression ErwinOp 21 mei 2024 om 22:40 heeft dhermanns @.***> het volgende geschreven: Should work as soon as apple has approved the testflight ;-)

Evs-nazgul @.***> schrieb am Di. 21. Mai 2024 um 22:36:

Hello,When I use the linknit says the beta does not accept any more

testers.Is that normal?Kind regardsErwinOp 21 mei 2024 om 21:37 heeft

dhermanns @.***> het volgende geschreven:

Great - I prepared a Testflight V3.9.2. It is available now:

https://testflight.apple.com/join/Ub8WcpcE

Let me know if that works for everybody with 1-minute-update sensors...

—Reply to this email directly, view it on GitHub, or unsubscribe.You are

receiving this because you commented.Message ID: @.***>

Reply to this email directly, view it on GitHub

https://github.com/nightscout/nightguard/issues/211#issuecomment-2123399760,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAYPBFOVGM4CH2CSVEYSJOTZDOV4TAVCNFSM6AAAAAASLSXWR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGM4TSNZWGA

.

You are receiving this because you were mentioned.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Evs-nazgul commented 6 months ago

Another screenshotFreestyle libre descending againNightguard even 1 minute later still at … normal?ErwinOp 22 mei 2024 om 22:19 heeft Erwin Van Steenacker @.> het volgende geschreven:Hello, I have send 1 picture with beta return, I could lot add more pictures therefore a separate mailScan above is from freestyle libre app.Reading just before on nightscouttime reading 1 min later1 min later samenreading, although freestyle is raisingThe data is update faster, I can not say for sure it changes every minute on nightscout and for sure not every minute on the iwatchFirst impression ErwinOp 21 mei 2024 om 22:40 heeft dhermanns @.> het volgende geschreven: Should work as soon as apple has approved the testflight ;-)

Evs-nazgul @.***> schrieb am Di. 21. Mai 2024 um 22:36:

Hello,When I use the linknit says the beta does not accept any more

testers.Is that normal?Kind regardsErwinOp 21 mei 2024 om 21:37 heeft

dhermanns @.***> het volgende geschreven:

Great - I prepared a Testflight V3.9.2. It is available now:

https://testflight.apple.com/join/Ub8WcpcE

Let me know if that works for everybody with 1-minute-update sensors...

—Reply to this email directly, view it on GitHub, or unsubscribe.You are

receiving this because you commented.Message ID: @.***>

Reply to this email directly, view it on GitHub

https://github.com/nightscout/nightguard/issues/211#issuecomment-2123399760,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAYPBFOVGM4CH2CSVEYSJOTZDOV4TAVCNFSM6AAAAAASLSXWR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGM4TSNZWGA

.

You are receiving this because you were mentioned.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Evs-nazgul commented 6 months ago

Nevertheless, the nightguard readiutbseemsbto refresh or display faster an updated result, on ezch re-opening of the app it is updated anyhow , where this was always the case in the previous versionKeep on checkingErwinOp 22 mei 2024 om 22:29 heeft Erwin Van Steenacker @.> het volgende geschreven:Another screenshotFreestyle libre descending againNightguard even 1 minute later still at … normal?ErwinOp 22 mei 2024 om 22:19 heeft Erwin Van Steenacker @.> het volgende geschreven:Hello, I have send 1 picture with beta return, I could lot add more pictures therefore a separate mailScan above is from freestyle libre app.Reading just before on nightscouttime reading 1 min later1 min later samenreading, although freestyle is raisingThe data is update faster, I can not say for sure it changes every minute on nightscout and for sure not every minute on the iwatchFirst impression ErwinOp 21 mei 2024 om 22:40 heeft dhermanns @.***> het volgende geschreven: Should work as soon as apple has approved the testflight ;-)

Evs-nazgul @.***> schrieb am Di. 21. Mai 2024 um 22:36:

Hello,When I use the linknit says the beta does not accept any more

testers.Is that normal?Kind regardsErwinOp 21 mei 2024 om 21:37 heeft

dhermanns @.***> het volgende geschreven:

Great - I prepared a Testflight V3.9.2. It is available now:

https://testflight.apple.com/join/Ub8WcpcE

Let me know if that works for everybody with 1-minute-update sensors...

—Reply to this email directly, view it on GitHub, or unsubscribe.You are

receiving this because you commented.Message ID: @.***>

Reply to this email directly, view it on GitHub

https://github.com/nightscout/nightguard/issues/211#issuecomment-2123399760,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAYPBFOVGM4CH2CSVEYSJOTZDOV4TAVCNFSM6AAAAAASLSXWR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGM4TSNZWGA

.

You are receiving this because you were mentioned.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Evs-nazgul commented 6 months ago

New updateWhen I keep nightguard open during the time evolution I see the same value during 5 minutes and the 6 minute, the value updates automatically.6th minute app open, value change automaticallyMy settings on nightguard areErwinOp 21 mei 2024 om 22:40 heeft dhermanns @.***> het volgende geschreven: Should work as soon as apple has approved the testflight ;-)

Evs-nazgul @.***> schrieb am Di. 21. Mai 2024 um 22:36:

Hello,When I use the linknit says the beta does not accept any more

testers.Is that normal?Kind regardsErwinOp 21 mei 2024 om 21:37 heeft

dhermanns @.***> het volgende geschreven:

Great - I prepared a Testflight V3.9.2. It is available now:

https://testflight.apple.com/join/Ub8WcpcE

Let me know if that works for everybody with 1-minute-update sensors...

—Reply to this email directly, view it on GitHub, or unsubscribe.You are

receiving this because you commented.Message ID: @.***>

Reply to this email directly, view it on GitHub

https://github.com/nightscout/nightguard/issues/211#issuecomment-2123399760,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAYPBFOVGM4CH2CSVEYSJOTZDOV4TAVCNFSM6AAAAAASLSXWR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGM4TSNZWGA

.

You are receiving this because you were mentioned.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

poml88 commented 6 months ago

I was wondering, if for the prediction it makes a difference if we have one sgv every 5 minutes or one sgv every minute = 5 in 5 minutes? It depends on how this is implemented. Does it look at a time interval or a number of sgvs?

Evs-nazgul commented 6 months ago

Hello,What do you mean with sgv?As when I installed the flight case on the every minute update, I see  regularly annupdated value, but not every minute.What I did notice is that when I keep the nightguard app open and do nothing, the value is illediately updated after 5 minutes.The value is updated maybe faster, it is not always immediately shown on nightguard nor on an iwatch, using the nightguard to displayErwinOp 27 mei 2024 om 22:40 heeft Phil @.***> het volgende geschreven: I was wondering, if for the prediction it makes a difference if we have one sgv every 5 minutes or one sgv every minute = 5 in 5 minutes? It depends on how this is implemented. Does it look at a time interval or a number of sgvs?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

poml88 commented 6 months ago

I was wondering, if for the prediction it makes a difference if we have one sgv every 5 minutes or one sgv every minute = 5 in 5 minutes? It depends on how this is implemented. Does it look at a time interval or a number of sgvs?

If I understand the code correctly it is using the last 3 values. I think that could have a big effect, because For FSL this means 3 minutes, for other sensors 15 minutes. I think we have to go 15 minutes for everyone here. 3 minutes have too much noise.

poml88 commented 5 months ago

You can close this too.