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

29th
Nov 2015
Scott Leibrand
@scottleibrand
Nov 29 2015 00:07
What's that do?
Ben West
@bewest
Nov 29 2015 00:08
fetches last 10 records and some other stuff from g4 with share over ble
so openaps can get it locally from ble
well, it doesn't do that quite yet
Jason Calabrese
@jasoncalabrese
Nov 29 2015 00:10
nice, will make the battery last longer
Ben West
@bewest
Nov 29 2015 00:10
and it's conceivable to use openaps rig as the sole uploader
Jason Calabrese
@jasoncalabrese
Nov 29 2015 00:10
yeah, been thinking about that
Ben West
@bewest
Nov 29 2015 00:11
ditch android, invest in extra hotspot usb-cell modem
Jason Calabrese
@jasoncalabrese
Nov 29 2015 00:11
yup
Jason Calabrese
@jasoncalabrese
Nov 29 2015 00:13
have our pi setup to use the hot spot on a couple phone
works better than I expected
thinking about a little web app that would run on the pi
Ben West
@bewest
Nov 29 2015 00:13
yeah
or ble service :-)
Jason Calabrese
@jasoncalabrese
Nov 29 2015 00:14
something like ihawk, but for openaps
Ben West
@bewest
Nov 29 2015 00:14
@loudnate made openaps-monitor
Jason Calabrese
@jasoncalabrese
Nov 29 2015 00:14
that runs on the pi?
Ben West
@bewest
Nov 29 2015 00:14
it's pretty nice, chris showed screenshots of it
yeah, it runs simplehttpserver on pi
takes paths to some of your openaps stuff
Jason Calabrese
@jasoncalabrese
Nov 29 2015 00:14
nice, didn't realize that
Lori
@LoriLori
Nov 29 2015 00:51
you can put riley link in pocket next to the pump, thus range becomes ble range, just idea
Ben West
@bewest
Nov 29 2015 00:51
need to try rileylink with this new bluez technique
the notifications are working on this one
could just be update to 5.33 though
Lori
@LoriLori
Nov 29 2015 00:52
these hid in pockets are great http://www.hid-in.com/shop/
John Males
@johnmales
Nov 29 2015 02:16

Hey just wondering in the read_insulin_sensitivies.json file eg:

{
  "units": "mmol/L", 
  "sensitivities": [
    {
      "i": 0, 
      "start": "00:00:00", 
      "sensitivity": 5.0, 
      "offset": 0, 
      "x": 0
    }
  ], 
  "first": 2
}

What is "first"?, and is it relevant for calculations in oref0?

Ben West
@bewest
Nov 29 2015 02:16
what version of decocare?
nifty, it worked
it's catching fact that you are in mmol
and it is significant
I think there's a units converter, need to make it more generic the way the timezone tool is
there is a tool, think it only works for bg_targets though
you can use insulin_sensitivities instead and fix the typo
John Males
@johnmales
Nov 29 2015 02:22
It is definitely catching the units issue so I'm putting together a script to convert the units. I presume the sensitivity needs to be multiplied by 18?

I have made a script for the bg targets:

#!/bin/bash

echo -e "{ \"units\": \"mg/dL\","  \"raw\" ":" \""$(json -f read_bg_targets.json | json -a raw)" ":"  \""," \"targets\":"" "$(json -f read_bg_targets.json | json -a targets | json -e 'this.high=this.high*18' | json -e 'this.low=this.low*18')"" } " | json  > read_bg_targets_mgdl.json

I'm sure the script is terrible but it does seem to work. If there is something built in I of course would prefer to use that.

My script for the sensitivities isn't quite right

#!/bin/bash

echo -e "{ \"units\": \"mg/dL\","  \"raw\" ":" \""$(json -f read_bg_targets.json | json -a raw)" ":"  \""," \"targets\":"" "$(json -f read_bg_targets.json | json -a targets | json -e 'this.high=this.high*18' | json -e 'this.low=this.low*18')"" } " | json  > read_bg_targets_mgdl.json

Something isn't quite right and I will have to add the "first" entry in to both if it is significant
How do I check which version of decocare I have?

