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

OpenAPS uses meter BG to determine glucose value (null) #1265

Closed
PaperT1D opened this issue May 31, 2019 · 7 comments
Closed

OpenAPS uses meter BG to determine glucose value (null) #1265

PaperT1D opened this issue May 31, 2019 · 7 comments

Comments

@PaperT1D
Copy link

Describe the bug
OpenAPS ignores current CGM glucose and instead takes glucose from a recent Nightscout meter BG entry and returns

{"delta":0,"glucose":null,"noise":null,"short_avgdelta":0,"long_avgdelta":0,"date":1559272410581,"last_cal":167}
null
No deliverAt found.
{"reason":"Error: CGM data is unchanged for the past ~45m. Temp 0 <= current basal 0.65U/hr; doing nothing. "}

To Reproduce
Steps to reproduce the behavior:

  1. Checked BG with Contour Next One, which is connected to xDrip and uploads to Nightscout. (Note: Not a calibration.)
  2. Noticed CGM unchanged error and checked glucose.json for most recent values.

Expected behavior
I don't think the loop should be taking Nightscout non-calibration meter BG entries into consideration for looping.

Setup Information (please complete the following information):

  • Medtronic 723 2.4A firmware
  • Dexcom G5
  • Explorer HAT
  • 0.7.0-dev

Additional context

Starting oref0-pump-loop at Thu 30 May 23:10:22 EDT 2019 with 9 second wait_for_silence:
Waiting up to 4 minutes for new BG: glucose.json newer than pump_loop_completed

