These are chat archives for nightscout/intend-to-bolus

4th
Nov 2015
Oskar Pearson
@oskarpearson
Nov 04 2015 00:11
Hey all. I was wondering if anyone had any suggestions on how to resolve something:
Currently, openaps doesn’t seem to be fetching recent glucose information.
It’s been stopped for about 150 minutes
The front of the pump shows current readings as a-ok
Scott Leibrand
@scottleibrand
Nov 04 2015 00:12
you're pulling from MDT CGM right?
I've seen people talking about having issues when pages turn over
Oskar Pearson
@oskarpearson
Nov 04 2015 00:13
Yeah
I’m pretty sure it’s a page issue
[report "recent_glucose.json"]
device = pump
hours = 1.0
use = iter_glucose_hours
reporter = JSON
I’ve tried with a variety of hours - 1, 2, 6
Previously I had a similar problem with the page data of pump actions
so we pressed a bunch of buttons and did actions and cancelled them until the page flipped over and data started flowing
I’m not sure if there’s a similar trick with glucose data
This returns a-ok (just not with recent data):
openaps use pump iter_glucose 10
As does openaps use pump iter_glucose 2
but openaps use pump iter_glucose 1 gives this:
Scott Leibrand
@scottleibrand
Nov 04 2015 00:16
this sounds like a question for @bewest or @loudnate
Oskar Pearson
@oskarpearson
Nov 04 2015 00:16
Actually iter_glucose 1 is now returning successfully (but without recent data)
previously I got a stack trace:
File "/root/venv-openaps/local/lib/python2.7/site-packages/decocare/commands.py", line 593, in getData
return dict(page= lib.BangLong(data[0:4]), glucose=data[5], isig=data[7])
File "/root/venv-openaps/local/lib/python2.7/site-packages/decocare/lib.py", line 229, in BangLong
( a, b, c, d ) = bytez
ValueError: need more than 0 values to unpack
Nathan Racklyeft
@loudnate
Nov 04 2015 00:17
Hmm that's often a comms issue.
But the empty data issue is known,
Oskar Pearson
@oskarpearson
Nov 04 2015 00:18
Thanks for the help, both :)
Nathan Racklyeft
@loudnate
Nov 04 2015 00:19
bewest/decoding-carelink#44
Tim Howard
@tghoward
Nov 04 2015 00:23
@scottleibrand can you point me to proper syntax and setup for NS uploads in oref0?
Scott Leibrand
@scottleibrand
Nov 04 2015 00:23
it's not really well documented yet
but later tonight I should be able to pull the relevant parts out of my personal setup script
Tim Howard
@tghoward
Nov 04 2015 00:24
right, didn't think so.
Oskar Pearson
@oskarpearson
Nov 04 2015 00:25
I’ve been meaning to ask about the pages stuff. Are there different types of pages? Eg - page 1 of sensor data is different for page 1 of pump history?
Tim Howard
@tghoward
Nov 04 2015 00:25
ok, thanks. But don't spend too much time, I'll start working through it here.
Oskar Pearson
@oskarpearson
Nov 04 2015 00:25
or does sensor data get written to 1 and then pump history to 2 etc
Also - are pages written to “in order”? So always page 1, then 2, then 3 etc.. and eventually they wrap?
Siobhan's current values are:
  "isig": 32,
  "page": 57,
  "glucose": 32