Peter Miller
@ochenmiller
Nov 29 2015 02:25
any reason anyone knows not to update nodejs to latest version? bleno seems to want it in order to run under Jessie
Ben West
@bewest
Nov 29 2015 02:26
latest node js is fine
Peter Miller
@ochenmiller
Nov 29 2015 02:26
thx
Ben West
@bewest
Nov 29 2015 02:26
probably
Peter Miller
@ochenmiller
Nov 29 2015 02:26
I'll let y'all know if there
's a problem
Ben West
@bewest
Nov 29 2015 02:26
@johnmales for this, I was thinking of adding to https://github.com/openaps/openaps/blob/master/openaps/vendors/units.py
John Males
@johnmales
Nov 29 2015 02:32
Sounds good @bewest. With a Medtronic only setup with mmmol/L I can get reasonable looking profile and iob if I manually edit the units. Of course wanting to automate it. Feel like I'm making some progress.
John Males
@johnmales
Nov 29 2015 02:41
About the sensitivies now sensitivities thing - was that a deliberate typo in the past?
Ben West
@bewest
Nov 29 2015 02:41
no, it was a typo originally
and I've fixed it several times
people keep copy/pasting it though
John Males
@johnmales
Nov 29 2015 02:42
Ok
Ben West
@bewest
Nov 29 2015 02:42
:-)
it will work either way for time being
soon-ish I'll make it print a warning of some kind
John Males
@johnmales
Nov 29 2015 02:43
Ok will change it :smile:
Ben West
@bewest
Nov 29 2015 02:43
it'll take a year, worst case, to get rid of it
for printing version
hmm
I usually check pydoc decocare
John Males
@johnmales
Nov 29 2015 02:45
FILE
/usr/local/lib/python2.7/dist-packages/decocare-0.0.19.dev0-py2.7.egg/decocare/init.py
Ben West
@bewest
Nov 29 2015 02:46
thats latest release
John Males
@johnmales
Nov 29 2015 02:46
Yes come to think of it it was installed recently with one of @scottleibrand 's scripts
John Males
@johnmales
Nov 29 2015 05:11
@bewest Just added a units conversion for read_insulin_sensitivities to units.py in openaps openaps/openaps#68
Ben West
@bewest
Nov 29 2015 05:12
beautiful!
John Males
@johnmales
Nov 29 2015 05:14
Seems to work. I’m definitely an amateur at this though.
Ben West
@bewest
Nov 29 2015 05:14
looks good :-)
John Males
@johnmales
Nov 29 2015 05:15
where is the user_preferred_units used?
Ben West
@bewest
Nov 29 2015 05:16
nowhere, it's just record keeping, a hint that we changed the units
if it's set, it's a hint we switched
should probably be more explicit about that/refactor
John Males
@johnmales
Nov 29 2015 05:17
Good idea though
diabeticgonewild
@diabeticgonewild
Nov 29 2015 06:23
@cjo20 , using R2OpenBUGS did not fix the 64 bit issue, so I have to switch to PyMC to finish up my work, but the good news is that it is very open source, and potentially more robust!
diabeticgonewild
@diabeticgonewild
Nov 29 2015 06:30
I am certain it doesn't work, despite reading documentation that verifies this with a (possible) workaround that doesn't work, because I used a sample problem to calculate this...
diabeticgonewild
@diabeticgonewild
Nov 29 2015 06:39
I mean, it can be run on 32 bit machines, but still....
And PyMC is basically Python, NumPy, and SciPy...
If I don't finish up with PyMC by this time on Saturday in the following week I will just run OpenBUGS in 32 bit, but really don't want to
diabeticgonewild
@diabeticgonewild
Nov 29 2015 06:47
If I can't get this done (as in programmed in to the point where I am now) within a week or so, I will just use OpenBUGS on a 32 bit machine.
FYI PyMC is a python module
So I am starting to program this in now...
Oskar Pearson
@oskarpearson
Nov 29 2015 14:21
@johnmales Are you (also) in a mmol/l location then?
Robert Cook
@racook
Nov 29 2015 18:23
Hi - I met a few of you at the Palo Alto Westin the week before last. I gathered hardware and I'm beginning set up of an OpenAPS for my son. I've had a little time to scan the code, but haven't dug in deeply yet
Trying to configure the software. Pump works, dexcom doesn't. I get a traceback with 'NoneType' object has no attribute 'iter_records' for any operation on the dexcom, which suggests that something is coming back null
Dexcom is plugged in and drawing power from the Raspberry Pi. Is there a known way to confirm that it is visible to the system?
Oskar Pearson
@oskarpearson
Nov 29 2015 18:26
@racook Welcome :)
I don't have a dexcom, unfortunately, so I can't give much guidance there. But could you paste the full stack trace (the whole error message) here between three back-ticks? It should come out like this:
some error
some more of the error
I can then have a quick look and see if there's enough detail for me to help
John Males
@johnmales
Nov 29 2015 18:28
@oskarpearson Yes I am - Sydney Australia.
Oskar Pearson
@oskarpearson
Nov 29 2015 18:28
@johnmales I've been meaning to work on the 0ref code to add the conversion stuff in to it.
Currently I'm not using that dosage code, and had to fix the code I ended up using
We had some discussions about this previously, after my wife ran into issues where the code was trying to mix the two scales together (setting her glucose to 5.5 in the american scale..)
I'd be careful about it when you try and start using the software for a bit
The places to worry about are:
  • glucose targets - openaps/openaps#62 - make sure that they are reflecting in the mg/dl format
