nightscout / AndroidAPS

Opensource automated insulin delivery system (closed loop)
https://wiki.aaps.app
GNU Affero General Public License v3.0
725 stars 1.76k forks source link

[Dev] [Bug]Intermittent Issue with Delta values not being passed from glucose_status to _determine_basal #689

Closed tim2000s closed 3 years ago

tim2000s commented 3 years ago

In the current Dev code, the values for Delta, Short Average Delta and Long Average Delta are not always passed to determine_basal.

Screenshots attached showing example where none is showing up on either the GUI main screen or in openAPS SMB in spite of a change in glucose value of 32 mg/dl. Dev build listed in image.

Logfile also attached.

Screenshot_20210924-164031_AndroidAPS Screenshot_20210924-164039_AndroidAPS Screenshot_20210924-164047_xDrip+ Screenshot_20210924-153559_AndroidAPS AndroidAPS.log

dexdan commented 3 years ago

Likely linked to https://github.com/0pen-dash/AndroidAPS/issues/104

MilosKozak commented 3 years ago

it's caused by your wrong setup: doubled BG values with identical timestamp. G6 is smoothing old values and you are probably synchnonizing them elsewhere which breaks it

tim2000s commented 3 years ago

If there are dual glucose entries for each point, then the backfill from NS must be picking up additional data from Dexcom bridge in Nightscout which has the same value and a slight time delay. I'm surprised that the backfill from NS would pick this up and use it, but I think that explains the problem.

I wonder how many others use dual feeds to NS for redundancy purposes?

More to the point, this was never an issue in 2.8.2 Master, so something on the way that AAPS is receiving and handling data from Nightscout and how it looks at missed readings serms to be different.

MilosKozak commented 3 years ago

I don't know your setup but for Dexcom patched app + aaps is recommended for NS upload

tim2000s commented 3 years ago

I don't know your setup but for Dexcom patched app + aaps is recommended for NS upload

Yes. Nightscout upload is configured via AAPS. There is also an upload via Share, which had the Bridge component enabled in Nightscout providing an alternative route.

The key difference between master behaviour and Dev behaviour is that in the Dev version, the dual values are being recognised and generating incorrect delta data. In master, this wasn't happening.

It looks like the Dev handles duplicate timestamps differently.

MilosKozak commented 3 years ago

Double upload can cause only troubles. Keep only AAPS which handles backward smoothing properly

MilosKozak commented 3 years ago

Previous versions didn't upload smoothed values to NS

vanelsberg commented 3 years ago

@MilosKozak I do not agree on the way it seems to works now:

When in AAPS user explicitly defines a BG source (xDrip, or any other BG source then NS) it should ignore BG information from NS. This includes complaining about double values....

Imho AAPS version 2.8.2.9 is introducing a dependency to NS that is not needed or even unwanted: User should be able to configure AAPS to not download any data from NS ("upload-only" as was available for 2.8.2)

Please see also https://github.com/nightscout/AndroidAPS/issues/857

vanelsberg commented 3 years ago

@MilosKozak

I don't know your setup but for Dexcom patched app + aaps is recommended for NS upload

I do not see what this has to do with the Dexcom. Same goes for any other "BG source"

What you are actually saying is the AAPS does not accept any BG source writing values to NS even if AAPS does not need or should use these values?

I can not see the point in this and severely limits the functionality of NS as central information storage:

AAPS should be able to do the same: write to NS, without the need to read (or validate data it is not reading) In other words: we need an "upload only" option as was available for 2.8.2?