Listening for 9s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Thu 30 May 23:10:34 EDT 2019
Preflight OK. Profile less than 60m old; Profile valid. Pump history updated through 2019-05-30T22:59:31-04:00 with 0 new records; meal.json refreshed: {"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":7,"currentDeviation":3.53,"maxDeviation":18.27,"minDeviation":-0.76,"slopeFromMaxDeviation":-2.65,"slopeFromMinDeviation":1.675,"allDeviations":[4,7,-1,5,9,18],"lastCarbTime":1559267163000,"bwFound":false}
Listening for 4s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Thu 30 May 23:11:49 EDT 2019
Checking that pump clock: "2019-05-30T23:11:45-04:00" is within 90s of current time: 2019-05-30T23:11:51-0400
Temp refreshed: monitor/temp_basal.json: {"duration":109,"temp":"absolute","rate":0}
{"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":7,"currentDeviation":3.53,"maxDeviation":18.27,"minDeviation":-0.76,"slopeFromMaxDeviation":-2.65,"slopeFromMinDeviation":1.675,"allDeviations":[4,7,-1,5,9,18],"lastCarbTime":1559267163000,"bwFound":false}
Autotune exists! Hoorah! You can use microbolus-related features.
{"iob":1.997,"activity":0.0163,"basaliob":-0.752,"bolusiob":2.749,"netbasalinsulin":-1.75,"bolusinsulin":3.8,"time":"2019-05-31T03:11:49.000Z","iobWithZeroTemp":{"iob":1.997,"activity":0.0163,"basaliob":-0.752,"bolusiob":2.749,"netbasalinsulin":-1.75,"bolusinsulin":3.8,"time":"2019-05-31T03:11:49.000Z"},"lastBolusTime":1559271029000,"lastTemp":{"rate":0,"timestamp":"2019-05-30T22:59:31-04:00","started_at":"2019-05-31T02:59:31.000Z","date":1559271571000,"duration":13.3}}
{"delta":2,"glucose":179,"noise":1,"short_avgdelta":3.33,"long_avgdelta":4.74,"date":1559272067324,"last_cal":165}
Autosens ratio: 1.09; Adjusting basal from 0.65 to 0.7; ISF from 62.9 to 57.7; CR: 15.068
currenttemp: { duration: 109, temp: 'absolute', rate: 0 } lastTempAge: 13 m tempModulus: 2 m
SMB enabled due to enableSMB_always
profile.sens: 62.926 sens: 57.7 CSF: 3.829307140960977
Last carbs 87 minutes ago; remainingCATime: 4.9 hours; 84% carbs absorbed
Carb Impact: 6.7 mg/dL per 5m; CI Duration: 0.7 hours; remaining CI (~2h peak): 0 mg/dL per 5m
predCIs (mg/dL/5m): 6 5 4 3 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
remainingCIs:       0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
UAM Impact: 6.7 mg/dL per 5m; UAM Duration: 0.3 hours
minPredBG: 98 minIOBPredBG: 98 minZTGuardBG: 107 minCOBPredBG: 85 minUAMPredBG: 67 avgPredBG: 107 COB: 7 / 45
BG projected to remain above 100 for 145 minutes
naive_eventualBG: 64 bgUndershoot: 6 zeroTempDuration: 240 zeroTempEffect: 145 carbsReq: -36
IOB 1.997 > COB 7; mealInsulinReq = 0.465
profile.maxUAMSMBBasalMinutes: 30 profile.current_basal: 0.627
naive_eventualBG 64, 30m 0U/h temp needed; last bolus 22.5m ago; maxBolus: 0.3
2019-05-31T03:12:57.079Z
Checking deliverAt: 2019-05-31T03:12:57.079Z is within 1m of current time: Thu 30 May 23:12:58 EDT 2019
and that smb-suggested.json is less than 1m old
enact/smb-suggested.json: {"temp":"absolute","bg":179,"tick":"+2","eventualBG":104,"insulinReq":-0.03,"reservoir":"9.8\n","deliverAt":"2019-05-31T03:12:57.079Z","sensitivityRatio":1.09,"COB":7,"IOB":1.997,"rate":0,"duration":30}
"COB: 7, Dev: 40, BGI: -5, ISF: 58, CR: 15.07, Target: 100, minPredBG 98, minGuardBG 70, IOBpredBG 99, COBpredBG 85, UAMpredBG 67; Eventual BG 104 >= 100,  insulinReq -0.03; setting 30m low temp of 0U/h. "
COB: [179,180,180,180,178,176,173,169,164,159,155,151,146,142,138,135,131,128,124,121,118,116,113,110,108,106,104,102,100,99,97,96,94,93,92,91,90,90,89,88,88,87,87,86,86,86,85]
UAM: [179,178,175,170,165,160,155,151,146,141,137,133,128,124,120,117,113,110,106,103,100,98,95,92,90,88,86,84,82,81,79,78,76,75,74,73,72,72,71,70,70,69,69,68,68,68,67]
IOB: [179,180,181,181,181,180,178,176,174,171,168,164,160,156,152,148,144,141,138,135,132,129,126,124,122,119,117,116,114,112,111,109,108,107,106,105,104,103,102,102,101,100,100,100,99]
ZT:  [179,174,170,165,160,155,151,146,142,138,134,130,127,124,121,118,116,114,112,111,110,109,108,108,107,108,108,108]
Temp refreshed: monitor/temp_basal.json: {"duration":108,"temp":"absolute","rate":0}
enact/smb-enacted.json: "Rate: 0 Duration: 30"
Checking pump status (suspended/bolusing): {"status":"normal","bolusing":false,"suspended":false}
Temp refreshed: monitor/temp_basal.json: {"duration":30,"temp":"absolute","rate":0}
No bolus needed. Settings less than 15 minutes old. Refreshing pumphistory because: enacted, Pump profile refreshed; Settings refreshed; Pump history updated through 2019-05-30T23:13:00-04:00 with 2 new records; meal.json refreshed: {"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":7,"currentDeviation":3.53,"maxDeviation":8.6,"minDeviation":-0.76,"slopeFromMaxDeviation":-0.953,"slopeFromMinDeviation":1.291,"allDeviations":[4,7,-1,5,9],"lastCarbTime":1559267163000,"bwFound":false}
{"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":7,"currentDeviation":3.53,"maxDeviation":8.6,"minDeviation":-0.76,"slopeFromMaxDeviation":-0.953,"slopeFromMinDeviation":1.291,"allDeviations":[4,7,-1,5,9],"lastCarbTime":1559267163000,"bwFound":false}
IOB: 1.902
Your instance of oref0 [0.7.0-dev, dev] is up-to-date.
Completed oref0-pump-loop at Thu 30 May 23:15:48 EDT 2019
"HAT Display Updated"


Starting oref0-pump-loop at Thu 30 May 23:16:20 EDT 2019 with 22 second wait_for_silence:
Waiting up to 4 minutes for new BG: glucose.json newer than pump_loop_completed