Robert Cook
@racook
Nov 29 2015 18:34
This message was deleted
pi@raspberrypi:~/ionaps $ openaps use old_g4 iter_glucose 1
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.0.7', 'openaps-use')
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 742, in run_script
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 1667, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-py2.7.egg/openaps/cli/__init__.py", line 44, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-py2.7.egg/openaps/uses/use.py", line 39, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-py2.7.egg/openaps/vendors/dexcom.py", line 91, in main
    for item in self.dexcom.iter_records('EGV_DATA'):
AttributeError: 'NoneType' object has no attribute 'iter_records'
Oskar Pearson
@oskarpearson
Nov 29 2015 18:36
  • I think there may also be a similar problem with the impact of insulin - how much it'll drop blood sugar by for a given unit of insulin. I need a system to log in and check with though.
@racook Thanks, that's the right format. Give me a moment to investigate. Not sure I'll be able to help unfortunately
It seems like the scan for a Dexcom device is failing
My guess in the code is that https://github.com/openaps/openaps/blob/master/openaps/vendors/dexcom.py#L32 is equating to None
Unfortunately it's difficult for me to figure out next steps, since I've not used the dexcom stuff
Oskar Pearson
@oskarpearson
Nov 29 2015 18:41
Sorry
John Males
@johnmales
Nov 29 2015 18:42
@oskarpearson thanks for the heads up. I will be progressing with this very slowly
Oskar Pearson
@oskarpearson
Nov 29 2015 18:43
I'm finally getting to a stage where I can change tack for a bit and start doing other useful things like working on the 0ref stuff and so forth
Robert Cook
@racook
Nov 29 2015 18:45
@oskarpearson: thanks for trying. I'll start digging in
Oskar Pearson
@oskarpearson
Nov 29 2015 18:45
@racook It's probably very out of date - but https://gitter.im/nightscout/intend-to-bolus/archives/2015/05/02 seems to refer to a vaguely similar error message
Robert Cook
@racook
Nov 29 2015 18:46
@oskarpearson My guess is that the dexcom isn't being recognized at the os level. It's been awhile since I've done anything like this under linux, so I have to get back up to speed
John Males
@johnmales
Nov 29 2015 18:49
Good to hear
Scott Leibrand
@scottleibrand
Nov 29 2015 19:10
@racook Try lsusb first, before and after you plug in the Dexcom.
It won't identify, but the MAC should show up.
If it doesn't, check your USB cable etc b
Also, I assume you have a working transmitter and it's producing good data?
Robert Cook
@racook
Nov 29 2015 19:21
@scottleibrand - tried lsusb --
pi@raspberrypi:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/p, 80M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/p, 80M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 80M
        |__ Port 3: Dev 5, If 0, Class=Vendor Specific Class, Driver=rt2800usb, 80M
        |__ Port 5: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 2M
        |__ Port 5: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid, 2M
