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

17th
Oct 2015
Ed Raskin
@msrcgm
Oct 17 2015 00:38
@danamlewis I'm basically looking for some help setting up my loop to spit out recommendations and dump that data into something so that I can 1) run the loop overnight while I (sometimes) sleep and 2) review the data in the morning to validate that basal reconditions are not outside the norm of what I would typically perform manually. Next step after that is to actually hook up the loop, but only after I validate.
I would require some help actually setting my loop to run on a chron -- not sure how to do that, but seems pretty simple with a little explanation from the group here
Scott Leibrand
@scottleibrand
Oct 17 2015 00:45
First step is to get/write a loop.sh type script that does everything: runs all the data-collection reports, validates the inputs, generates a basal recommendation, and then enacts that.
Once you get that running and tested, it's fairly simple to schedule it to run every X minutes in cron (not chron).
At its most basic, a .sh script is just like a DOS/Windows .bat file: it just runs a bunch of commands in sequence.
Jason Calabrese
@jasoncalabrese
Oct 17 2015 00:51
reliability of my pi is still bad enough that it's hard to see it as more than a toy
the usb ports get hot
wonder if thats what the carelink and wifi adapter don't like
Ben West
@bewest
Oct 17 2015 00:58
yeah, I don't like how warm mine gets
I use a cable to separate it from battery/stick/wifi
that helps quite a bit
Scott Leibrand
@scottleibrand
Oct 17 2015 01:16
@jasoncalabrese are you running it bedside or mobile?
Rachel Sandlain
@audiefile
Oct 17 2015 01:18
so I had to re-do my set up because my sd card got messed up and when re-doing the get-profile I noticed it's ignoring max_iob.json and setting 1.5 no matter what I put in. any ideas what i'm doing wrong?
Scott Leibrand
@scottleibrand
Oct 17 2015 01:20
You have an old version of get-profile.
it used to be hard-coded.
Ben West
@bewest
Oct 17 2015 01:22
sounds like get-profile needs a patch to throw up if bg targets are not in expected unit
in dev it's moved to oref0-get-profile
aka oref0 get-profile
Rachel Sandlain
@audiefile
Oct 17 2015 01:35
hmm I thought I was up-to-date, I'll have to check
Scott Leibrand
@scottleibrand
Oct 17 2015 01:36
@bewest yes, it does. I don't think that's related to @audiefile's issue though. @oskarpearson mentioned he'd work on one this weekend.
Ben West
@bewest
Oct 17 2015 01:39
the patch was an aside, I don't think anyone's mentioned patching get-profile
got bunch of new pis
extra sd card, maybe I can setup my edisons now
sudo npm install -g git://github.com/openaps/openaps-js.git'#dev' should get you the dev branch
Rachel Sandlain
@audiefile
Oct 17 2015 01:44
I have the dev branch, it's just out of date
And I changed a bunch of things so I can't automatically merge
That might have to be a project for another day though. I've literally spent all day on resetting/rebuilding
Ben West
@bewest
Oct 17 2015 01:48
is you branch also named dev?
you can create a new branch in place with git checkout -b wip/audiefile/dev
if you put your branch on github, I can help merge them or sort things out if you want
ah yours are on master
Rachel Sandlain
@audiefile
Oct 17 2015 01:51
They might be both places actually
Ben West
@bewest
Oct 17 2015 01:51
yeah
Rachel Sandlain
@audiefile
Oct 17 2015 01:52
Is there a good way to see what the conflicts are?
Ben West
@bewest
Oct 17 2015 01:52
do you want both?
I just checked out your dev and was able to merge our dev without conflicts
ah, I see
Rachel Sandlain
@audiefile
Oct 17 2015 01:53
In github it says I can't?
Ben West
@bewest
Oct 17 2015 01:53
there are conflicts from master
I'm going to rebase your master to see what happens
oh pebble.sh
Rachel Sandlain
@audiefile
Oct 17 2015 01:55
oh ok. I can work around that. How did you figure out that was the hang up?
I can see that there's an issue but not what it is
(that there are merge conflicts but not what they are)
Jason Calabrese
@jasoncalabrese
Oct 17 2015 01:56
@scottleibrand I just have it sitting in my office next to the pump, was planning to enter boluses as they come in from the care portal, but it's broken most mornings, and then I get caught up in work, etc
Ben West
@bewest
Oct 17 2015 01:56
success
@audiefile here's your a branch with both your master and dev caught up to dev
I prepped a new version of your dev using checkout -b against your de
dev
then I merged our dev into it, and that was fine and happy
then I tried merging your master and it gave conflicts
could have just dealt with it, but decided to rebase your master to allow it to replay against dev comits
so this reflects dev with your changes, specifically
git status and git diff are useful for looking at conflicts, github won't show them in the UI
Scott Leibrand
@scottleibrand
Oct 17 2015 02:00
@jasoncalabrese wonder if you just have a dud Pi. Have you tried the watchdog stuff to get it to automatically restart if it freezes?
Ben West
@bewest
Oct 17 2015 02:01
you can replay similar steps in your console if you want to give it a go
in the github UI where it says "but you can do it anyway" or "manually" or similar, they outline steps to generate the conflict markers
Rachel Sandlain
@audiefile
Oct 17 2015 02:13
Thanks @bewest I hadn't gone far enough to see how to address the conflicts
Matthias Granberry
@mgranberry
Oct 17 2015 02:16
@danamlewis ordinary differential equations
Rachel Sandlain
@audiefile
Oct 17 2015 02:20
I'm up-to-date now, but still seeing max_iob of 1.5 even though I have a file to set to 2. I know I had it at 2 before, I just don't remember what I did
Ben West
@bewest
Oct 17 2015 02:32
you're calling get-profile with the maxiob file named?
it won't pick one up by default
Scott Leibrand
@scottleibrand
Oct 17 2015 02:48
It should default to 0 though, not 1.5
you may need to npm install still
you're probably still pointing to the one you npm installed earlier, not the one in your updated repo.
sudo npm install -g ./ or similar (from the openaps-js repo)
Rachel Sandlain
@audiefile
Oct 17 2015 03:01
That's what I thought was odd
it's still doing it though
Scott Leibrand
@scottleibrand
Oct 17 2015 03:06
run which get-profile
Rachel Sandlain
@audiefile
Oct 17 2015 03:14
/usr/local/bin/get-profile which I think is wrong
the current stuff is in ~/openaps-js/bin
Scott Leibrand
@scottleibrand
Oct 17 2015 03:20
Did you try cd ~/openaps-js && sudo npm install -g ./?
Rachel Sandlain
@audiefile
Oct 17 2015 03:24
Yes and now it can't find the get-profile command at all
Ben West
@bewest
Oct 17 2015 03:25
it's called oref0-get-profile
or oref0 get-profile
Rachel Sandlain
@audiefile
Oct 17 2015 03:26
those don't exist either
Ben West
@bewest
Oct 17 2015 03:28
in your openaps-js checkout, what does git rev-parse HEAD say?
Rachel Sandlain
@audiefile
Oct 17 2015 03:29
eb852b3dfad7b4f811e476f5284751cb5d0e79fd
Ben West
@bewest
Oct 17 2015 03:31
git remote -v?
Ben West
@bewest
Oct 17 2015 03:31
ok
git remote add author git://github.com/openaps/openaps-js.git
git fetch author
Rachel Sandlain
@audiefile
Oct 17 2015 03:33
remote: Counting objects: 26, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 26 (delta 13), reused 9 (delta 9), pack-reused 5
Unpacking objects: 100% (26/26), done.
From git://github.com/openaps/openaps-js
  • [new branch] dev -> author/dev
  • [new branch] js-only -> author/js-only
  • [new branch] master -> author/master
  • [new branch] wip/audiefile/dev -> author/wip/audiefile/dev
  • [new branch] wip/more-failsafes -> author/wip/more-failsafes