Listening for 22s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Thu 30 May 23:16:44 EDT 2019
Preflight OK. Profile less than 60m old; Profile valid. Pump history updated through 2019-05-30T23:13:00-04:00 with 0 new records; meal.json Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 45 myCarbsAbsorbed: NaN
Could not determine last BG time
refreshed: {"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviation":null,"maxDeviation":8.6,"minDeviation":-0.76,"slopeFromMaxDeviation":null,"slopeFromMinDeviation":null,"allDeviations":[null,4,7,-1,5,9],"lastCarbTime":1559267163000,"bwFound":false}
Listening for 2s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Thu 30 May 23:18:19 EDT 2019
Checking that pump clock: "2019-05-30T23:18:16-04:00" is within 90s of current time: 2019-05-30T23:18:21-0400
Temp refreshed: monitor/temp_basal.json: {"duration":26,"temp":"absolute","rate":0}
{"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviation":null,"maxDeviation":8.6,"minDeviation":-0.76,"slopeFromMaxDeviation":null,"slopeFromMinDeviation":null,"allDeviations":[null,4,7,-1,5,9],"lastCarbTime":1559267163000,"bwFound":false}
Autotune exists! Hoorah! You can use microbolus-related features.
{"iob":1.835,"activity":0.0167,"basaliob":-0.769,"bolusiob":2.604,"netbasalinsulin":-1.7,"bolusinsulin":3.8,"time":"2019-05-31T03:18:21.000Z","iobWithZeroTemp":{"iob":1.835,"activity":0.0167,"basaliob":-0.769,"bolusiob":2.604,"netbasalinsulin":-1.7,"bolusinsulin":3.8,"time":"2019-05-31T03:18:21.000Z"},"lastBolusTime":1559271029000,"lastTemp":{"rate":0,"timestamp":"2019-05-30T23:13:00-04:00","started_at":"2019-05-31T03:13:00.000Z","date":1559272380000,"duration":6.35}}
{"delta":0,"glucose":null,"noise":null,"short_avgdelta":0,"long_avgdelta":0,"date":1559272410581,"last_cal":167}
null
No deliverAt found.
{"reason":"Error: CGM data is unchanged for the past ~45m. Temp 0 <= current basal 0.65U/hr; doing nothing. "}
Couldn't smb_verify_suggested
oref0-pump-loop failed. Listening for 21 s silence before mmtuning: Listening for 21s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Thu 30 May 23:19:52 EDT 2019
mmtune: "916.550", 3, -55
No wait required.
If pump and rig are close enough, this error usually self-resolves. Stand by for the next loop.
Unsuccessful oref0-pump-loop at Thu 30 May 23:20:34 EDT 2019
"HAT Display Updated"


Starting oref0-pump-loop at Thu 30 May 23:21:20 EDT 2019 with 21 second wait_for_silence:
Waiting up to 4 minutes for new BG: glucose.json newer than pump_loop_completed

