dabear / NightscoutShareServer

NightscoutShareserver - acts as a dexcomshare server, but fetches glucose from nightscout
11 stars 102 forks source link

False BG value sent to Loop when receiver is in error state #4

Closed PJHNS closed 6 years ago

PJHNS commented 6 years ago

I really appreciate the Nightscoutshare Sever - thanks. We have an issue that when the G4 receiver is in an error state (e.g. showing question marks), the raw value might be 4.5 mmol, but the NightscoutShareServer send a false BG reading of 0.6mmol to Loop (which understandably then stops all basal). I wonder whether the value sent should be the raw value, or nothing. Thanks. questionmarks

dabear commented 6 years ago

I may be able to resolve this, but only if you provide me the following output from your site (when the error happens) https://YOUR_NIGHTSCOUT_SITE/api/v1/entries.json?count=20

Please also indicate timestamp when the error happens. I'm not going to support dexcom raw numbers, though, because implementing it is messy and very very dexcom specific.

It might be that your entries collection is actually updated by your dexcom uploader app with those low numbers. If that is the case though, the error is in the uploader app you're using and the problem should be solved there and not in nightscoutshareserver.

PJHNS commented 6 years ago

Thanks very much for the quick response.

I’ll gather that output next time it happens, and let you know.

Kind regards, Justin Hansen