Ben West
@bewest
Oct 17 2015 03:33
git checkout wip/audiefile/dev
then sudo npm install -g
you can push to your github with git push origin -u wip/audiefile/dev
Rachel Sandlain
@audiefile
Oct 17 2015 03:35
It doesn't seem to have liked that. There are a bunch of errors listed
Ben West
@bewest
Oct 17 2015 03:35
oh
hmm
stuff about working tree?
Rachel Sandlain
@audiefile
Oct 17 2015 03:38
I don't think so. The first bit is: Error: No compatible version found: share2nightscout-bridge@'^0.1.5
Ben West
@bewest
Oct 17 2015 03:38
oh
that's the npm step
that's fine
oref0
oref0-get-profile
oref0- tabtab
should be installed now
Rachel Sandlain
@audiefile
Oct 17 2015 03:41
nope, still can't find the command
Ben West
@bewest
Oct 17 2015 03:42
hmmm
Rachel Sandlain
@audiefile
Oct 17 2015 03:42
actually I can, just not the way I used to
Ben West
@bewest
Oct 17 2015 03:43
?
your pi has internet right now
Rachel Sandlain
@audiefile
Oct 17 2015 03:44
so I used to be able to type get-profile from anywhere and get the usage statement
Ben West
@bewest
Oct 17 2015 03:44
no, it's changed names
it's oref0-get-profile
or oref0
or oref0 get-profile
Rachel Sandlain
@audiefile
Oct 17 2015 03:45
right but typing oref0-get-profile didn't work the same way
Ben West
@bewest
Oct 17 2015 03:45
it should have
Rachel Sandlain
@audiefile
Oct 17 2015 03:45
which is why I thought it wasn't working at all.
Ben West
@bewest
Oct 17 2015 03:45
openaps-js$ sudo npm install -g
[sudo] password for bewest:
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.17","npm":"2.7.4"})
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.17","npm":"2.7.4"})
npm WARN engine boom@2.9.0: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.17","npm":"2.7.4"})
/usr/local/bin/oref0-calculate-iob -> /usr/local/lib/node_modules/openaps-js/bin/oref0-calculate-iob.js
/usr/local/bin/oref0-determine-basal -> /usr/local/lib/node_modules/openaps-js/bin/oref0-determine-basal.js
/usr/local/bin/send-tempbasal-Azure -> /usr/local/lib/node_modules/openaps-js/bin/send-tempbasal-Azure.js
/usr/local/bin/oref0-ifttt-notify -> /usr/local/lib/node_modules/openaps-js/bin/oref0-ifttt-notify
/usr/local/bin/oref0-get-profile -> /usr/local/lib/node_modules/openaps-js/bin/oref0-get-profile.js
/usr/local/bin/reset-wifi-dongle -> /usr/local/lib/node_modules/openaps-js/bin/reset-wifi-dongle.sh
/usr/local/bin/mm-format-ns-glucose -> /usr/local/lib/node_modules/openaps-js/bin/mm-format-ns-glucose.sh
/usr/local/bin/mm-format-ns-pump-history -> /usr/local/lib/node_modules/openaps-js/bin/mm-format-ns-pump-history.sh
/usr/local/bin/oref0 -> /usr/local/lib/node_modules/openaps-js/bin/oref0.sh
/usr/local/bin/mm-stick -> /usr/local/lib/node_modules/openaps-js/bin/mm-stick.sh
/usr/local/bin/openaps-js -> /usr/local/lib/node_modules/openaps-js/bin/oref0.sh
/usr/local/bin/ns-upload-entries -> /usr/local/lib/node_modules/openaps-js/bin/ns-upload-entries.sh
/usr/local/bin/oref0-pebble -> /usr/local/lib/node_modules/openaps-js/bin/oref0-pebble.js
openaps-js@0.0.8 /usr/local/lib/node_modules/openaps-js
└── share2nightscout-bridge@0.1.5 (request@2.53.0)
$ oref0-get-profile
usage:  [ 'node', '/usr/local/bin/oref0-get-profile' ] <pump_settings.json> <bg_targets.json> <isf.json> <current_basal_profile.json> <carb_ratio.json> [<max_iob.json>]
Rachel Sandlain
@audiefile
Oct 17 2015 03:47