Listening for 21s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Thu 30 May 23:21:44 EDT 2019
Preflight OK. Profile less than 60m old; Profile valid. Pump history updated through 2019-05-30T23:13:00-04:00 with 0 new records; meal.json refreshed: {"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":4,"currentDeviation":-0.83,"maxDeviation":6.57,"minDeviation":-0.76,"slopeFromMaxDeviation":-1.954,"slopeFromMinDeviation":0,"allDeviations":[-1,4,4,7,-1,5],"lastCarbTime":1559267163000,"bwFound":false}
Listening for 4s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Thu 30 May 23:22:40 EDT 2019
Checking that pump clock: "2019-05-30T23:22:37-04:00" is within 90s of current time: 2019-05-30T23:22:42-0400
Temp refreshed: monitor/temp_basal.json: {"duration":22,"temp":"absolute","rate":0}
{"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":4,"currentDeviation":-0.83,"maxDeviation":6.57,"minDeviation":-0.76,"slopeFromMaxDeviation":-1.954,"slopeFromMinDeviation":0,"allDeviations":[-1,4,4,7,-1,5],"lastCarbTime":1559267163000,"bwFound":false}
Autotune exists! Hoorah! You can use microbolus-related features.
{"iob":1.714,"activity":0.0167,"basaliob":-0.796,"bolusiob":2.51,"netbasalinsulin":-1.7,"bolusinsulin":3.8,"time":"2019-05-31T03:22:40.000Z","iobWithZeroTemp":{"iob":1.714,"activity":0.0167,"basaliob":-0.796,"bolusiob":2.51,"netbasalinsulin":-1.7,"bolusinsulin":3.8,"time":"2019-05-31T03:22:40.000Z"},"lastBolusTime":1559271029000,"lastTemp":{"rate":0,"timestamp":"2019-05-30T23:13:00-04:00","started_at":"2019-05-31T03:13:00.000Z","date":1559272380000,"duration":10.67}}
{"delta":-6,"glucose":173,"noise":1,"short_avgdelta":-3.44,"long_avgdelta":1.21,"date":1559272667638,"last_cal":168}
Autosens ratio: 1.09; Adjusting basal from 0.65 to 0.7; ISF from 62.9 to 57.7; CR: 15.068
currenttemp: { duration: 22, temp: 'absolute', rate: 0 } lastTempAge: 11 m tempModulus: 3 m
SMB enabled due to enableSMB_always
profile.sens: 62.926 sens: 57.7 CSF: 3.829307140960977
Last carbs 98 minutes ago; remainingCATime: 5.2 hours; 91% carbs absorbed
Carb Impact: -1.2 mg/dL per 5m; CI Duration: 0 hours; remaining CI (~2h peak): 0.5 mg/dL per 5m
predCIs (mg/dL/5m): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
remainingCIs:       0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
UAM Impact: -1.2 mg/dL per 5m; UAM Duration: 0 hours
minPredBG: 87 minIOBPredBG: 65 minZTGuardBG: 111 minCOBPredBG: 78 minUAMPredBG: 65 avgPredBG: 111 COB: 4 / 45
minGuardBG 66 projected below 70 - disabling SMB
BG projected to remain above 100 for 90 minutes
naive_eventualBG: 74 bgUndershoot: -4 zeroTempDuration: 240 zeroTempEffect: 145 carbsReq: -39
2019-05-31T03:23:48.798Z
Checking deliverAt: 2019-05-31T03:23:48.798Z is within 1m of current time: Thu 30 May 23:23:49 EDT 2019
and that smb-suggested.json is less than 1m old
enact/smb-suggested.json: {"temp":"absolute","bg":173,"tick":-6,"eventualBG":82,"insulinReq":0,"reservoir":"9.8\n","deliverAt":"2019-05-31T03:23:48.798Z","sensitivityRatio":1.09,"COB":4,"IOB":1.714,"duration":60,"rate":0}
"COB: 4, Dev: 8, BGI: -5, ISF: 58, CR: 15.07, Target: 100, minPredBG 87, minGuardBG 66, IOBpredBG 65, COBpredBG 79, UAMpredBG 65; minGuardBG 66<70"
COB: [173,167,161,156,150,145,140,135,131,126,122,119,115,112,109,106,103,100,98,96,93,92,90,88,87,85,84,83,82,81,81,80,80,79,79,78,78,78,78,78,78,78,78,78,78,78,78,79]
UAM: [173,167,161,156,150,145,140,135,130,126,121,118,114,110,107,104,101,98,95,93,90,88,86,84,82,80,79,77,76,74,73,72,71,70,70,69,68,68,67,67,66,66,66,66,65]
IOB: [173,167,161,156,150,145,140,135,130,126,121,118,114,110,107,104,101,98,95,93,90,88,86,84,82,80,79,77,76,74,73,72,71,70,70,69,68,68,67,67,66,66,66,66,65]
ZT:  [173,168,163,159,154,150,145,141,137,134,130,127,125,122,120,118,116,115,113,112,112,111,111,111,111,112,112]
Temp refreshed: monitor/temp_basal.json: {"duration":21,"temp":"absolute","rate":0}
enact/smb-enacted.json: "Rate: 0 Duration: 60"
Checking pump status (suspended/bolusing): {"status":"normal","bolusing":false,"suspended":false}
Temp refreshed: monitor/temp_basal.json: {"duration":60,"temp":"absolute","rate":0}
No bolus needed. Settings less than 15 minutes old. Refreshing pumphistory because: enacted, Pump profile refreshed; Settings refreshed; Pump history updated through 2019-05-30T23:23:51-04:00 with 2 new records; meal.json refreshed: {"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":4,"currentDeviation":-0.83,"maxDeviation":6.57,"minDeviation":-0.76,"slopeFromMaxDeviation":-1.652,"slopeFromMinDeviation":0,"allDeviations":[-1,4,4,7,-1],"lastCarbTime":1559267163000,"bwFound":false}
{"carbs":45,"nsCarbs":45,"bwCarbs":0,"journalCarbs":0,"mealCOB":4,"currentDeviation":-0.83,"maxDeviation":6.57,"minDeviation":-0.76,"slopeFromMaxDeviation":-1.652,"slopeFromMinDeviation":0,"allDeviations":[-1,4,4,7,-1],"lastCarbTime":1559267163000,"bwFound":false}
IOB: 1.623
Your instance of oref0 [0.7.0-dev, dev] is up-to-date.
Completed oref0-pump-loop at Thu 30 May 23:27:01 EDT 2019
"HAT Display Updated"
  {
    "glucose": 173,
    "direction": "FortyFiveDown",
    "noise": 1,
    "sysTime": "2019-05-30T23:17:47.638-0400",
    "dateString": "2019-05-30T23:17:47.638000-04:00",
    "sgv": 173,
    "date": 1559272667638,
    "unfiltered": 223589.21194421055,
    "delta": -6.292,
    "device": "xDrip-DexcomG5",
    "filtered": 228007.51150421053,
    "_id": "5cf09cddca5159d510bfd217",
    "type": "sgv",
    "rssi": 100
  },
  {
    "mbg": 177,
    "dateString": "2019-05-30T23:13:30.581000-04:00",
    "date": 1559272410581,
    "sysTime": "2019-05-30T23:13:30.581-0400",
    "device": "Bluetooth Glucose Meter:\nAscensiaDiabetesCare\u0000   00:81:F9:58:E3:01",
    "_id": "5cf09bf0ca5159d510bf9ab1",
    "type": "mbg",
    "glucose": null
  },
  {
    "glucose": 179,
    "direction": "Flat",
    "noise": 1,
    "sysTime": "2019-05-30T23:12:50.347-0400",
    "dateString": "2019-05-30T23:12:50.347000-04:00",
    "sgv": 179,
    "date": 1559272370347,
    "unfiltered": 229324.42206236842,
    "delta": 0.625,
    "device": "xDrip-DexcomG5",
    "filtered": 225329.76360263157,
    "_id": "5cf09bb3ca5159d510bf9778",
    "type": "sgv",
    "rssi": 100
  },
