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

11th
Mar 2016
Brian Bonner
@itsn0tm3
Mar 11 2016 03:55
I've got a question about the basal-iob and iob calculations. I'm trying to figure out the differences between the OpenAPS one and the one on the medtronic pump
right now my pump says that I have 2 units onboard, openaps says bolusiob is 0.8 units, and IOB is 2.3?
shouldn't the bolusiob say 0.8 to match the 2 units of onboard insulin it says on the pump status screen?
(active insulin I mean)
Scott Leibrand
@scottleibrand
Mar 11 2016 04:00
You're running master (package release), not dev (from src) right?
Bolusiob in master is really bolus snooze IOB. It's decayed at double speed.
We renamed it (and added a proper basaliob) in newer versions.
Brian Bonner
@itsn0tm3
Mar 11 2016 04:01
I think it's dev but I'm not quite sure
Scott Leibrand
@scottleibrand
Mar 11 2016 04:02
That might only be in meal-assist branch, I don't recall
Brian Bonner
@itsn0tm3
Mar 11 2016 04:02
so the iob is the bolus iob + the basal iob that was added in via temp basals right?
Scott Leibrand
@scottleibrand
Mar 11 2016 04:03
but if it doesn't show basaliob or bolussnooze iob, just bolusiob, it's probably the old behavior you're seeing.
Brian Bonner
@itsn0tm3
Mar 11 2016 04:03
{"bolusiob":0.7190241904000001,"iob":2.294725646192605,"activity":0.032477809861111116}
Scott Leibrand
@scottleibrand
Mar 11 2016 04:03
Net iob (or just IOB) includes the effect of boluses and basals.
You can mostly ignore bolusiob
unless you want to know how snoozeBG was calculated
Brian Bonner
@itsn0tm3
Mar 11 2016 04:04
maybe during the daylight hours when more of my brain is working :)
Scott Leibrand
@scottleibrand
Mar 11 2016 04:04
a more recent branch would break out basaliob separately. Otherwise the difference between IOB and your pump's active insulin is probably due to temp basals.
Brian Bonner
@itsn0tm3
Mar 11 2016 04:05
yeah my blood sugar is running high now for some reason so its giving it temp basals right now to help out
so that would make sense
I'm looping the suggestions right now and doing the enacts manually
Scott Leibrand
@scottleibrand
Mar 11 2016 04:06
:+1:
Brian Bonner
@itsn0tm3
Mar 11 2016 04:06
so was just eyeballing the IOB's trying to figure out the difference between the pump's active insulin stat and the IOB in the suggestion but what you said makes sense
Scott Leibrand
@scottleibrand
Mar 11 2016 04:07
there are slight differences between our IOB calculation and medtronic's but generally by more than about 5%
*not more
Brian Bonner
@itsn0tm3
Mar 11 2016 04:07
oh one other weird question for you
when I do the enact manually, I see this weird statement in the syslog
I can't figure out if it's from openaps or something else
Mar 10 22:46:44 raspberrypi this seems like a problem
Scott Leibrand
@scottleibrand
Mar 11 2016 04:08
That is from decocare I think
goes with "bad ailing"?
Brian Bonner
@itsn0tm3
Mar 11 2016 04:08
no
(one of the other reasons I'm doing the enacts manually is because I'm using a 723 with 2.5a so I'm putting it into PC connect mode to be able to send the enacts)
so maybe that's why?
Scott Leibrand
@scottleibrand
Mar 11 2016 04:09
Yeah, I don't recall if the x23's do anything odd in PC Connect mode.
So dunno really
Brian Bonner
@itsn0tm3
Mar 11 2016 04:10
heh ok, was just amused by the line but had a "uhmm I hope something aint going wrong here!" thought every once in a while when I read it
I have a 722 here, just need to set it up and get it hooked up, going to do that over the weekend and see if that line keeps coming up still
Scott Leibrand
@scottleibrand
Mar 11 2016 04:11
:+1:
amoskane
@amoskane
Mar 11 2016 06:08
hi guys— made it all the way to step 4, and then my wifi dongle quit. I’ve spent about 4 -6 hours now- doing all the steps I can find, but the pi just doesn’t see it.
i mean, it sees it on an lsusb, but the light comes on once and then dies
funny thing is i put in another, totally different brand wifi usb and it’s acting the same way.
I think i’m about to reflash the whole pi drive unless anyone has any master tips on restoring usb wifi sticks...
or if anyone else has noticed this, i dunno, becasue of a recent update or something.
Brian Bonner
@itsn0tm3
Mar 11 2016 07:07
This makes absolutely no sense to me
Mar 11 02:06:06 raspberrypi openaps: {"delta":-1,"glucose":101,"avgdelta":-0.3333333333333333} Mar 11 02:06:06 raspberrypi openaps: {"duration":0,"rate":0,"temp":"absolute"} Mar 11 02:06:06 raspberrypi openaps: {"bolusiob":0,"iob":-0.28909480748214605,"activity":0.007802695290404041} Mar 11 02:06:06 raspberrypi openaps: {"max_iob":5,"type":"current","dia":4,"current_basal":0.7,"max_daily_basal":1,"max_basal":2,"min_bg":100,"max_bg":140,"sens":47} Mar 11 02:06:06 raspberrypi openaps: determine-basal://JSON/shell/enact/enact.json Mar 11 02:06:06 raspberrypi openaps: reporting enact/enact.json Mar 11 02:06:06 raspberrypi openaps: { Mar 11 02:06:06 raspberrypi openaps: "bg": 101, Mar 11 02:06:06 raspberrypi openaps: "temp": "absolute", Mar 11 02:06:06 raspberrypi openaps: "snoozeBG": 119, Mar 11 02:06:06 raspberrypi openaps: "reason": "119 is in range. No temp required", Mar 11 02:06:06 raspberrypi openaps: "eventualBG": 119, Mar 11 02:06:06 raspberrypi openaps: "tick": -1 Mar 11 02:06:06 raspberrypi openaps: }
if my delta and avgdelta is -, and my bg is 101, why would it think that it will eventually go up to 119?
I don't see anything that would indicate it's on an upward trend?
eyim
@eyim
Mar 11 2016 07:42
There is negative insulin on board - probably from a low temp that was done so taking that into account if figures you will climb
Brian Bonner
@itsn0tm3
Mar 11 2016 07:46
oh I see, so that means the iob would have the current basal included in there normally?
the temp basal I had to stop from going low wasn't for that long so there should still have been some of the normal basal left
I guess I can go back in the log and see what the iob progressed to that point
thanks for the tip!
eyim
@eyim
Mar 11 2016 08:29
No problem - yes the iob is considered a net iob so 0 means that only normal amounts of basal is on board. If it is negative then you have less than the normal amount of basal insulin on board
live4sw
@live4sw
Mar 11 2016 10:04
This message was deleted
This message was deleted
Hi, so I found the source of the problem I mentioned yesterday by going through each of the steps in my aliases. The issue is that the very first command - 'mm-stick warmup' throws off this error, and then the loop stops entirely until the next cron job, when it does this again and then stops again.
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.22-py2.7.egg/decocare/stick.py", line 912, in <module>
    stick.open( )
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.22-py2.7.egg/decocare/stick.py", line 874, in open
    log.info('%s' % self.product_info( ))
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.22-py2.7.egg/decocare/stick.py", line 515, in product_info
    return self.query(ProductInfo)
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.22-py2.7.egg/decocare/stick.py", line 509, in query
    return self.process( )
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.22-py2.7.egg/decocare/stick.py", line 496, in process
    ack, response = self.command.respond(raw)
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.22-py2.7.egg/decocare/stick.py", line 71, in respond
    raise AckError("ACK is 0 bytes:\n%s" % lib.hexdump(raw))
decocare.errors.AckError: ACK is 0 bytes:
live4sw
@live4sw
Mar 11 2016 10:10
I think I may need to add something to retry-loop to deal with this scenario. My retry-loop is currently the default, which is retry-loop = ! bash -c "until( ! mm-stick warmup || openaps loop); do sleep 5; done". Has anyone here encountered a similar issue?
Basically, if I reboot, or reset the USB, it gets unstuck, but otherwise it just throws off that error every 5 minutes and doesn't even get to the preflight, even though everything is connected and i'm a few feet away from the stick
Scott Leibrand
@scottleibrand
Mar 11 2016 11:48
openaps alias add preflight '! bash -c "rm -f monitor/clock.json && echo -n \"PREFLIGHT \" && openaps report invoke monitor/clock.json 2>/dev/null >/dev/null && grep -q T monitor/clock.json && echo OK || ( ( mm-stick warmup 2>&1 || sudo oref0-reset-usb ); echo FAIL; sleep 120; exit 1 )"'
openaps alias add retry-loop '! bash -c "openaps wait-loop || until( ! mm-stick warmup 2>&1 | egrep -v \"^ \" || ! openaps preflight || openaps loop); do sleep 10; done"'
live4sw
@live4sw
Mar 11 2016 12:47
What do you use for your wait-loop alias? I didn't see that discussed in the docs.
Scott Leibrand
@scottleibrand
Mar 11 2016 16:48
openaps alias add wait-loop '! bash -c "openaps preflight && openaps gather && openaps enact && openaps report invoke monitor/temp_basal.json 2>/dev/null >/dev/null && openaps upload && openaps get-settings 2>/dev/null >/dev/null && openaps wait-for-bg && openaps enact && openaps upload-ns-status >/dev/null"'
live4sw
@live4sw
Mar 11 2016 17:28
Thanks Scott, unfortunately this brings up wait-for-bg and several aliases not discussed in the docs. I see Jason uses these too. What is the purpose of the "wait" aliases? I think I may need to spend some time this weekend really trying to understand how these aliases do things differently.
Jason Calabrese
@jasoncalabrese
Mar 11 2016 17:31
the wait-for-bg causes the loop to wait until BG changes, and just keeps polling
you then need a cron to killall openaps processes older than 10 minutes
* * * * * killall -g --older-than 10m openaps
live4sw
@live4sw
Mar 11 2016 17:40
Oh I see, so is the logic here that by using the wait, you can make sure that your loop runs immediately when there is a new bg? I assume your cron still runs retry-loop every 5 minutes, you're just killing old processes to make sure they don't snowball?
Jason Calabrese
@jasoncalabrese
Mar 11 2016 17:49
the cron runs every minute, but checks if it's already running first
I use * * * * * cd /home/edison/indy && ( ps aux | grep -v grep | grep -q 'openaps retry-loop' && echo OpenAPS already running || openaps retry-loop ) 2>&1 | logger -t openaps-loop
live4sw
@live4sw
Mar 11 2016 17:54
ah, that's great, makes a ton of sense.
Julia Schober
@julza78
Mar 11 2016 17:55
Hi, is there already any 3D-printable file for a Dexcom-transmitter-dummy? (I havn´t any broken transmitter for the hot-swap yet)
Dana Lewis
@danamlewis
Mar 11 2016 17:55
hm, good idea to 3d print. I haven’t seen, but wouldn’t be surprised if it’s out there somewhere
Jim Matheson
@jmatheson
Mar 11 2016 22:14
@scottleibrand thanks for the heads up to not worry about signature from dexcom
Dana Lewis
@danamlewis
Mar 11 2016 22:15
^^^ugh. Yes don't go out of your way to get it especially if you're not expecting a Dexcom shiPment
Jim Matheson
@jmatheson
Mar 11 2016 22:17
yea. i had a call at my door from the mail guy a few days ago and i told him i would not be home until friday. then i checked dexcom website and i saw the “special notice” bar at the top. i thought that might be what it was but did not know for sure.
Jason Calabrese
@jasoncalabrese
Mar 11 2016 22:21
wonder what that cost them, we all knew the speaker was useless, thats why we have all these alarm systems
Jim Matheson
@jmatheson
Mar 11 2016 22:24
it’s funny how everyone is unique. that alarm is way loud to me. annoyingly loud.
and my hearing is generally bady.
Jason Calabrese
@jasoncalabrese
Mar 11 2016 22:24
for me this all started because there was no alarm for ???
Dana Lewis
@danamlewis
Mar 11 2016 22:35
@jasoncalabrese I do find it exceedingly ironic
@jmatheson Because I have a magnitude less of alarms with Openaps, occasionally the normal Dexcom buzzes actually wake me up now!
Jim Matheson
@jmatheson
Mar 11 2016 22:36
nice
Dana Lewis
@danamlewis
Mar 11 2016 22:37
Only realized recently. Only took two years, one of more then one of less alarms ;)
Bill Stackpole
@billstackpole
Mar 11 2016 23:28
hi! Have a question about how to execute an openaps use command.
have tried this: openaps use pump bolus JSON { "units": 1 }
to no avail.
based on:

'''pi@openaps-raspi:~/billopenaps $ openaps use pump bolus -h
usage: openaps-use pump bolus [-h] input

Send bolus.

positional arguments:
input

optional arguments:
-h, --help show this help message and exit

Requires json input with the following keys defined:

* `units` - Number of units to bolus.

Zero point one units:
{ "units": 0.1 }
Two units:
{ "units": 2 }

thoughts? what am I doing wrong?
also tried to redirect input from a file (with content of { "units": 1 }) and from STDIN.
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:32
I wouldn't mess with bolus, way too many ways for things to go bad
Bill Stackpole
@billstackpole
Mar 11 2016 23:35
understood - but can't do the temp_bolus either.
Not sure how to construct the instruction to allow the correct value to be set.
For example...
at cmd line: this doesn't work.
openaps use pump set_temp_basal { "temp": "absolute", "rate": 1.2, "duration": 30 }
response:
openaps-use: error: unrecognized arguments: temp: absolute, rate: 1.2, duration: 30 }
?
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:36
you need to pass the json to the use command, you can do that with an echo
Bill Stackpole
@billstackpole
Mar 11 2016 23:37
so tried this too:
``` 674 echo { "units": 1} | openaps use pump bolus json
675 echo { "units": 1}
676 echo { "units": 1 } | openaps use pump bolus json
677 echo { \"units\": 1 } | openaps use pump bolus json
fail fail fail.
heh
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:37
echo '{ "temp": "absolute", "rate": 0.1, "duration": 30 }' | openaps use pump set_temp_basal -
Bill Stackpole
@billstackpole
Mar 11 2016 23:38
ah...
so I need the - at the end?
<grr> such a simple item missing.
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:38
yeah, don't think it will work without that
Bill Stackpole
@billstackpole
Mar 11 2016 23:38
tnx
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:39
be really careful of bolus, I don't even want it in my history
Bill Stackpole
@billstackpole
Mar 11 2016 23:39
understood - thankyou. I'll history -c
<smile>
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:39
for an example of things that could go wrong theres a bug in mmeowlink, that enacts temps 3 times
Bill Stackpole
@billstackpole
Mar 11 2016 23:39
Oh crap
mmeowlink is the one on Edison?
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:40
if there was a bug like that with bolus
Bill Stackpole
@billstackpole
Mar 11 2016 23:40
game over
right
thank you!
and you have single quotes too - just noticed that.
so the object is passed in as a single element, containing three array (list) objects.
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:41
doing the same temp over and over is basically a no op
you can swap the quotes, and it would still work
but json is usually with double quotes
Bill Stackpole
@billstackpole
Mar 11 2016 23:42
so much to learn.
Dana Lewis
@danamlewis
Mar 11 2016 23:46
Thx @jasoncalabrese To beating me to making that point about not even testing with bolus :)
@billstackpole We're all still learning and tinkering, too :)
Bill Stackpole
@billstackpole
Mar 11 2016 23:46
Jason - one more question - If I set temp basal for 1.25* normal for 30 min, to cancel I just set back to 0 absolute?
echo '{ "temp": "absolute", "rate": 0, "duration": 30 }' | openaps use pump set_temp_basal -
?
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:47
0 for rate and 0 for duration
with rate 0 and duration 30 it's a zero temp for 30 minutes
you'll see the open circle on the pump when a temp is set, then when you clear the temp the open circle will go away
Bill Stackpole
@billstackpole
Mar 11 2016 23:52
why does it provide feedback indicating "recieved": false,
doesn't seem to be modifying the temp basal rate
hmm
Jason Calabrese
@jasoncalabrese
Mar 11 2016 23:54
do you have the pump set to absolute mode
in the temp basal settings?
it might be set to percent