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

Dexcom Share CGM broken by changes in data format for OUS accounts #1576

Closed
bjornoleh opened this issue Dec 4, 2021 · 12 comments
Closed

Dexcom Share CGM broken by changes in data format for OUS accounts #1576

bjornoleh opened this issue Dec 4, 2021 · 12 comments

Comments

@bjornoleh
Copy link
Contributor

The Dexcom Share CGM for Loop (https://github.com/LoopKit/dexcom-share-client-swift) recently got broken by changes in the data format for "Outside of the US" (OUS) accounts. It is likely US accounts will be affected in the future.

More info can be found in
nightscout/share2nightscout-bridge#52

and hints of the solution can be found in

nightscout/share2nightscout-bridge@976fce4

and Nightscout commits on Dec 2, 2021

https://github.com/nightscout/cgm-remote-monitor/commits/8d83617c92c2b43f9c3ab03d653404e6fa7c325c

To Reproduce

Enter Dexcom Share credentials for Share CGM
This is the result, failing at interpreting trend data:

Phone
iPhone 13 mini, iOS 15.1

Loop Version

  • Version Number: 2.2.6

CGM
Dexcom G6
Outside of US Dexcom account
Old style username (not email address)

@codelinx
Copy link

codelinx commented Dec 9, 2021

just received this error also and i cannot get any details in the loop app.

  • Loop App version: Loop automatic bolusing 2.2.4
  • iOS: 14.4
  • iPhone 8 plus
  • Dexcom G6 version: sw11677 Rev. 1.9.1

Dexcom is working, but not able to get data from dexcom to loop.

image

@ghost
Copy link

ghost commented Dec 9, 2021

Following. We are experiencing the same issue and getting the same error. I found an Aug 2019 posting that suggested removing the share app credentials from loop would resolve, but it hasn’t worked for us thus far.

@dybs
Copy link

dybs commented Dec 9, 2021

This post in the Looped FB group talks about this issue and also suggests removing the share credentials.
https://www.facebook.com/groups/TheLoopedGroup/permalink/2999936863556293

@codelinx
Copy link

codelinx commented Dec 9, 2021

Following. We are experiencing the same issue and getting the same error. I found an Aug 2019 posting that suggested removing the share app credentials from loop would resolve, but it hasn’t worked for us thus far.

Based on issue report from the app "failed to decode sgv record"


## LoopVersion
* Version: Loop (Automatic Bolusing) v2.2.4
* gitRevision: 0e51062f5f5c2e12a3e7d3c15808313950cd8a5a
* gitBranch: (HEAD detached at 0e51062f)
* sourceRoot: /Users/.../Downloads/BuildLoop/Loop-AutomaticBolus-210623-1657/LoopWorkspace/Loop
* buildDateString: Thu Jun 24 00:55:55 EDT 2021
* xcodeVersion: 12D4e

## FeatureFlags
FeatureFlagConfiguration(sensitivityOverridesEnabled: true)

## DeviceDataManager
* launchDate: 2021-12-09 05:02:48 +0000
* lastError: Optional((date: 2021-12-09 08:53:21 +0000, error: ShareClient.ShareError.dataError(reason: "Failed to decode an SGV record: [{\"WT\":\"Date(1639039953000)\",\"ST\":\"Date(1639039953000)\",\"DT\":\"Date(1639039953000-0500)\",\"Value\":48,\"Trend\":\"Flat\"},{\"WT\":\"Date(1639039654000)\",\"ST\":\"Date(1639039654000)\",\"DT\":\"Date(1639039654000-0500)\",\"Value\":47,\"Trend\":\"FortyFiveDown\"},{\"WT\":\"Date(1639039354000)\",\"ST\":\"Date(1639039354000)\",\"DT\":\"Date(1639039354000-0500)\",\"Value\":44,\"Trend\":\"SingleDown\"},{\"WT\":\"Date(1639039053000)\",\"ST\":\"Date(1639039053000)\",\"DT\":\"Date(1639039053000-0500)\",\"Value\":55,\"Trend\":\"FortyFiveDown\"},{\"WT\":\"Date(1639038754000)\",\"ST\":\"Date(1639038754000)\",\"DT\":\"Date(1639038754000-0500)\",\"Value\":72,\"Trend\":\"FortyFiveDown\"},{\"WT\":\"Date(1639038454000)\",\"ST\":\"Date(1639038454000)\",\"DT\":\"Date(1639038454000-0500)\",\"Value\":80,\"Trend\":\"Flat\"}]")))
* lastBLEDrivenUpdate: 2021-12-09 08:53:20 +0000

## G6CGMManager
latestReading: nil
latestConnection: nil
dataIsFresh: false
providesBLEHeartbeat: false
## ShareClientManager
latestBackfill: nil

observers.count: 0
## Transmitter
## BluetoothManager
No peripheral

## OmnipodPumpManager
podComms: ## PodComms
podState: Optional(### PodState
* address: xxxxx
* setupUnitsDelivered: Optional(2.8)
* piVersion: 2.10.0
* pmVersion: 2.10.0
* lot: 71204
* tid: 2500413
* suspendState: resumed(2021-12-08 20:21:24 +0000)
* unfinalizedBolus: nil
* unfinalizedTempBasal: nil
* unfinalizedSuspend: nil
* unfinalizedResume: Optional(Resume: 12/5/21, 11:27:54 PM Certain)
* finalizedDoses: []
* activeAlerts: [OmniKit.AlertSlot.slot7: Pod expiration advisory alarm]
* messageTransportState: MessageTransportState(packetNumber: 15, messageNumber: 9)
* setupProgress: completed
* primeFinishTime: Optional(2021-12-06 04:26:20 +0000)
* configuredAlerts: [OmniKit.AlertSlot.slot2: Shutdown imminent alarm, OmniKit.AlertSlot.slot7: Pod expiration advisory alarm]

fault: nil
)
configuredDevices: ["xxxx"]
delegate: true

@hpc4fun
Copy link

hpc4fun commented Dec 9, 2021

A quick workaround (not a fix as it breaks if dexcom is inconsistent in its format, say strings in non-US and numbers in US as it appears) could be something like this (to substitute ShareClient.swift in dexcom-share-client-swift/ShareClient/)

ShareClient.swift.txt

@marionbarker
Copy link
Contributor

A proposed hotfix branch is out for testing for FreeAPS.

@marionbarker
Copy link
Contributor

@hpc4fun
I tested your solution - much more elegant. I have updated the hotfix/dexcom-share branch of dexcom-share-client-swift in the loopnlearn repo.

I was a little uncertain of the actual strings for trendmap positions 8 and 9 - they disagree with the share2bridge javascript, so I put in a nonsense string instead of my current arrow string and appropriately got no arrow returned.
I also put in the old Trend as int code as an else if before the throwError. I can't test this, but if Dexcom reverts this change, this should work as before.

@codelinx
Copy link

Should this be closed since the change was accepted into a working branch?

@bjornoleh
Copy link
Contributor Author

Should this be closed since the change was accepted into a working branch?

No, it’s not fixed in LoopKit/Loop yet, so better leave it open.

@marionbarker
Copy link
Contributor

This has been fixed in Loop dev branch, dexcom-share-client-swift commit 1faf69f. I do not think any updates to Loop master are planned.
Not sure this should be kept open.

@bjornoleh
Copy link
Contributor Author

There has been mention of adding Dash support to the Loop 2.x line when it is finalised in dev and Loop 3.0 is released. Meaning that there will eventually be a new (final?) release of Loop2.x. Perhaps keep this issue open so it can be fixed for Loop 2.x as well when this happens?

@bjornoleh
Copy link
Contributor Author

Looks like this is fixed in Loop master as well with release 2.2.9

LoopKit/dexcom-share-client-swift@b0a6bd2

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

No branches or pull requests

5 participants