@scottleibrand
Copy link
Contributor

This should only occur if your meter uploads "glucose": null, which I don't think it should do. How is meter BG being uploaded in this case?

Also, it will only result in Error: CGM data is unchanged for up to 5 minutes after the mbg record is uploaded: once the most recent record is a normal CGM record, it should go back to looping normally.

That said, if you'd like to test a fix for this, I just pushed https://github.com/openaps/oref0/tree/ignore-glucose-null - if you can confirm that it allows looping off the last CGM reading even when there's a more recent MBG record, we can open a PR to merge it to dev.

@sulkaharo
Copy link
Collaborator

@PaperT1D which uploader application do you use? This should be fixed in the uploader (and I'd love to know so I can add better data checking to Nightscout).

@scottleibrand feel free to tag me in any Nightscout data quality tickets going forward if I don't notice them

@PaperT1D
Copy link
Author

PaperT1D commented Jun 3, 2019

I am using xDrip+ and a Contour Next One meter, which is Bluetooth connected to automatically add meter BG entries to xDrip. While mbg had a value, it showed "glucose": null in glucose.json. It did only cause one loop to fail which I am not at all upset about and can definitely live with, but I figured it wasn't working as it was intended to.

I will give the fix a test in the next day or two. Thanks!

@danamlewis
Copy link
Contributor

@PaperT1D did you get around to testing this?

@PaperT1D
Copy link
Author

PaperT1D commented Oct 28, 2019 via email

@PaperT1D
Copy link
Author

Well, it looks like this didn't fix it. The mbg still takes priority. I attempted to reproduce this multiple times, but other issues I'm having with my rig seem to be getting in the way, so I could only see the error happening once in two back to back loops. My other issues are basically a bit in the way of testing at the moment. Here is what I could get, though.

BG projected to remain above 100 for 90 minutes
naive_eventualBG: 4 bgUndershoot: 66 zeroTempDuration: 240 zeroTempEffect: 156 carbsReq: -25
2019-10-29T01:42:32.445Z
Checking deliverAt: 2019-10-29T01:42:32.445Z is within 1m of current time: Mon 28 Oct 20:42:32 CDT 2019
and that smb-suggested.json is less than 1m old
enact/smb-suggested.json: {"temp":"absolute","bg":195,"tick":-6,"eventualBG":137,"insulinReq":0,"reservoir":"55.3\n","deliverAt":"2019-10-29T01:42:32.445Z","sensitivityRatio":1,"COB":32,"IOB":3.177}
"COB: 32, Dev: 17, BGI: -12, ISF: 60, CR: 12, Target: 100, minPredBG 77, minGuardBG 63, IOBpredBG 39, COBpredBG 137, UAMpredBG 48; minGuardBG 63<70 109m left and 0 ~ req 0U/hr: no temp required"
COB: [195,186,177,169,161,154,147,141,135,129,124,119,115,111,108,105,102,100,98,97,96,95,94,94,94,95,95,96,97,98,100,102,104,106,108,110,112,115,117,119,122,124,126,129,131,133,135,137]
UAM: [195,186,177,169,160,153,145,138,131,125,119,113,108,103,98,94,90,86,83,79,76,74,71,69,67,65,63,61,60,59,57,56,55,54,53,52,52,51,50,50,50,49,49,49,48]IOB: [195,186,177,168,159,150,142,134,126,118,110,103,96,89,82,77,71,66,61,56,52,48,45,41,39]
ZT:  [195,183,172,161,150,140,131,121,113,105,97,90,84,78,73,68,63,59,56,53,50,48,46,44,43,42,42,42,42,42,43,43,44,46,47,49,51,53,55,57,59,62,64,67,70,72,75,78]
No smb_enact needed. Checking pump status (suspended/bolusing): {"status":"normal","bolusing":false,"suspended":false}
Temp refreshed: monitor/temp_basal.json: {"duration":108,"temp":"absolute","rate":0}
No bolus needed. jq: error: Could not open file monitor/edison-battery.json: No such file or directory
Settings less than 15 minutes old. grep: enact/bolused.json: No such file or directory
Your instance of oref0 [0.7.0-dev, ignore-glucose-null] is up-to-date.
Completed oref0-pump-loop at Mon 28 Oct 20:42:34 CDT 2019


Starting oref0-pump-loop at Mon 28 Oct 20:43:03 CDT 2019 with 3 second wait_for_silence:
Waiting up to 4 minutes for new BG: .glucose.json newer than pump_loop_completed

Listening for 3s: ......No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Mon 28 Oct 20:43:27 CDT 2019
Preflight OK. Profile less than 60m old; Profile valid. Pump history update failed. Last record 2019-10-28T20:29:18-05:00
Couldn't invoke_pumphistory_etc - continuing
Retry 1 of refresh_pumphistory_and_meal
Pump history update failed. Last record 2019-10-28T20:29:18-05:00
Couldn't invoke_pumphistory_etc - continuing
Listening for 8s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Mon 28 Oct 20:44:01 CDT 2019
Retry 2 of refresh_pumphistory_and_meal
Pump history updated through 2019-10-28T20:29:18-05:00 with 0 new records; Couldn't invoke_reservoir_etc - continuing
Listening for 3s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Mon 28 Oct 20:44:10 CDT 2019
Retry 3 of refresh_pumphistory_and_meal
Pump history updated through 2019-10-28T20:29:18-05:00 with 0 new records; meal.json Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 25 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 45 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 100 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 126 myCarbsAbsorbed: NaN
Could not determine last BG time
refreshed: {"carbs":126,"nsCarbs":126,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviation":null,"maxDeviation":0,"minDeviation":-10.33,"slopeFromMaxDeviation":0,"slopeFromMinDeviation":null,"allDeviations":[null,-10,-7,-6,-4],"lastCarbTime":1572307016472,"bwFound":false}
Listening for 8s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Mon 28 Oct 20:44:25 CDT 2019
Checking that pump clock: "2019-10-28T20:43:54-05:00" is within 90s of current time: 2019-10-28T20:44:26-0500
Temp refreshed: monitor/temp_basal.json: {"duration":107,"temp":"absolute","rate":0}
{"carbs":126,"nsCarbs":126,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviation":null,"maxDeviation":0,"minDeviation":-10.33,"slopeFromMaxDeviation":0,"slopeFromMinDeviation":null,"allDeviations":[null,-10,-7,-6,-4],"lastCarbTime":1572307016472,"bwFound":false}
Autotune exists! Hoorah! You can use microbolus-related features.
{"iob":3.111,"activity":0.0389,"basaliob":-1.07,"bolusiob":4.181,"netbasalinsulin":-2.25,"bolusinsulin":12.6,"time":"2019-10-29T01:43:55.000Z","iobWithZeroTemp":{"iob":3.111,"activity":0.0389,"basaliob":-1.07,"bolusiob":4.181,"netbasalinsulin":-2.25,"bolusinsulin":12.6,"time":"2019-10-29T01:43:55.000Z"},"lastBolusTime":1572312347000,"lastTemp":{"rate":0,"timestamp":"2019-10-28T20:29:18-05:00","started_at":"2019-10-29T01:29:18.000Z","date":1572312558000,"duration":15.62}}
{"delta":0,"glucose":null,"noise":null,"short_avgdelta":0,"long_avgdelta":0,"date":1572313378796,"last_cal":0}
2019-10-29T01:44:29.301Z
Checking deliverAt: 2019-10-29T01:44:29.301Z is within 1m of current time: Mon 28 Oct 20:44:29 CDT 2019
and that smb-suggested.json is less than 1m old
enact/smb-suggested.json: {"deliverAt":"2019-10-29T01:44:29.301Z","temp":"absolute","duration":30,"rate":0}
"Error: CGM data is unchanged for the past ~45m. Shortening 107m long zero temp to 30m. "
Temp refreshed: monitor/temp_basal.json: {"duration":107,"temp":"absolute","rate":0}
enact/smb-enacted.json: "Rate: 0 Duration: 30"
Checking pump status (suspended/bolusing): {"status":"normal","bolusing":false,"suspended":false}
Temp refreshed: monitor/temp_basal.json: {"duration":30,"temp":"absolute","rate":0}
No bolus needed. jq: error: Could not open file monitor/edison-battery.json: No such file or directory
Settings less than 15 minutes old. grep: enact/bolused.json: No such file or directory
Refreshing pumphistory because: enacted, Pump profile refreshed; Could not parse autotune_data
Could not parse temptargets_data.
No temptargets found.
Settings refreshed; Pump history updated through 2019-10-28T20:43:58-05:00 with 2 new records; meal.json Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 25 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 45 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 100 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 126 myCarbsAbsorbed: NaN
Could not determine last BG time
refreshed: {"carbs":126,"nsCarbs":126,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviation":null,"maxDeviation":0,"minDeviation":-10.33,"slopeFromMaxDeviation":0,"slopeFromMinDeviation":null,"allDeviations":[null,-10,-7,-6,-4],"lastCarbTime":1572307016472,"bwFound":false}
{"carbs":126,"nsCarbs":126,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviation":null,"maxDeviation":0,"minDeviation":-10.33,"slopeFromMaxDeviation":0,"slopeFromMinDeviation":null,"allDeviations":[null,-10,-7,-6,-4],"lastCarbTime":1572307016472,"bwFound":false}
IOB: null
Your instance of oref0 [0.7.0-dev, ignore-glucose-null] is up-to-date.
Completed oref0-pump-loop at Mon 28 Oct 20:44:47 CDT 2019


Starting oref0-pump-loop at Mon 28 Oct 20:45:02 CDT 2019 with 4 second wait_for_silence:
Waiting up to 4 minutes for new BG: ..glucose.json newer than pump_loop_completed

Listening for 4s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Mon 28 Oct 20:45:29 CDT 2019
Preflight OK. Profile less than 60m old; Profile valid. Pump history updated through 2019-10-28T20:43:58-05:00 with 0 new records; meal.json Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 25 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 45 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 100 myCarbsAbsorbed: NaN
Could not determine last BG time
Bad myMealCOB: NaN mealCOB: 0 carbs: 126 myCarbsAbsorbed: NaN
Could not determine last BG time
refreshed: {"carbs":126,"nsCarbs":126,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviation":null,"maxDeviation":0,"minDeviation":-10.33,"slopeFromMaxDeviation":0,"slopeFromMinDeviation":null,"allDeviations":[null,-10,-7,-6,-4],"lastCarbTime":1572307016472,"bwFound":false}
Listening for 8s: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Mon 28 Oct 20:45:48 CDT 2019
Checking that pump clock: "2019-10-28T20:45:16-05:00" is within 90s of current time: 2019-10-28T20:45:48-0500
Temp refreshed: monitor/temp_basal.json: {"duration":29,"temp":"absolute","rate":0}
{"carbs":126,"nsCarbs":126,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviation":null,"maxDeviation":0,"minDeviation":-10.33,"slopeFromMaxDeviation":0,"slopeFromMinDeviation":null,"allDeviations":[null,-10,-7,-6,-4],"lastCarbTime":1572307016472,"bwFound":false}
Autotune exists! Hoorah! You can use microbolus-related features.
{"iob":2.997,"activity":0.0386,"basaliob":-1.108,"bolusiob":4.104,"netbasalinsulin":-2.3,"bolusinsulin":12.6,"time":"2019-10-29T01:45:17.000Z","iobWithZeroTemp":{"iob":2.997,"activity":0.0386,"basaliob":-1.108,"bolusiob":4.104,"netbasalinsulin":-2.3,"bolusinsulin":12.6,"time":"2019-10-29T01:45:17.000Z"},"lastBolusTime":1572312347000,"lastTemp":{"rate":0,"timestamp":"2019-10-28T20:43:58-05:00","started_at":"2019-10-29T01:43:58.000Z","date":1572313438000,"duration":2.32}}
{"delta":0,"glucose":null,"noise":null,"short_avgdelta":0,"long_avgdelta":0,"date":1572313378796,"last_cal":0}
null
No deliverAt found.
{"reason":"Error: CGM data is unchanged for the past ~45m. Temp 0 <= current basal 0.65U/hr; doing nothing. "}
Couldn't smb_verify_suggested
oref0-pump-loop failed. If pump and rig are close enough, this error usually self-resolves. Stand by for the next loop.
Unsuccessful oref0-pump-loop at Mon 28 Oct 20:45:52 CDT 2019
  {
    "glucose": 193,
    "direction": "FortyFiveDown",
    "noise": 1,
    "sysTime": "2019-10-29T01:43:01.892Z",
    "dateString": "2019-10-28T20:43:01.892000-05:00",
    "sgv": 193,
    "date": 1572313381892,
    "utcOffset": -300,
    "unfiltered": 199274,
    "delta": -1.997,
    "device": "xDrip-DexcomG5",
    "filtered": 207978,
    "_id": "5db79964ca5159d510eb90c2",
    "type": "sgv",
    "rssi": 100
  },
  {
    "mbg": 189,
    "dateString": "2019-10-28T20:42:58.796000-05:00",
    "date": 1572313378796,
    "utcOffset": -300,
    "sysTime": "2019-10-29T01:42:58.796Z",
    "device": "Bluetooth Glucose Meter:\nAscensiaDiabetesCare\u0000   00:81:F9:58:E3:01",
    "_id": "5db79927ca5159d510eb9010",
    "type": "mbg",
    "glucose": null
  },
  {
    "glucose": 195,
    "direction": "FortyFiveDown",
    "noise": 1,
    "sysTime": "2019-10-29T01:38:01.384Z",
    "dateString": "2019-10-28T20:38:01.384000-05:00",
    "sgv": 195,
    "date": 1572313081384,
    "utcOffset": -300,
    "unfiltered": 203184,
    "delta": -6.017,
    "device": "xDrip-DexcomG5",
    "filtered": 217192,
    "_id": "5db797feca5159d510eb8ce3",
    "type": "sgv",
    "rssi": 100
  },

@jakobsandberg
Copy link
Contributor

Opened a PR to fix this issue: #1328

I added a test to replicate your scenario, and the fix seems to work. I'll run it on my rig in the meantime to catch any potential regression.

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