That's what I get whether or not the dexcom is plugged in. There is a keyboard attached, which I assume is the port5 device
I've tried two different dexcom g4 platinum receivers, one share, one not. Both are getting live data. Neither were fully charged. I've seen the system freeze temporarily when I plug in the dexcom. I doubt the current draw is that much, but maybe it's causing some sort of problem?
Robert Cook
@racook
Nov 29 2015 19:33
OK. It was one bad cable, and a second that seems to be only for charging. Third one worked, so all is good. Now to get network connectivity working reliably
Jason Calabrese
@jasoncalabrese
Nov 29 2015 19:35
It's there a way to get the 522 to deliver faster? Feels like I've seen an option, but maybe thinking of other pump
Scott Leibrand
@scottleibrand
Nov 29 2015 19:36
Yep, charge-only cables are a common problem. If you want, it might be worthwhile forking the docs repo, making a note of that to warn the next person (and include troubleshooting steps), and submitting a PR back to dev with your changes.
@jasoncalabrese nope. It has one speed.
Robert Cook
@racook
Nov 29 2015 19:37
OK. I'll be making notes along the way do as you suggest all at once after I'm done
Scott Leibrand
@scottleibrand
Nov 29 2015 19:37
K
Jason Calabrese
@jasoncalabrese
Nov 29 2015 19:37
Seems slow to me an I'm doing much smaller doeses than most of you
Think the ping would do a unit at a time
Dana Lewis
@danamlewis
Nov 29 2015 20:40
Melissa recently linked to something about pump speeds @jasoncalabrese , I would look for that
Ps welcome @racook!
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:24
in the FB group?
Dana Lewis
@danamlewis
Nov 29 2015 21:25
Yes or maybe to her wall
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:26
found it
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:32
think there are a few different issues that are combining to make meal boluses not work as good, feels like the 522 rounding, and slower infusion rate are part of it, but also low temping before a meal to avoid a low
think that -IOB needs to be covered
also having different IOB in openaps and Nightscout is messing up my bwp alarms
Ben West
@bewest
Nov 29 2015 21:37
yeah, bwp would be nicer with openaps iob
think most of it is in dcalc
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:46
there are some minor data model diffrences
in NS we have the mills field and got rid all the extra checking everywhere
the oref0 code does lots of checking and conversion
also in NS we handle units better
so need a way to normalize that
to take all the NS profile stuff and generate a simple profile for that time
Ben West
@bewest
Nov 29 2015 21:49
yeah, need to have some phase where all everything is prepped
there's a tool for that too
mm-format-ns-profile
mm-format-ns-foo is "format from mm into ns for $foo"
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:50
need something in NS to be able to use dcalc
Ben West
@bewest
Nov 29 2015 21:50
yeah, need to introduce it
start using "strangle" method
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:51
data model needs to be defined somewhere
the NS in memory model isn't the same as what we have in mongo
Ben West
@bewest
Nov 29 2015 21:52
could fork tidepool's data-model repo and add our specs?
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:52
think the NS model is ok
Ben West
@bewest
Nov 29 2015 21:52
right, just add ours to the repo
lot of boiler plate in there to do variety of renderings, tests
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:53
in NS if a value is storing BG as mg/dl the name of the field is mgdl
so it's clear what you have and you have to deal with it
Ben West
@bewest
Nov 29 2015 21:54
I slightly prefer the way mm does it, with units being field on top level object
it's very odd, eg to have a schedule with mixed units
thought that was just internal code though
Jason Calabrese
@jasoncalabrese
Nov 29 2015 21:57
does feel redundant
but when there's new data adding the type makes it clear
I get a bunch of warning in my NS log now, since treatments coming from openaps don't have a units field
found a glucose value without any units, maybe from an old version?
Ben West
@bewest
Nov 29 2015 22:01
it's set in your profile though
seems like NS should set it to what profile says if it's absent
can do same on upload side in dcalc/oref0
Jason Calabrese
@jasoncalabrese
Nov 29 2015 22:02
yeah, could do it upload time
that's the easy thing
openaps assumes mg/dl everywhere, right?
Ben West
@bewest
Nov 29 2015 22:03
oref0 does, yeah
Jason Calabrese
@jasoncalabrese
Nov 29 2015 22:03
so everything must be converted before going in
Ben West
@bewest
Nov 29 2015 22:03
openaps doesn't care, the algorithms themselves could also have an option to work against mmol
I think that's the better option, actualliy
Jason Calabrese
@jasoncalabrese
Nov 29 2015 22:03
then if you upload to an mmol server it would be wrong
Ben West
@bewest
Nov 29 2015 22:03
tell the algorithm about the data
it's same data, just represented slightly different
algorithm itself should handle certain amount of those differences, definitel if it's jut different unit
Jason Calabrese
@jasoncalabrese
Nov 29 2015 22:04
yeah, but when we post the treatments we need to get the units right
maybe that goes in mm-format-ns-treatments.sh
Jason Calabrese
@jasoncalabrese
Nov 29 2015 22:12
@scottleibrand what the expected behaviour when there is a high temp, and BG drops and the a lower temp is needed? Seems that it doesn't set a new temp and leaves the previous going until the drop is more than BGI/2
Lori
@LoriLori
Nov 29 2015 22:13
yes, took me a while to find out sensitivity should be 36 not 2 :) (to mmol mg topic, all should be in mgdl)
Jason Calabrese
@jasoncalabrese
Nov 29 2015 22:15
for example after a bolus the req temp was 1.189U, but the higher 1.75U temp kept running
Screen Shot 2015-11-29 at 2.13.46 PM.png
This message was deleted
Scott Leibrand
@scottleibrand
Nov 29 2015 22:28
Depends on the remaining duration.
It looks at the total amount of extra insulin to be given. If that's more than something like 0.2U less than desired, it will reset the temp
otherwise it lets it run, generally because the remaining duration is short, so total extra insulin to be delivered is < or ~ what a lower 30m temp would deliver.
Jason Calabrese
@jasoncalabrese
Nov 29 2015 22:50
Ah, makes sense, easier to see these things with the new monitoring
Scott Leibrand
@scottleibrand
Nov 29 2015 22:54
:+1:
Jason Calabrese
@jasoncalabrese
Nov 29 2015 22:57
curious to see what others think of the different states I set with the monitoring, I've gone back and forth on some things
if we can agree on the states then I can add some options for alerts
Jason Calabrese
@jasoncalabrese
Nov 29 2015 23:06
also need to have a way to put the loop into offline mode to disable alerts during pump swaps
Dana Lewis
@danamlewis
Nov 29 2015 23:27
Offline mode meaning something different here than we usually refer to? You're just talking about when it's not running, a snooze-all?
And earlier talking about not low temping before meal - that's essentially why enabling eating soon mode would be good.
Those are manual modes that will work for Average ns user, wondering how they might work with openAPS if you have connectivity
Either way, that's on my list to build in to the place we haven't agreed as to where to stick them
Jason Calabrese
@jasoncalabrese
Nov 29 2015 23:46
Not offline mode, maybe manual mode?
Dana Lewis
@danamlewis
Nov 29 2015 23:47
Yea
Lori
@LoriLori
Nov 29 2015 23:47
just idea: Eat soon is when bolus is equal=1.1, then don't put this bolus in bolus iob, openaps will not think eventual BG is low and will not temp
Scott Leibrand
@scottleibrand
Nov 29 2015 23:48
I don't think we can count on Magic Numbers to work for everyone.
Lori
@LoriLori
Nov 29 2015 23:48
magic number is configurable by default not set
Scott Leibrand
@scottleibrand
Nov 29 2015 23:48
Right now, a bolus of pretty much any size activates bolus snooze, unless your eventualBG is way low. So we can use that for eating soon mode for now.
Jason Calabrese
@jasoncalabrese
Nov 29 2015 23:49
Eating soon is just changing the targets right?
Scott Leibrand
@scottleibrand
Nov 29 2015 23:50
Temporarily, ya.
Lori
@LoriLori
Nov 29 2015 23:50
eat soon is pre bolus should I understand it
you wan to drop to something so you have space to rise
Scott Leibrand
@scottleibrand
Nov 29 2015 23:50
Eating soon = set target to 80 for 1h
more importantly it usually means an early prebolus large enough to get some insulin activity for the start of the meal
but small enough to counteract with temps if you can't eat.
Lori
@LoriLori
Nov 29 2015 23:52
can allways do bolus 0.1 and another to mark this is eat soon mode
or just do bolus 0.1 and let it do its job to bring it down to 80
Jason Calabrese
@jasoncalabrese
Nov 29 2015 23:53
For careportal I think we can add an authorized flash/signature to the treatment of the user was authenticated
Then have OpenAPS only consider those
*flag