pi@raspberrypi ~/openaps-js $ sudo npm install -g
npm http GET https://registry.npmjs.org/share2nightscout-bridge
npm http 304 https://registry.npmjs.org/share2nightscout-bridge
npm ERR! Error: No compatible version found: share2nightscout-bridge@'^0.1.5'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.3","0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5"]
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:685:10)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:607:10
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 4.1.6-v7+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g"
npm ERR! cwd /home/pi/openaps-js
npm ERR! node -v v0.10.2
npm ERR! npm -v 1.2.15
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/openaps-js/npm-debug.log
npm ERR! not ok code 0
pi@raspberrypi ~/openaps-js $ oref0-get-profile
-bash: oref0-get-profile: command not found

Ben West
@bewest
Oct 17 2015 03:48
is it connected to internet? weird
it's not installing
oh
hmm
hmmmm
your npm version is older....
maybe it doesn't like that ^ syntax
Ben West
@bewest
Oct 17 2015 03:54
sudo npm update npm
Ben West
@bewest
Oct 17 2015 03:59
actually
git pull author wip/audiefile/dev
sudo npm install -g
I took out the offending bit
Rachel Sandlain
@audiefile
Oct 17 2015 04:02
:+1: I'm having to re-install nom altogether as I typed the update command wrong
then I'll try that pull
Ben West
@bewest
Oct 17 2015 04:03
npm?oh :-( sorry
npm should be fine
Rachel Sandlain
@audiefile
Oct 17 2015 04:04
yes npm my computer likes to 'fix' things for me
Ben West
@bewest
Oct 17 2015 04:04
what did you actually type? if it errored out, it's probably fine
ok, hehe
Rachel Sandlain
@audiefile
Oct 17 2015 04:04
no I don't think so. the other npm commands errored
Scott Leibrand
@scottleibrand
Oct 17 2015 04:29
well said @mgranberry. thx for chiming in on the email thread :)
Jason Calabrese
@jasoncalabrese
Oct 17 2015 08:03
most or the size is the ethernet port, and it has wifi?
Sulka Haro
@sulkaharo
Oct 17 2015 08:03
yes
Jason Calabrese
@jasoncalabrese
Oct 17 2015 08:06
if it only had BLE too
Oliver Schumacher
@oschumac
Oct 17 2015 08:32
@timomer Hi I have send you an issue with the workaround a made please review. Looks alike when happ start without any settings it will Crash. But you can not get this far. Cause of the crash.
LadyViktoria
@LadyViktoria
Oct 17 2015 09:20
thanks for your workaround :-* now it works in my case too <3
timomer
@timomer
Oct 17 2015 09:39
@LadyViktoria @oschumac great, nice work, will review now. Odd as I have started the app on a fresh phone to be sure default prefs did not result in any issue
timomer
@timomer
Oct 17 2015 09:52
@oschumac I have applied your suggested fix and some feedback. I dont think this is due to any setting missing but lack of treatment data - what is odd as that should of affected me too with a new phone
@sulkaharo that is soooo cool!
LadyViktoria
@LadyViktoria
Oct 17 2015 10:58
@timomer app crashes again if i swipe to ob& cob tab
timomer
@timomer
Oct 17 2015 11:03
@LadyViktoria ok cool, try and add some treatments and see if that helps, update the bug on git hub and we can track it from there
LadyViktoria
@LadyViktoria
Oct 17 2015 11:05
still crash with treatment
timomer
@timomer
Oct 17 2015 11:08
if you can put some of the logcat results in the bug
LadyViktoria
@LadyViktoria
Oct 17 2015 11:18
after a while the app crashes completely and is not able to start again. only uninstall and install again helps
Milos Kozak
@MilosKozak
Oct 17 2015 16:50
blob
Jason Calabrese
@jasoncalabrese
Oct 17 2015 16:55
should be able to convert pump data into this, just need to post new treatments
Scott Leibrand
@scottleibrand
Oct 17 2015 17:09
nice. please also make sure it plays nicely with absolute temp basals, as that's what openaps uses
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:10
Screen Shot 2015-10-17 at 10.09.51 AM.png
need to get it included in the iob calculations
Milos Kozak
@MilosKozak
Oct 17 2015 17:11
blob
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:11
really nice work @MilosKozak
Milos Kozak
@MilosKozak
Oct 17 2015 17:11
absolute temp basal at 18:10 auto ends previous temp basal ;)
Scott Leibrand
@scottleibrand
Oct 17 2015 17:12
I like it. maybe the blue shading should extend from the scheduled-basal dotted line instead of from the top?
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:12
should line up nice with the pump history in
Scott Leibrand
@scottleibrand
Oct 17 2015 17:12
and maybe have two colors, one for positive and one for negative?
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:13
was wondering how that would work for negative
Scott Leibrand
@scottleibrand
Oct 17 2015 17:13
thinking that the size of the colored area will give a quick at-a-glance idea of how much net positive or negative insulin was given, and therefore effect on IOB
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:14
@MilosKozak was also looking at adding checkboxes for iob and cob
just like basal
could all overlay
but need to figure out the scales/colors/etc
Milos Kozak
@MilosKozak
Oct 17 2015 17:15
all can be improved but this enough to start integration i think
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:15
yeah
Scott Leibrand
@scottleibrand
Oct 17 2015 17:16
agreed, this is way better than what we have now (nothing) :)
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:17
I haven't added posting to NS in my test loop, but with this it will be much more interesting
@amazaheri :point_up: October 17, 2015 9:50 AM
Ali Mazaheri
@amazaheri
Oct 17 2015 17:41
NICE
so I can try this with Dev?
can you post a sample json treatment for new temp basal here
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:45
{ "eventType" : "Temp Basal", "duration" : 180, "percent" : 40, "absolute" : "", "created_at" : "2015-10-17T06:00:00.000Z" }
{ "eventType" : "Temp Basal", "duration" : 30, "absolute" : "0.675", "created_at" : "2015-10-17T16:45:00.000Z" }
not on dev yet
nightscout/cgm-remote-monitor#1178
git checkout -b MilosKozak-wip/duration dev
git pull https://github.com/MilosKozak/cgm-remote-monitor.git wip/duration
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:50
couldn't wait and put it on my prod site :wink2:
Milos Kozak
@MilosKozak
Oct 17 2015 17:52
{ "eventType" : "Temp Basal", "duration" : 0 .... cancels temp basal
Ali Mazaheri
@amazaheri
Oct 17 2015 17:58
nice guys!
Fab!
Jason Calabrese
@jasoncalabrese
Oct 17 2015 17:59
it's a little tricky to do the toggle on Heidi's iphone5S, but works going on my nexus6
Ed Raskin
@msrcgm
Oct 17 2015 18:02
Whoa is this the way to visualize/validate? Still stuck and wanting to move forward if anyone has time today.
Ben West
@bewest
Oct 17 2015 18:30
@msrcgm what's going on?
Ali Mazaheri
@amazaheri
Oct 17 2015 18:59
@msrcgm I think doing a push to ur private repo is the good way to start
Jason Calabrese
@jasoncalabrese
Oct 17 2015 19:00
with the new extra ini support @bewest added we shouldn't need private repos
Ali Mazaheri
@amazaheri
Oct 17 2015 19:01
yeah but Ed wants to share with Ben and I to troubleshoot while he is validating :)
Scott Leibrand
@scottleibrand
Oct 17 2015 19:08
You can even keep the pump.ini in the main myopenaps directory, just add it to .gitignore.
Ben West
@bewest
Oct 17 2015 19:09
you don't even need to add it to gitignore
it's never added to the repo by default
I've been using this process along with lazy consensus, but might be good to get more people familiar with it
Ali Mazaheri
@amazaheri
Oct 17 2015 19:16
nice
Scott Leibrand
@scottleibrand
Oct 17 2015 19:28
I like .gitignore just to keep git status clean.
Ali Mazaheri
@amazaheri
Oct 17 2015 19:38
u like my bombs too [tab][tab]
Ben West
@bewest
Oct 17 2015 19:38
[tab][tab]
long live tab
Ed Raskin
@msrcgm
Oct 17 2015 19:50
@bewest just needing next steps. My alias now works properly in that it calculates iob correctly. That was my "final" hurdle. Now I need to run for several hours for several nights to validate before using. I need help with 1) chron and 2) storing the output so I can cross check.
Ben West
@bewest
Oct 17 2015 19:57
openaps use units bg_targets --to mmol/L monitor/bg-targets.json new units device :-D
@msrcgm , for cron, there's few things, you have your alias already?
so to look at what cron knows, we use cron -l to dump it out
mine looks like this:
Ali Mazaheri
@amazaheri
Oct 17 2015 19:58
he has a loop.sh
with his alias magic in it
Ben West
@bewest
Oct 17 2015 19:59
$ crontab  -l

