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

Fix the dexcom share in Trio #282

Merged
merged 2 commits into from
Jun 15, 2024
Merged

Conversation

avouspierre
Copy link
Contributor

@avouspierre avouspierre commented Jun 8, 2024

The PR allows to fetch BG of Dexcom share as a CGM as well as to fetch BG of Dexcom share with the Dexcom G6 CGM.

The PR updates the logic of the CGM fetch for all CGM based on Loop submodules (PluginSource).

Test requirements

  • Activate the dexcom share in the Dexcom App in the IRL device
  • Check the dexcom share is operational with the dexcom follower apps

1. - IOS Simulator - Add Dexcom Share CGM

  • enter credentials
  • the BG is updated immediatly :✅
  • the BG is updated after 5 minutes ✅

2. - Iphone 8 - Add G6 CGM

  • enter a fake number for the G6 CGM
  • enter credentials for dexcom share
  • the BG is fetched and updated immediatly ✅
  • the BG is updated after 5 minutes with the use of the dexcom share ✅

3. - iphone 15 - Add G6 CGM with G6 sensor

  • enter the correct number for the G6 sensor
  • enter credentials for dexcom share ✅
  • the BG is updated after 5 minutes with the use of the “BLE” heartbeat. ✅

Need to be tested with Libre and Dexcom G7. Both implement the fetchIfNeeded function with noData response.

The PR allows to fecth BG of Dexcom share as a CGM as well as to fetch BG of Dexcom share with the Dexcom G6 CGM.

The PR changes the logic of the CGM for all CGM based on Loop submodules (PluginSource).
bjornoleh
bjornoleh previously approved these changes Jun 8, 2024
Copy link
Contributor

@bjornoleh bjornoleh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested:

Builds to Xcode simulator ✅
Received data when configured as CGM ✅
Received data when used with fake G6 ✅

Without having a full understanding of the code changes, this looks good to me!

@Sjoerd-Bo3 Sjoerd-Bo3 linked an issue Jun 8, 2024 that may be closed by this pull request
@Sjoerd-Bo3
Copy link
Contributor

Going to test on G7

@Sjoerd-Bo3 Sjoerd-Bo3 self-requested a review June 8, 2024 23:08
@Sjoerd-Bo3 Sjoerd-Bo3 added this to the Trio 1.0 release milestone Jun 8, 2024
@marionbarker
Copy link
Contributor

Summary

Success - works with phone locked so long as pump has a heartbeat.

Configuration

  • iPhone SE running iOS 17.5.1
  • Pump is rPi DASH pod (has a heartbeat)
  • Trio dev commit 32b5e95
  • apply patch from PR 282

Testing

  • Stop using NS as CGM
  • Add Dexcom Share
    • Wait 2 CGM updates, ensure CGM data continues (success)
  • Lock phone
    • Wait 15 minutes, unlock to confirm looping while locked, green loop with dosing history while locked (success)

marionbarker
marionbarker previously approved these changes Jun 10, 2024
Copy link
Contributor

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve based off testing.

Sjoerd-Bo3
Sjoerd-Bo3 previously approved these changes Jun 14, 2024
Copy link
Contributor

@Sjoerd-Bo3 Sjoerd-Bo3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not close the issue for G7, Only for G6 it does.

Copy link
Contributor

@MikePlante1 MikePlante1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM based on testing. I did not review code, but did notice no linting occurred when building (only Package.resolve was changed)

Tested in a simulator phone using Dexcom Share as the cgm source. Took a couple minutes before it was backfilled, but then it backfilled 6 readings (30 minutes). After that, the simulator populated readings within 2 seconds of the readings appearing on my real phone in the Dexcom G6 app.

Details for following tests:
Device: iPhone 14 Pro Max
OS: iOS 17.5.1
Pump: Omnipod Eros + OrangeLink
CGM: Anubis + Dexcom G6 app, Transmitter & Share credentials added in Trio
Trio: This PR built on top of the current dev (MikePlante1@00881fa)

I tried to test backfilling by sticking my phone in the microwave for one cycle, leaving my phone on the other side of the office, or disabling bluetooth... all of which did cause a missed reading, but when the next reading was populated in the G6 app, the G6 app never backfilled the missed reading, which means I couldn't test backfilling G6 in Trio.

So then I tried closing all the apps on my phone, including Trio, but kept the G6 app running. The missed readings (in Trio, as G6 app did not have any missing readings) were populated as soon as Trio was opened and a loop cycle was triggered immediately. When this happens too close to the next cgm reading, the loop cycle is skipped for the next cgm reading as a loop cycle was completed too recently.

@MikePlante1 MikePlante1 self-requested a review June 15, 2024 02:58
Copy link
Contributor

@MikePlante1 MikePlante1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this target alpha instead of dev?

@bjornoleh bjornoleh changed the base branch from dev to alpha June 15, 2024 16:13
@bjornoleh bjornoleh dismissed stale reviews from Sjoerd-Bo3, marionbarker, and themself June 15, 2024 16:13

The base branch was changed.

@bjornoleh
Copy link
Contributor

Should this target alpha instead of dev?

I changed the base branch, which apparently dismisses all previous reviews… Can you resolve the change request? I can’t do that it seems.

Copy link
Contributor

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

I should have just approved again because only change was the base branch.

  • I seem to be incapable of doing that (did a successful test again)

Test details

  • started with latest alpha, commit d7a730c with rPi attached to phone
    • applied the patch
    • selected Dexcom Share
    • set Closed Loop to enabled
    • locked the phone and set timer to 15 minutes
      • unlocked phone to green loop with several adjustments to tempbasal while locked.

@bjornoleh
Copy link
Contributor

Merging with three approvals

@bjornoleh bjornoleh merged commit 3be872c into nightscout:alpha Jun 15, 2024
1 check passed
This was referenced Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Trio Does Not Backfill Missed Glucose Readings from Dexcom G6 Sensors
5 participants