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

22nd
Oct 2015
live4sw
@live4sw
Oct 22 2015 00:01
if that sounds like kind of the right track, i'll spend a while on that. i've never done anything in js before (I am beginner-level python, though I am good at following instructions and figuring things out), so i will spend a while exploring
Chris Hannemann
@channemann
Oct 22 2015 00:02
close, you're actually using report instead of use
use is great for testing things out; report is for when you want to generate those sweet, sweet JSON files
Check out the "Adding and Invoking Reports" section on this docs page for more on that: https://openaps.gitbooks.io/building-an-open-artificial-pancreas-system/content/docs/Using-openaps-Tools/using.html
Ben West
@bewest
Oct 22 2015 00:03
use allows you to practice using the tools
and lets you see what the use actually does
once you "like" the way it looks, you "save" the "use" in a "report"
live4sw
@live4sw
Oct 22 2015 00:04
aha. once i create those files, do i then just need to make sure i run the relevant oref0 command in the current working directory with those files?
Ben West
@bewest
Oct 22 2015 00:05
so that's the tricky thing to undersatnd
adding report doesn't create the file
it saves the config to make the file automatically
so basically the previous "use" command you saved
is the same as openaps report invoke my-new.json
whatever you "named" the report, the use that was added gets run to save the file when the report is invoked
so use is for mastering the command line flags, seeing what data comes out
report add ... "saves" the configuration to match that use to a filename
report invoke runs the saved use and stores it in the file
live4sw
@live4sw
Oct 22 2015 00:07
got it. so use to test, report add to save, report invoke to create
Ben West
@bewest
Oct 22 2015 00:07
exactly
create/refresh/update/save
report add is to configure
live4sw
@live4sw
Oct 22 2015 00:08
how do i know the proper format for the files that i need to create? is it pretty intuitive from the filename that a fairly obvious use command in openaps will output what i need to input in the relevant oref0 command?
Ben West
@bewest
Oct 22 2015 00:09
yeah, if it's the -h help isn't clear enough let us know
you can try it out for use to see that the data looks like eg carb targets vs clock
that's to help you feel comfy
then save it in the report
then you practice with next set of uses, so the "output" from the previous step goes in as the "input" to the next step
git log --grep=" add " on my openaps-example shows all the openaps commands I used to add things
live4sw
@live4sw
Oct 22 2015 00:12
nice. I feel that I have enough from this chat to experiment for a while and hopefully come back understanding a bit more
thanks very much
Ben West
@bewest
Oct 22 2015 00:12
no worries, feel free to ask questions
when I go through this with people, I always make sure to get them set up with tab completion, which can help make this a lot less daunting
the way it works is you don't have to type everything perfectly.. you can hit [tab][tab] and get list of the valid choices, so much less worry about typing things
Chris Hannemann
@channemann
Oct 22 2015 00:13
I believe tab completion is set up if you followed the docs
Dana Lewis
@danamlewis
Oct 22 2015 00:14
Yes. tab tab, and when in doubt, -h
live4sw
@live4sw
Oct 22 2015 00:14
oh nice, knew about -h but had no idea about tab tab
Ben West
@bewest
Oct 22 2015 00:15
your homework is play with tab tab
will make it a lot less daunting
sometimes I just tab while I'm thinking
Dana Lewis
@danamlewis
Oct 22 2015 00:16
(that should be on our short list of bumper sticker/tshirt phrase contenders)
wow, here's the most successful one I've seen so far https://experiment.com/projects/finding-a-cure-for-batten-disease?s=discover
Scott Leibrand
@scottleibrand
Oct 22 2015 06:52
@bewest calculate-iob is still broken in dev. opened openaps/oref0#9 to track.
I also cherry-picked everything over from dev to old-iob, for those of us who actually want our loops to work. ;-)
Ben West
@bewest
Oct 22 2015 07:13
I'm getting everything fine
@scottleibrand can you post the errors you're getting? and maybe how you installed it, I think sudo npm install -g oref0 should work at v 0.0.11
Scott Leibrand
@scottleibrand
Oct 22 2015 16:19
I was doing sudo npm install -g ./ from oref0 dev branch.
Ali Mazaheri
@amazaheri
Oct 22 2015 16:26
ben got the same using master last night
Scott Leibrand
@scottleibrand
Oct 22 2015 16:26
master is known broken, and dev has a fix for that
question is whether dev is still broken
Ali Mazaheri
@amazaheri
Oct 22 2015 16:27
ah, didnt know that
Scott Leibrand
@scottleibrand
Oct 22 2015 16:27
interesting. mine works with sudo npm install -g oref0
but not with cd ~/oref0 && git checkout dev && git pull && sudo npm install -g ./
Ali Mazaheri
@amazaheri
Oct 22 2015 16:28
hmmm
Scott Leibrand
@scottleibrand
Oct 22 2015 16:29
pi@rpi3 ~/openaps-dev $ sudo npm install -g oref0
sudo: unable to resolve host rpi3
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine boom@2.9.0: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
/usr/local/bin/oref0-calculate-iob -> /usr/local/lib/node_modules/oref0/bin/oref0-calculate-iob.js
/usr/local/bin/oref0-determine-basal -> /usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js
/usr/local/bin/send-tempbasal-Azure -> /usr/local/lib/node_modules/oref0/bin/send-tempbasal-Azure.js
/usr/local/bin/oref0-get-profile -> /usr/local/lib/node_modules/oref0/bin/oref0-get-profile.js
/usr/local/bin/oref0-mint-max-iob -> /usr/local/lib/node_modules/oref0/bin/oref0-mint-max-iob.sh
/usr/local/bin/oref0-ifttt-notify -> /usr/local/lib/node_modules/oref0/bin/oref0-ifttt-notify
/usr/local/bin/oref0-reset-usb -> /usr/local/lib/node_modules/oref0/bin/reset-usb.sh
/usr/local/bin/mm-format-ns-glucose -> /usr/local/lib/node_modules/oref0/bin/mm-format-ns-glucose.sh
/usr/local/bin/mm-format-ns-pump-history -> /usr/local/lib/node_modules/oref0/bin/mm-format-ns-pump-history.sh
/usr/local/bin/oref0 -> /usr/local/lib/node_modules/oref0/bin/oref0.sh
/usr/local/bin/mm-stick -> /usr/local/lib/node_modules/oref0/bin/mm-stick.sh
/usr/local/bin/ns-upload-entries -> /usr/local/lib/node_modules/oref0/bin/ns-upload-entries.sh
/usr/local/bin/oref0-pebble -> /usr/local/lib/node_modules/oref0/bin/oref0-pebble.js
oref0@0.0.11 /usr/local/lib/node_modules/oref0
├── share2nightscout-bridge@0.1.5 (request@2.53.0)
└── timezone@0.0.47
pi@rpi3 ~/openaps-dev $ openaps invoke monitor/iob.json; cat monitor/iob.json
iob://text/shell/monitor/iob.json
reporting monitor/iob.json
{"iob":-0.6615879846922222,"activity":-0.006460670194003526,"bolusiob":0}