From: dabear Sent: Tuesday, February 13, 2018 10:54 AM To: dabear/NightscoutShareServer Cc: PJHNS ; Author Subject: Re: [dabear/NightscoutShareServer] False BG value sent to Loop when receiver is in error state (#4)

I can resolve this, but only if you provide me the following output from your site (when the error happens) https://YOUR_NIGHTSCOUT_SITE/api/v1/entries.json?count=20

Please also indicate timestamp when the error happens. I'm not going to support dexcom raw numbers, though, because implementing it is messy and very very dexcom specific.

It might be that your entries collection is actually updated by your dexcom uploader app with those low numbers. If that is the case though, the error is in the uploader app your using and the problem should be solved there and not in nightscoutshareserver.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

PJHNS commented 6 years ago

Hi,

I grabbed the entries around the time in question (see below).

The question marks started appearing about midnight, and I can see the “sgv” values drop to about 9 or 10 at that time.

It must be the Dexcom receiver, or the uploader program, as you suggest (any idea which one?), so I will follow that lead now. Or we might switch to xDrip+.

Thanks again for the NightscoutShareServer – we appreciate it.

Kind regards, Justin

{"_id":"5a819c340b2314345b842fd1","device":"dexcom","date":1518443420000,"dateString":"Tue Feb 13 00:50:20 AEDT 2018","sgv":104,"direction":"NOT COMPUTABLE","type":"sgv","filtered":115184,"unfiltered":114848,"rssi":174,"noise":3}, {"_id":"5a819b080b2314345b842961","device":"dexcom","type":"cal","date":1518443120000,"dateString":"Tue Feb 13 00:45:20 AEDT 2018","slope":868.7391755494765,"intercept":20753.55306103197,"scale":1}, {"_id":"5a819b080b2314345b84295c","device":"dexcom","date":1518443120000,"dateString":"Tue Feb 13 00:45:20 AEDT 2018","sgv":103,"direction":"NOT COMPUTABLE","type":"sgv","filtered":114416,"unfiltered":114624,"rssi":174,"noise":3}, {"_id":"5a8199dc0b2314345b8422c2","device":"dexcom","date":1518442820000,"dateString":"Tue Feb 13 00:40:20 AEDT 2018","sgv":10,"direction":"NOT COMPUTABLE","type":"sgv","filtered":110960,"unfiltered":113520,"rssi":173,"noise":4}, {"_id":"5a8199dc0b2314345b8422c6","device":"dexcom","type":"mbg","date":1518442649000,"dateString":"Tue Feb 13 00:37:29 AEDT 2018","mbg":112}, {"_id":"5a8198b00b2314345b841c3d","device":"dexcom","date":1518442520000,"dateString":"Tue Feb 13 00:35:20 AEDT 2018","sgv":10,"direction":"NOT COMPUTABLE","type":"sgv","filtered":104432,"unfiltered":112480,"rssi":175,"noise":4}, {"_id":"5a8197840b2314345b84168e","device":"dexcom","date":1518442220000,"dateString":"Tue Feb 13 00:30:20 AEDT 2018","sgv":10,"direction":"NOT COMPUTABLE","type":"sgv","filtered":97040,"unfiltered":109248,"rssi":175,"noise":4}, {"_id":"5a8196580b2314345b8411f4","device":"dexcom","date":1518441920000,"dateString":"Tue Feb 13 00:25:20 AEDT 2018","sgv":10,"direction":"NOT COMPUTABLE","type":"sgv","filtered":92000,"unfiltered":105008,"rssi":175,"noise":4}, {"_id":"5a81952c0b2314345b840db1","device":"dexcom","date":1518441620000,"dateString":"Tue Feb 13 00:20:20 AEDT 2018","sgv":10,"direction":"NOT COMPUTABLE","type":"sgv","filtered":88256,"unfiltered":96096,"rssi":175,"noise":4}, {"_id":"5a8194010b2314345b84096a","device":"dexcom","date":1518441320000,"dateString":"Tue Feb 13 00:15:20 AEDT 2018","sgv":10,"direction":"NOT COMPUTABLE","type":"sgv","filtered":81360,"unfiltered":81392,"rssi":175,"noise":4}, {"_id":"5a8192d50b2314345b8404e0","device":"dexcom","date":1518441020000,"dateString":"Tue Feb 13 00:10:20 AEDT 2018","sgv":10,"direction":"NOT COMPUTABLE","type":"sgv","filtered":71504,"unfiltered":81760,"rssi":168,"noise":4}, {"_id":"5a8191a90b2314345b84004c","device":"dexcom","date":1518440720000,"dateString":"Tue Feb 13 00:05:20 AEDT 2018","sgv":10,"direction":"NOT COMPUTABLE","type":"sgv","filtered":68560,"unfiltered":87520,"rssi":169,"noise":4}, {"_id":"5a81907d0b2314345b83fbd1","device":"dexcom","date":1518440420000,"dateString":"Tue Feb 13 00:00:20 AEDT 2018","sgv":9,"direction":"NOT COMPUTABLE","type":"sgv","filtered":75472,"unfiltered":88848,"rssi":168,"noise":4}, {"_id":"5a818f500b2314345b83f74a","device":"dexcom","date":1518440120000,"dateString":"Mon Feb 12 23:55:20 AEDT 2018","sgv":77,"direction":"NOT COMPUTABLE","type":"sgv","filtered":86816,"unfiltered":38152,"rssi":168,"noise":3}, {"_id":"5a818e240b2314345b83f2dd","device":"dexcom","date":1518439820000,"dateString":"Mon Feb 12 23:50:20 AEDT 2018","sgv":85,"direction":"Flat","type":"sgv","filtered":93552,"unfiltered":84848,"rssi":169,"noise":2}, {"_id":"5a818cf80b2314345b83ee76","device":"dexcom","date":1518439520000,"dateString":"Mon Feb 12 23:45:20 AEDT 2018","sgv":89,"direction":"Flat","type":"sgv","filtered":92048,"unfiltered":96896,"rssi":169,"noise":1}, {"_id":"5a818bcc0b2314345b83ea09","device":"dexcom","date":1518439220000,"dateString":"Mon Feb 12 23:40:20 AEDT 2018","sgv":85,"direction":"Flat","type":"sgv","filtered":88736,"unfiltered":93136,"rssi":173,"noise":1}, {"_id":"5a818aa00b2314345b83e559","device":"dexcom","date":1518438920000,"dateString":"Mon Feb 12 23:35:20 AEDT 2018","sgv":82,"direction":"Flat","type":"sgv","filtered":86032,"unfiltered":90768,"rssi":167,"noise":1},

From: dabear Sent: Tuesday, February 13, 2018 10:54 AM To: dabear/NightscoutShareServer Cc: PJHNS ; Author Subject: Re: [dabear/NightscoutShareServer] False BG value sent to Loop when receiver is in error state (#4)

I can resolve this, but only if you provide me the following output from your site (when the error happens) https://YOUR_NIGHTSCOUT_SITE/api/v1/entries.json?count=20

Please also indicate timestamp when the error happens. I'm not going to support dexcom raw numbers, though, because implementing it is messy and very very dexcom specific.

It might be that your entries collection is actually updated by your dexcom uploader app with those low numbers. If that is the case though, the error is in the uploader app your using and the problem should be solved there and not in nightscoutshareserver.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

dabear commented 6 years ago

The entries are in mgdl format. For example, at 00:50:20 AEDT 2018 your bloodsugar in mmol was 104mgdl/18=5.8mmol. If you see around 00:20, your glucose was 9 mgdl. If you apply the the same formula and divide by 18, your bloodsugars were 9mgdl/18=0,45mmol.

From your data it seems likely that a fix must be done in the app that uploads to your nightscout site. The only way for me to distinguish data these erroneous data would be to look at the direction column and filter out those glucose entries that have a direction "NOT_COMPUTABLE", but that would be kind of a hack I don't want to do.

If you feel like doing it your self though, you could look into https://github.com/dabear/NightscoutShareServer/blob/master/NightscoutShareServer/Controllers/GlucoseController.cs#L128 and da a "continue" if trend is not computable. That would ignore any such entries.

NB! Not a solution I would support!