Oskar Pearson
@oskarpearson
Nov 04 2015 00:30
Answering my questions:
It seems they are written in order
but I’m not sure what the different values are
if I fetch page 56, it ends with the data at the time Siobhan’s info finishes
Page 57 is just blank:
openaps use pump read_glucose_data 57
[]
Page 58 gives a stack trace
Oskar Pearson
@oskarpearson
Nov 04 2015 00:37
@loudnate you mention “fetching the isig value on page turns” - would you mind giving a bit more detail on what you mean there? Is isig this isig? http://sugabetic.me/the-isig-equation/ - and what’s it got to do with the page values?
Nathan Racklyeft
@loudnate
Nov 04 2015 00:40
yep so ISIG is the intermediate value determined from the sensor voltage, before calibration factor is applied to get glucose values
I'm not sure if you've noticed, but every single glucose value you've read from her pump using decocare (in mg/dL) has been an even number
and that's because they shift right 1 bit to fit the entire range within one byte
now if you do a dump via carelink you'll notice your glucose values are not all even numbers, and that's because they're reconstructing them from the stored ISIG and calibration factors
so basically the glucose pages are duplicate data
and my theory was they lagged behind a little
I don' think that's correct, however,
I think it's more likely that @bustavo's theory about decocare not going back to find the calibration from a previous page is the core issue
Oskar Pearson
@oskarpearson
Nov 04 2015 00:49
Ok, so isig is basically the “raw value"
And carelink can’t figure out how to reconstruct from the raw values as it’s missing the most recent calibration
As the calibration is on the previous page
I’m going to have to head to bed - early start tomorrow
Thanks for the help
Nathan Racklyeft
@loudnate
Nov 04 2015 02:14
s/carelink/decocare, yes
Matthias Granberry
@mgranberry
Nov 04 2015 03:28
@TC2013 you have Android medtronic pump interaction working, or is that a no go because of kernel issues?
diabeticgonewild
@diabeticgonewild
Nov 04 2015 03:29
@loudnate ISIG is in nanoAmps. All glucose sensors are amperometric and it really has nothing to do with voltage as a measurement. However a test voltage is put across the sensor at certain time intervals and the conductivity (the inverse of resistance) influences the amp reading via Ohm's law...
i am being anal but that is what studying electrical engineering will do to you, and I appreciate what you said, but I had to make that clarification.
Scott Leibrand
@scottleibrand
Nov 04 2015 03:31
:+1:
diabeticgonewild
@diabeticgonewild
Nov 04 2015 03:38
@oskarpearson the best place to find out about the ISIG and blood glucose relationship is by far here (great site!): http://myparadigm.eu
Ben West
@bewest
Nov 04 2015 06:43
wow that's a great site
should work with him on putting that content into the doc book
As with any new technology, there is limited practical experience with this system. Continuous glucose monitoring system devices are handed over to patients as black boxes without proper explanation of principles, their usage in daily life and practical hints. Then it is a task for every patient to explore the continuous glucose monitoring system features and find its optimal setup and usage.
diabeticgonewild
@diabeticgonewild
Nov 04 2015 06:44
Yeah, an oldie but definitely a goodie...Hahahaha!
Ben West
@bewest
Nov 04 2015 06:48
@oskarpearson can you use mm-send-comm.py to --save the pages of data you are curious about?
Jason Calabrese
@jasoncalabrese
Nov 04 2015 17:18
think I've had insulin duration set wrong all along, seems like it's closer to 4 hours than 3, might have to adjust isf if I change dia
Matthias Granberry
@mgranberry
Nov 04 2015 17:34
3's pretty aggressive for humalog/novolog. Subcutaneous absorption's a real bear.
it might not be too far off with Apidra. I wish some of the research on making faster insulins would make it to a product. It might not work for standard pump therapy, but for something like OpenAPS it would be a real boon.
Scott Leibrand
@scottleibrand
Nov 04 2015 17:53
to answer @tghoward's earlier question for everyone's benefit, here's what I'm doing for upload:
openaps alias add upload '! bash -c "openaps report invoke enact/suggested.json; openaps pebble; openaps upload-recent-treatments >/dev/null"
openaps alias add upload-recent-treatments '! bash -c "openaps format-latest-nightscout-treatments && test $(json -f upload/latest-treatments.json -a created_at eventType | wc -l ) -gt 0 && (ns-upload $NIGHTSCOUT_HOST $API_SECRET treatments.json upload/latest-treatments.json ) || echo \"No recent treatments to upload\""'
openaps alias add format-latest-nightscout-treatments '! bash -c "nightscout cull-latest-openaps-treatments monitor/pumphistory-zoned.json settings/model.json $(openaps latest-ns-treatment-time) > upload/latest-treatments.json"'
openaps report add monitor/pumphistory-zoned.json JSON tz rezone monitor/pumphistory.json
Ben West
@bewest
Nov 04 2015 17:59
new sensor
blob
woke up in 120s again, loving it
Scott Leibrand
@scottleibrand
Nov 04 2015 17:59
nice! :)
Ben West
@bewest
Nov 04 2015 17:59
that's a really great one... no way a human can dose like this
Oskar Pearson
@oskarpearson
Nov 04 2015 19:26
@bewest Given this, would I need to capture page 57 and 56?
openaps use pump read_current_glucose_pages
{
  "isig": 32,
  "page": 57,
  "glucose": 32
}
I’m not sure if that 32 refers to page 32, or something different
Oskar Pearson
@oskarpearson
Nov 04 2015 19:41
I’ve captured pages 56 and 57 into a comment on that bug
Oskar Pearson
@oskarpearson
Nov 04 2015 20:05
The code fix doesn't appear to work reliably, unfortunately.