SHELL=/bin/bash
PATH=/home/bewest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

*/5 * * * * (cd ~/Documents/foo && openaps do-everything) 2>&1 | logger -t openaps-loop
bewest@hither:~/src/dexcom_reader$
so the openaps <my-alias-here>
at the end
Ali Mazaheri
@amazaheri
Oct 17 2015 19:59
he needs to do a git push so he can look at history the next day on github
or logging
his plan is to do the validation first before enacting which is right paln
Ben West
@bewest
Oct 17 2015 20:00
that line causes cron to run this thing every five minutes
right
so you can change that do-everything part to something else you want to run
what's happening is the cd ~/Documents/foo is where my personal openaps lives on disk
so it'll be something like pi instead of bewest everywhere
and it'll be your myopenaps directory instead of ~/Documents/foo`
the other bits, around it, what's happening is the 2>&1 is "tying" all the errors to the "standard" output, so they both go to "the same place"
and lastly, the | logger -t openaps-loop is sending it to the system wide logger
we can view the results: tail -f /var/log/syslog
timomer
@timomer
Oct 17 2015 20:18
@LadyViktoria I have added Crashlytics to capture some of these crashes I cannot reproduce. If you have any problems get as much info as poss and add a github issue. hopefully ill start collecting enough info to workout where the issue is. be sure to get the most recent code
Ali Mazaheri
@amazaheri
Oct 17 2015 20:19
@bewest change the foo to unicorn [tab][tab]
timomer
@timomer
Oct 17 2015 20:19
want to avoid cluttering gitter with details
LadyViktoria
@LadyViktoria
Oct 17 2015 20:25
<3
John Males
@johnmales
Oct 17 2015 21:33
With the new .ini support, if I understand correctly you move the pump serial number from openaps.ini to pump.ini and the pump.ini can live in your main openaps directory. Is this correct? Is there anything specific you need to do create a public git repo on github from your openaps directory to make sure private details are kept private?
Scott Leibrand
@scottleibrand
Oct 17 2015 22:15
Just don't git add pump.ini, or echo pump.ini >> .gitignore to make sure
John Males
@johnmales
Oct 17 2015 22:16
Ok
Ben West
@bewest
Oct 17 2015 22:41
so it does show up in the git log
Ben West
@bewest
Oct 17 2015 22:50
I reworked get-profile this afternoon to split it up a bit