pi@rpi3 ~/oref0 $ git checkout dev
Switched to branch 'dev'
Your branch is up-to-date with 'origin/dev'.
pi@rpi3 ~/oref0 $ git pull
Already up-to-date.
pi@rpi3 ~/oref0 $ sudo npm install -g ./
sudo: unable to resolve host rpi3
npm WARN engine boom@2.9.0: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
/usr/local/bin/oref0-calculate-iob -> /usr/local/lib/node_modules/oref0/bin/oref0-calculate-iob.js
/usr/local/bin/oref0-determine-basal -> /usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js
/usr/local/bin/send-tempbasal-Azure -> /usr/local/lib/node_modules/oref0/bin/send-tempbasal-Azure.js
/usr/local/bin/oref0-get-profile -> /usr/local/lib/node_modules/oref0/bin/oref0-get-profile.js
/usr/local/bin/oref0-mint-max-iob -> /usr/local/lib/node_modules/oref0/bin/oref0-mint-max-iob.sh
/usr/local/bin/oref0-ifttt-notify -> /usr/local/lib/node_modules/oref0/bin/oref0-ifttt-notify
/usr/local/bin/oref0-reset-usb -> /usr/local/lib/node_modules/oref0/bin/reset-usb.sh
/usr/local/bin/mm-format-ns-glucose -> /usr/local/lib/node_modules/oref0/bin/mm-format-ns-glucose.sh
/usr/local/bin/mm-format-ns-pump-history -> /usr/local/lib/node_modules/oref0/bin/mm-format-ns-pump-history.sh
/usr/local/bin/oref0 -> /usr/local/lib/node_modules/oref0/bin/oref0.sh
/usr/local/bin/mm-stick -> /usr/local/lib/node_modules/oref0/bin/mm-stick.sh
/usr/local/bin/ns-upload-entries -> /usr/local/lib/node_modules/oref0/bin/ns-upload-entries.sh
/usr/local/bin/oref0-pebble -> /usr/local/lib/node_modules/oref0/bin/oref0-pebble.js
oref0@0.0.11 /usr/local/lib/node_modules/oref0
├── share2nightscout-bridge@0.1.5 (request@2.53.0)
└── timezone@0.0.47
pi@rpi3 ~/oref0 $


