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

13th
Sep 2015
Scott Leibrand
@scottleibrand
Sep 13 2015 00:01
It doesn't have all the safety features openaps-js determine-basal does. Do it'd be better if we could combine determine-basal with mmhistorytools and openaps-predict's iob calculations.
Rachel Sandlain
@audiefile
Sep 13 2015 00:04
Scott in loop.sh does the status alias do anything besides call for a status.json?
Scott Leibrand
@scottleibrand
Sep 13 2015 00:05
Nope. And that isn't even used. I removed it in my latest feature branch.
Originally I was going to check whether the pump is suspended, but never got around to it.
Rachel Sandlain
@audiefile
Sep 13 2015 00:07
Ok I'm still looking at master
I won't worry about it then
Rachel Sandlain
@audiefile
Sep 13 2015 00:19
where is openaps-mongo.sh? that's something I haven't come across
Oskar Pearson
@oskarpearson
Sep 13 2015 00:29
@audiefile are you uploading to nightscout? I think you can just replace that bit with the command you use to push to nightscout
Rachel Sandlain
@audiefile
Sep 13 2015 00:32
I am but not with the pi
Scott Leibrand
@scottleibrand
Sep 13 2015 02:15
I also commented out openaps-mongo in the latest branch.
Gonna use nightscout REST API instead of direct mongo upload.
It was a dumb script that just did lots of mongoimport, and had all of our db info hard coded.
diabeticgonewild
@diabeticgonewild
Sep 13 2015 02:28
I still have to upload the commented version of determine-basal.js....way to go Monica on not following through on things!
Rachel Sandlain
@audiefile
Sep 13 2015 03:55
REST is the way to go for sure. Not sure if you all know but mongo is updating and some drivers won't work anymore.
I'll start working with the new-loop branch instead of master.
Scott Leibrand
@scottleibrand
Sep 13 2015 04:28
Yeah. I was mongoimporting to my own mongodb instance on my own server as well, but don't like the insecurity of that, and was having issues syncing.
Cool, LMK if you have any issues with it.
Rachel Sandlain
@audiefile
Sep 13 2015 19:50
I will! :)
Scott Leibrand
@scottleibrand
Sep 13 2015 19:56
just added https://github.com/openaps/openaps-js/blob/new-loop/bin/ns-upload.sh and uploaded new-loop/bin/loop.sh to use it. so now I have openaps uploading pumphistory to nightscout /api/v1/entries.json
I also updated DIYPS to do the correct thing with it (the same as it was doing when it was mongoimported into the pump collection previously), which includes copying over the boluses and generated microboluses to treatments so that nightscout can display them correctly. that obviously doesn't help any one else directly, but it does indicate that the uploads are working properly, so once we get nightscout updated to read basal and bolus entries from the entries collection it should be able to display them directly
Ben West
@bewest
Sep 13 2015 19:58
might be nice to save the output as report in ./diagnostics/nightscout-upoaded.json or something
that looks nice though
might put Author: Ben West, Maintainer: Scott Leibrand or similar at the top :-)
Scott Leibrand
@scottleibrand
Sep 13 2015 20:02
done. :)
I did comment out your TZ stuff because it was overriding local TZ if not specified
Ben West
@bewest
Sep 13 2015 20:03
yeah, pattern is: TZ=${TZ-default_if_undefined}
it's not needed until it's a probem
if/when it becomes a problem we'll know how to fix/add it
so fine to be commented for now
Scott Leibrand
@scottleibrand
Sep 13 2015 20:04
yeah, didn't figure that feature would be needed for my use case
Ben West
@bewest
Sep 13 2015 20:04
when you want to fix it, it'll be something like {3-$(date +%z)} I think
Scott Leibrand
@scottleibrand
Sep 13 2015 20:06
that worked. updating.
Ben West
@bewest
Sep 13 2015 20:08
hmmm not sure that's right actually
not sure it should be in there... if that's in there, this script has 3 jobs...
Ben West
@bewest
Sep 13 2015 20:09
yeah, hopefully works in Copenhagen, Australia, etc
guess it'll be fine by default
guess it's fine
Scott Leibrand
@scottleibrand
Sep 13 2015 20:10
we'll find out soon enough. :)
Ben West
@bewest
Sep 13 2015 20:10
interesting I guess TZ gets ignored in the common case
when date actually runs
TZ=TZ date ...
but since it's the default zone in that case, it's fine
think the representation expected is properly qualified name, not a number
but, it doesn't matter because we want system default then anyway
Scott Leibrand
@scottleibrand
Sep 13 2015 20:12
hey, any chance you could look at the docs PR Dana tagged you in?
Ben West
@bewest
Sep 13 2015 20:12
openaps/docs#4 ?
Ali Mazaheri
@amazaheri
Sep 13 2015 20:14
Ed is waiting :)
We completely switched to Share and bridge. No more cables, no more android phones.
Jason Calabrese
@jasoncalabrese
Sep 13 2015 20:18
if dexcom's server go down your loop stops, that's ok? they did a full maintenance window at least once already
Ali Mazaheri
@amazaheri
Sep 13 2015 20:26
no Dexcom second receiver still connected to RasPi :)
Scott Leibrand
@scottleibrand
Sep 13 2015 20:27
we have both our Share and non-share receivers connected to Pi's overnight, but they fall back to share if not plugged in
Ali Mazaheri
@amazaheri
Sep 13 2015 20:27
Indeed :)
Scott Leibrand
@scottleibrand
Sep 13 2015 20:27
are you using my share2-bridge thing?
Ali Mazaheri
@amazaheri
Sep 13 2015 20:27
not yet, thats next
Scott Leibrand
@scottleibrand
Sep 13 2015 20:30
probably need to PR those changes back upstream. looks like I already opened a PR back in July: bewest/share2nightscout-bridge#19
Dana Lewis
@danamlewis
Sep 13 2015 20:30
Thanks @bewest ! #4 is merged and ready for @msrcgm to run through
Ben West
@bewest
Sep 13 2015 20:31
did I miss an open question in there?
was there formatting help wanted?
Scott Leibrand
@scottleibrand
Sep 13 2015 20:31
just suggesting merging into your master
unless you see any issues of course
and then maybe making it an official openaps repository
Dana Lewis
@danamlewis
Sep 13 2015 20:33
@bewest Possibly. Sometimes the numbered list works and sometimes they all show as 1s after number 3.
scottleibrand @scottleibrand was assuming @bewest was asking me about the open question. @danamlewis thinks that was directed at her, though. :)
Ali Mazaheri
@amazaheri
Sep 13 2015 20:34
lassic
Jason Calabrese
@jasoncalabrese
Sep 13 2015 20:34
I've seen that when there's an extra new line
Dana Lewis
@danamlewis
Sep 13 2015 20:35
I delete all the breaks...didn't work. Put the breaks back in..worked for me but @channemann said it didn't work for him.
Ali Mazaheri
@amazaheri
Sep 13 2015 20:39
I really loved the view and flow! nice job guys ...
Dana Lewis
@danamlewis
Sep 13 2015 20:40
the link I just sent @msrcgm shows the 1.s. (Still works and still tests). So yea @bewest if you can re-take a look at rpi.md now and see if you can spot my formatting bonk, that would be great
thx @amazaheri. Assuming you were talking about #4 that is ;)
Ali Mazaheri
@amazaheri
Sep 13 2015 20:40
more fun than pressing TAB and writing NodeJS code inside Visual Studio lmao!
yes 34
Ed Raskin
@msrcgm
Sep 13 2015 20:43
Thanks @bewest got it. I'll let you know how it goes
Ali Mazaheri
@amazaheri
Sep 13 2015 20:44
@bewest where is your picture profile! :-1:
Ben West
@bewest
Sep 13 2015 20:44
for bridge, nightscout is dependin on some changes that need to go in first
Ali Mazaheri
@amazaheri
Sep 13 2015 20:44
To prove this is not a bot :)
Dana Lewis
@danamlewis
Sep 13 2015 20:44
you'll have to give @msrcgm equal amounts of crap for that ;) (or wait until he gets his rPi going first ;))
Ali Mazaheri
@amazaheri
Sep 13 2015 20:45
@msrcgm been waiting to do this impatiently! :)
Dana Lewis
@danamlewis
Sep 13 2015 20:45
he could have uploaded a photo in the meantime ;)
Ali Mazaheri
@amazaheri
Sep 13 2015 20:46
hehe
Ben West
@bewest
Sep 13 2015 20:49
I am a cyborg, ali
Ali Mazaheri
@amazaheri
Sep 13 2015 20:50
lol when you get in to town
Ben West
@bewest
Sep 13 2015 20:50
hmm, what day should I come?
not sure where I should stay, actually
might see about ross/jason c or someone
Ali Mazaheri
@amazaheri
Sep 13 2015 20:51
James geting Thursday night for work but lets coordinate
We can doa hackton on Friday at our office
and also review networking stuff, tom will be there too
JAson can join us as well
Ben West
@bewest
Sep 13 2015 20:53
ok, so thursday night possibly for easiest, need to figure out where/who to stay with
Ali Mazaheri
@amazaheri
Sep 13 2015 20:53
will figure it out
Jason Calabrese
@jasoncalabrese
Sep 13 2015 21:10
Think I'm going to be taking the kids to Disneyland on Friday
Saturday evening hacking around dinner or Sunday after closing session might be good
Ali Mazaheri
@amazaheri
Sep 13 2015 21:11
cool!
Ben you can plan Flying in Friday and a return Sunday evening
I can pick u up from Airport and drop you on Sunday
Ben West
@bewest
Sep 13 2015 21:13
hmm, so early friday morning
Ali Mazaheri
@amazaheri
Sep 13 2015 21:13
sure
Ben West
@bewest
Sep 13 2015 21:13
makes me bit nervous... in last 6 months, I've missed 4 morning flights out of 6
Ali Mazaheri
@amazaheri
Sep 13 2015 21:14
then do thursday
Ben West
@bewest
Sep 13 2015 21:14
fantastic :), many thanks
Ali Mazaheri
@amazaheri
Sep 13 2015 21:14
:)
Ben West
@bewest
Sep 13 2015 21:15
john wayne, awesome looking forward to it
Ali Mazaheri
@amazaheri
Sep 13 2015 21:16
:+1:
Ben West
@bewest
Sep 13 2015 21:17
ok, I'm going to go bounce around with my 20 month year old nephew on some trampolines
Ali Mazaheri
@amazaheri
Sep 13 2015 21:17
have fun
Ben West
@bewest
Sep 13 2015 21:17
laters :-)
later alligator :-)
Scott Leibrand
@scottleibrand
Sep 13 2015 21:31
just pushed openaps/openaps-js@4fae510 to bolus-low-snooze and new-loop: should fix the logic for not setting temps when iob > max_iob and a high-temp is called for.
Scott Leibrand
@scottleibrand
Sep 13 2015 21:39
ok, I think I need to bite the bullet and get a unit testing library set up for openaps-js today. can anyone point me in the right direction there? I think @jasoncalabrese mentioned there is something nightscout is using that I might be able to...
or maybe that was @sulkaharo
Jason Calabrese
@jasoncalabrese
Sep 13 2015 21:44
Should be able to copy the basic setup from ns, maybe start with iob, should be able to get that close
You'll probably have to do some refactoring to expose some functions
I'd like to be able to share some of the calculations
Scott Leibrand
@scottleibrand
Sep 13 2015 21:47
which bits are the unit testing bits?
lodash? moment? ??
Scott Leibrand
@scottleibrand
Sep 13 2015 21:53
I think I need a high-level overview
looks like neither lodash nor moment are specific to unit tests...
Jason Calabrese
@jasoncalabrese
Sep 13 2015 22:40
We've been using lodash and moment a lot, but not specific to tests
Scott Leibrand
@scottleibrand
Sep 13 2015 22:41
k
so which of the stuff in the makefile is required just for basic tests run from make?
just test: section?
so just mocha and should.js?
Jason Calabrese
@jasoncalabrese
Sep 13 2015 22:42
Maybe copy units.test.js it's really basic
Scott Leibrand
@scottleibrand
Sep 13 2015 22:42
what does istanbul do?
Jason Calabrese
@jasoncalabrese
Sep 13 2015 22:43
That's for the code coverage
Mocha is the test runner
Scott Leibrand
@scottleibrand
Sep 13 2015 22:43
ok, cool. I think I understand enough to start with units.test.js
also probably need to refactor and functionalize my determine-basal.js code too, like you said. :)
Jason Calabrese
@jasoncalabrese
Sep 13 2015 22:44
For the it('do something...', function () {});
That's the simple form
Some tests will have a callback, then you need to call done()
Scott Leibrand
@scottleibrand
Sep 13 2015 22:45
k
Rachel Sandlain
@audiefile
Sep 13 2015 23:14
I'm trying to learn some git. Is there a fancy way to get just the loop.sh from new-loop branch without switching to the all new branch?
Sulka Haro
@sulkaharo
Sep 13 2015 23:18
Yay @scottleibrand you got your answer. Yes it was me.
Scott Leibrand
@scottleibrand
Sep 13 2015 23:33
git operates on commits, not files
you can cherry-pick a particular commit into a different branch...
not sure how you would go about copying the entire file, other than just doing a "cp" outside of git
Rachel Sandlain
@audiefile
Sep 13 2015 23:36
ok.
Scott Leibrand
@scottleibrand
Sep 13 2015 23:37
I am by no means a git expert, though, so that doesn't mean it can't be done
maybe you can do some sort of single-file merge or something
Rachel Sandlain
@audiefile
Sep 13 2015 23:38
What I really want to do is have the new loop.sh but keep the rest of the openaps-js plugins so I don't break my currently working loop.
Scott Leibrand
@scottleibrand
Sep 13 2015 23:38
yeah, that's gonna require some work...
there's quite a few assumptions in my loop.sh about the format of the input data
actually, if you have all the original raw-data reports for it to use...
hmm, let me think about this
Rachel Sandlain
@audiefile
Sep 13 2015 23:40
I have two directories. One that I'm actually using. One for dev.
Scott Leibrand
@scottleibrand
Sep 13 2015 23:40
do you even have openaps-js checked out yet?
Rachel Sandlain
@audiefile
Sep 13 2015 23:40
Yes
Scott Leibrand
@scottleibrand
Sep 13 2015 23:40
just for this experiment, or were you using it for your loop too?
Rachel Sandlain
@audiefile
Sep 13 2015 23:41
I use iob and determine basal. I just wrote my own loop
Scott Leibrand
@scottleibrand
Sep 13 2015 23:41
ok, where does your loop live? not in openaps-js/bin/ I presume...
everything in new-loop branch should be backwards compatible if you're just calling determine-basal, iob, get-profile, etc.
assuming none of the code you added is inside openaps-js, you can checkout the new-loop branch and make sure it still works, and then checkout master again if it doesn't
Rachel Sandlain
@audiefile
Sep 13 2015 23:42
nope. my loop is called closed loop.sh and lives in myopenaps. I'm trying to get loop.sh working in openaps-dev
Scott Leibrand
@scottleibrand
Sep 13 2015 23:43
or you can clone a second copy of openaps-js if you want
ok, then you should be good to pull in the latest branch of openaps-js: the new-loop stuff "shouldn't" affect your loop
but test it obviously. :)
Rachel Sandlain
@audiefile
Sep 13 2015 23:44
ok that sounds much easier. I wasn't sure if it was a whole new branch with a bunch of changes or basically the same branch but with a new loop
Scott Leibrand
@scottleibrand
Sep 13 2015 23:45
mostly the latter. the changes to other files are mostly bug fixes and minor algorithm tweaks that are also present in the bolus-low-snooze branch
(in other words, stuff that is going to go to master soon, one way or another)