Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: increase refresh rate to 1min #211

Open
zibra opened this issue Nov 25, 2022 · 32 comments
Open

feature request: increase refresh rate to 1min #211

zibra opened this issue Nov 25, 2022 · 32 comments

Comments

@zibra
Copy link

zibra commented Nov 25, 2022

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
Copy link
Author

zibra commented Nov 25, 2022

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
Copy link
Collaborator

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
Copy link
Author

zibra commented Dec 16, 2022

@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
Copy link
Collaborator

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
Copy link

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

@Fakhori
Copy link

Fakhori commented Jan 6, 2024

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
Copy link
Collaborator

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
Copy link
Contributor

poml88 commented Mar 31, 2024

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
Copy link
Collaborator

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
Copy link
Contributor

poml88 commented Mar 31, 2024

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
Copy link
Collaborator

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
Copy link
Contributor

poml88 commented Apr 3, 2024

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
Copy link
Contributor

poml88 commented May 19, 2024

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
Copy link
Collaborator

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
Copy link

Evs-nazgul commented May 20, 2024 via email

@dhermanns
Copy link
Collaborator

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
Copy link

Evs-nazgul commented May 20, 2024 via email

@dhermanns
Copy link
Collaborator

Great 👍

@poml88
Copy link
Contributor

poml88 commented May 20, 2024

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
Copy link
Collaborator

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
Copy link
Contributor

poml88 commented May 20, 2024

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
Copy link
Collaborator

dhermanns commented May 21, 2024

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
Copy link

Evs-nazgul commented May 21, 2024 via email

@dhermanns
Copy link
Collaborator

dhermanns commented May 21, 2024 via email

@Evs-nazgul
Copy link

Evs-nazgul commented May 22, 2024 via email

@Evs-nazgul
Copy link

Evs-nazgul commented May 22, 2024 via email

@Evs-nazgul
Copy link

Evs-nazgul commented May 22, 2024 via email

@Evs-nazgul
Copy link

Evs-nazgul commented May 22, 2024 via email

@Evs-nazgul
Copy link

Evs-nazgul commented May 22, 2024 via email

@poml88
Copy link
Contributor

poml88 commented May 27, 2024

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
Copy link

Evs-nazgul commented May 27, 2024 via email

@poml88
Copy link
Contributor

poml88 commented May 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@dhermanns @zibra @Fakhori @poml88 @Evs-nazgul and others