pi@rpi3 ~/openaps-dev $ openaps invoke monitor/iob.json; cat monitor/iob.json
iob://text/shell/monitor/iob.json
reporting monitor/iob.json
{"iob":0,"activity":0,"bolusiob":0}
Ali Mazaheri
@amazaheri
Oct 22 2015 16:33
now more confused 😊 last night i did the former and was getting 0 😊
Scott Leibrand
@scottleibrand
Oct 22 2015 16:35
hmm, and i just did sudo npm install -g oref0 again and am getting 0's again
Ali Mazaheri
@amazaheri
Oct 22 2015 16:35
lol
ok for now i stay on old iob
i am planning to debug the code and trace it later this afternoon with my beloved visual studio unless u gentlemen hash it out
looks like 0.0.7 breaks the x12
so i have one sd with 0.0.6 and hybrid oref0 working
and dev sd with 0.0.7 and 0.0.11 broken
both running 0.0.0.18 decocare
Scott Leibrand
@scottleibrand
Oct 22 2015 16:41
i haven't been able to get npm link to do anything useful, either, so not sure how to proceed with code debugging without a painfully slow process of npm install -g ./ after every debug statement I add. so you'll probably beat me to that.
when running npm link I still get /usr/local/bin/oref0-calculate-iob -> /usr/local/lib/node_modules/oref0/bin/oref0-calculate-iob.js, so it's not linking properly it appears
Ali Mazaheri
@amazaheri
Oct 22 2015 16:45
I can step through code so I tackle that while @bewest is sleeping :)
Scott Leibrand
@scottleibrand
Oct 22 2015 16:50
:+1:
Jason Calabrese
@jasoncalabrese
Oct 22 2015 17:24
sudo npm install -g oref0 would pull from npm, not your local install
does sudo npm install -g work? without the ./
Scott Leibrand
@scottleibrand
Oct 22 2015 18:28
yeah, not sure why installing the same package from oref0 (npm) vs. ./ would make a difference. not at home any longer, so will have to wait until tonight to try without ./
Ben West
@bewest
Oct 22 2015 18:53
./ is not correct
npm link needs sudo: sudo npm link oref0
but on rpi why do you need the repo?
Ben West
@bewest
Oct 22 2015 19:17
check you get-profile report
your report... remember you added the report with carbs
then you removed carbs from the code
Scott Leibrand
@scottleibrand
Oct 22 2015 19:20
I like to do my development on the pi where I'm testing/running it
I did use sudo; will try tonight with oref0 instead of ./
Ben West
@bewest
Oct 22 2015 19:20
that's only with link
Scott Leibrand
@scottleibrand
Oct 22 2015 19:20
and check get-profile
yeah
Ben West
@bewest
Oct 22 2015 19:21
I ran the link thing twice
because i saw some differences: link vs link oref0, looked like the second one symlinked the actual lib directory, not sure
Scott Leibrand
@scottleibrand
Oct 22 2015 19:22
k
Ben West
@bewest
Oct 22 2015 19:23
openaps/oref0#8 also, master is even with dev
can't leave master in broken state, it should work
dev might be in broken state... but I'm assuming any code merged to dev was tested/run
Ali Mazaheri
@amazaheri
Oct 22 2015 19:32
@bewest I did try the 0.0.11 by running npm install -g oref0
Ben West
@bewest
Oct 22 2015 19:32
how'd it go?
Ali Mazaheri
@amazaheri
Oct 22 2015 19:33
and ran it for a while but didnt get negative IOB
Ben West
@bewest
Oct 22 2015 19:33
sudo
sudo npm install -g oref0
Ali Mazaheri
@amazaheri
Oct 22 2015 19:33
throwing 0
yeah
correct
Ben West
@bewest
Oct 22 2015 19:33
hmm
it installed 0.0.11
hmmm
Ali Mazaheri
@amazaheri
Oct 22 2015 19:33
but then switched to old iob calculate iob
Scott Leibrand
@scottleibrand
Oct 22 2015 19:33
a lot of the dev work happened before I had a working oref0 instance, but since then I've thoroughly tested the old-iob branch and confirmed it works correctly. I haven't managed to get the dev branch working yet, and haven't tried master.
Ali Mazaheri
@amazaheri
Oct 22 2015 19:33
and got negative let me share the results
in a nutshell I didnt use the dev branch
as I saw ur fix was already on master 0.0.11
Ben West
@bewest
Oct 22 2015 19:34
after that it started working for me
along the way, there were times when openaps-js and oref0 were fighting each other I belive
because openaps-js has been installing itself as oref0 for a few weeks now I guess
Ali Mazaheri
@amazaheri
Oct 22 2015 19:35
i deleted openaps-js
from modulkes
Ben West
@bewest
Oct 22 2015 19:35
then, I burned through several versions fixing mistakes in the packaging/npm stuff
it's worth double checking the reports... a lot of times when we've changed things, I go back to debugging with basic use command to see what's happening and double checking the reports
Ali Mazaheri
@amazaheri
Oct 22 2015 19:48
I did and was getting 0 thats when I switched.
Ben West
@bewest
Oct 22 2015 20:07
need to check reports
I got this until I realized it was due to side-effect from deleting carbs from that tool
means the last two inputs are wrong for that tool