Skip to content

G7 15 day stops reading at 10.5 days #702

@SurfBurger

Description

@SurfBurger

Currently the app stops reading Dexcom G7 15 day sensors at 10.5 days. The sensor is still active and can be read in the Dexcom app, but xDrip doesn't display the readings. I'm not a great coder so I'm not confident in my ability to make a pull request, but I skimmed through the files and it looks like it's hardcoded in the app to cut off the G7 at 10.5 days in lines 315-320 of /xdrip/BluetoothTransmitter/CGM/Dexcom/G7/CGMG7Transmitter.swift

// G7/ONE+/Stelo has the peculiarity that it will keep sending/repeating the same BG value (without ever changing) via BLE even after the session officially ends.
// to avoid this, let's check if the sensor is still within maxSensorAge before we continue
if sensorAgeInDays > maxSensorAgeInDays {
     trace("    %{public}@ is expired so will not process reading. sensorAge: %{public}@ / maxSensorAgeInDays: %{public}@", log: log, category: ConstantsLog.categoryCGMG7, type: .error, UserDefaults.standard.activeSensorTransmitterId ?? "sensor", sensorAgeInDays.description, maxSensorAgeInDays.description)
     return
}

A few ideas for solutions:

  1. Put a switch in settings that changes the value of ConstantsDexcomG7.maxSensorAgeInDays if the user says they are using the 15 day sensor

  2. Add an if statement to the above lines that checks if any of the BG values generated after maxSensorAgeInDays are different than the previous readings, and if so this probably means that this is a 15 day sensor that's still reading

  3. (This would probably entail more work) it looks like the folks over at LoopKit had some issues distinguishing the 10 day from the 15 day and solved it (automatically) here: Support Needed for G7 Extended Wear Sensors LoopKit/G7SensorKit#45

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions