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

14th
Sep 2015
Rachel Sandlain
@audiefile
Sep 14 2015 00:13
(y)
That was meant to be a thumbs up but this isn't Facebook apparently
Scott Leibrand
@scottleibrand
Sep 14 2015 00:15
heh
Jason Calabrese
@jasoncalabrese
Sep 14 2015 00:23
:+1:
Scott Leibrand
@scottleibrand
Sep 14 2015 01:38

woohoo: got basic tests working!
$ make
mocha tests/*.js

setTempBasal
{"duration":0,"rate":0}
✓ should cancel temp
{"duration":30,"rate":0}
✓ should set zero temp
{"duration":30,"rate":2}
✓ should set high temp
{"duration":30,"rate":3}
✓ should limit high temp to max_basal
{"duration":30,"rate":3.9}
✓ should limit high temp to 3 max_daily_basal
{"duration":30,"rate":2.8}
✓ should limit high temp to 4
current_basal
{"duration":30,"rate":0.7}
✓ should set current_basal as temp on cancel if offline

7 passing (24ms)

Jason Calabrese
@jasoncalabrese
Sep 14 2015 01:38
nice
does make coverage work
Scott Leibrand
@scottleibrand
Sep 14 2015 01:39
I don't have that defined

$ cat Makefile
TESTS=tests/*.js

all: test

test:
mocha ${TESTS}

stupid simple
Jason Calabrese
@jasoncalabrese
Sep 14 2015 01:39
a good way to start
Scott Leibrand
@scottleibrand
Sep 14 2015 01:40
eventually will need to figure out how to install all the other stuff you have
Jason Calabrese
@jasoncalabrese
Sep 14 2015 01:40
should pull mocha from node_modules so it doesn't need to be installed globaly
Scott Leibrand
@scottleibrand
Sep 14 2015 01:40
but first I want to write test cases for the actual determinebasal function
Jason Calabrese
@jasoncalabrese
Sep 14 2015 01:55
@amazaheri do you want some time during the "A Day in the Loop with Nightscout" cwd session to demo your OpenAPS/NS integration
Ali Mazaheri
@amazaheri
Sep 14 2015 01:57
We should be able, lets discuss it. @scottleibrand @danamlewis thoughts?
Jason Calabrese
@jasoncalabrese
Sep 14 2015 01:58
planing to go over careportal, iob, bwp, pushover, etc, but also want to talk about using NS as an OpenAPS dashboard
the overlap between the 2, etc
Ali Mazaheri
@amazaheri
Sep 14 2015 01:59
good! we just need to resolve the display issue with .80
or demo with .70
but great idea
I had great responses to various folks demoing the loop
Jason Calabrese
@jasoncalabrese
Sep 14 2015 01:59
I haven't seen a running site with the issue yet
Ali Mazaheri
@amazaheri
Sep 14 2015 02:00
I send u one soon,
what i see
when switch to 24 hour they show up
but not in 6 12 or 3
Jason Calabrese
@jasoncalabrese
Sep 14 2015 02:01
very strange
Ali Mazaheri
@amazaheri
Sep 14 2015 02:04
yeah, I spend some time to see whats going on but probably we should hack into it
Scott Leibrand
@scottleibrand
Sep 14 2015 02:04
:+1:
Dana Lewis
@danamlewis
Sep 14 2015 02:07
Woot @amazaheri Should definitely talk OpenAPS!
Would love to see any slides to make sure our language is synced for answers on "how do I get that?!!!!" :)
(Related to our call last week too)
Jason Calabrese
@jasoncalabrese
Sep 14 2015 02:08
I'd like to see some slides too
keep hoping they magically appear
Ali Mazaheri
@amazaheri
Sep 14 2015 02:09
I start a draft powerpoint and share so we can tweak and finalize
Scott Leibrand
@scottleibrand
Sep 14 2015 02:10
heh. so many things we all keep wishing would magically appear
Jason Calabrese
@jasoncalabrese
Sep 14 2015 02:10
was thinking for part of it going around the clock for 24 hours of a composite day, a low caught and corrected by health tech, without parents, a bwp alarm suggesting it's time to bolus before going out of range, the bwp snoozing a high a alarm after a correction, etc
Dana Lewis
@danamlewis
Sep 14 2015 02:11
@amazaheri Sounds excellent thanks
That might help pr
Prompt me to do some updates on openAPS.org for anyone who checks it out after the talk
Jason Calabrese
@jasoncalabrese
Sep 14 2015 02:12
been seeing lots of fb links going to your cob diyps page
Dana Lewis
@danamlewis
Sep 14 2015 02:13
Oh really? Cool
Rachel Sandlain
@audiefile
Sep 14 2015 02:18
lots of people enabling bwp
it's linked as a reference for getting profile settings accurate so that bwp can be more accurate
Jason Calabrese
@jasoncalabrese
Sep 14 2015 02:21
when we get Milos's bolus wizard in we'll have crossed every line up to controlling the pump
Dana Lewis
@danamlewis
Sep 14 2015 02:25
Neat, Thx @audiefile .
@jasoncalabrese :)
Peter Miller
@ochenmiller
Sep 14 2015 02:53
Got a Medtronic 722 up and talking via Carelink USB. Very pleased.
Scott Leibrand
@scottleibrand
Sep 14 2015 02:56
nice!
Peter Miller
@ochenmiller
Sep 14 2015 03:05
Setting a goal of overnight use by Jan 4 . Very interested to develop offline testing protocols using real hardware, but no insulin.
Dana Lewis
@danamlewis
Sep 14 2015 03:06
Awesome!
Did you use any of the openAPS docs? Would love more help improving the setup process
Peter Miller
@ochenmiller
Sep 14 2015 03:07
Scott, Dana, thanks for your amazing leadership here. And of course Ben.
I did use the openAPS docs, and found them clear and easy to follow.
Just digging in the openaps command set now, so may have questions or comments there
Ali Mazaheri
@amazaheri
Sep 14 2015 03:14
@jasoncalabrese I think I found the issue
Capture.PNG
This message was deleted
    "_id": {
        "$oid": "55f63ac840f41ec0e025fce4"
    },
    "enteredBy": "OpenAPS",
    "eventType": "Temp Basal",
    "glucose": "210",
    "glucoseType": "Sensor",
    "carbs": "0",
    "insulin": "0.85",
    "duration": "30",
    "units": "mg/dl",
    "created_at": "2015-09-13T20:11:02.9118400"
}
Jason Calabrese
@jasoncalabrese
Sep 14 2015 03:29
whats that issue?
Ali Mazaheri
@amazaheri
Sep 14 2015 03:31
time
created at is PST
on cgm is being shown as 1:11
Jason Calabrese
@jasoncalabrese
Sep 14 2015 03:32
you expected that to be 8:11?
Scott Leibrand
@scottleibrand
Sep 14 2015 03:33
Take a look at the way I append timezone in ns-upload.sh
(Ben's idea)
Ali Mazaheri
@amazaheri
Sep 14 2015 03:40
Yeah
Will do 😊 I hate Time related issues lol
Jason Calabrese
@jasoncalabrese
Sep 14 2015 03:53
at least with the iso format time is readable, debugging epoch format is hell
Scott Leibrand
@scottleibrand
Sep 14 2015 03:53
yeah, the worst are when the wrong timezone gets used and the epochs end up an hour off. :)
ran into that again today: upgrading from decocare (0.0.7!) to 0.0.17 fixed it
although after that I was getting things defaulting to UTC, so I disabled TZ overrides again
Scott Leibrand
@scottleibrand
Sep 14 2015 05:28
just added a bunch of test cases to capture most of the desired behavior in low glucose suspend mode: https://github.com/openaps/openaps-js/blob/test-refactor/tests/determine-basal.test.js
could definitely use some assistance in defining all the desired behaviors in the form of unit test cases. if you're interested in helping, please checkout the test-refactor branch (https://github.com/openaps/openaps-js/tree/test-refactor), do sudo npm install -g mocha and sudo npm install -g should, and then you should be able to run make from ~/openaps-js to run the unit tests.
would also be an excellent exercise for anyone who wants to make sure they really understand the logic behind the openaps reference design
Ali Mazaheri
@amazaheri
Sep 14 2015 05:42
Agreed, with all the goodness of solution this is by no mean a setup once and turn on a switch run forever kinda system, I hope we get there soon but understanding the building blocks and continuously updating the code and maintaining it is the key to run a safe and effective loop.
I think we should add a verbiage to documentation if not there already
Dana Lewis
@danamlewis
Sep 14 2015 05:47
that's on my to do list
there's a readme pr that is a first step but i wanted to consolidate & hone it some more.
Ali Mazaheri
@amazaheri
Sep 14 2015 05:48
Awesome
Dana Lewis
@danamlewis
Sep 14 2015 05:49
if you want to jump in ahead of me and add your $.02 (or anyone else) by all means :)
Ali Mazaheri
@amazaheri
Sep 14 2015 05:49
Ed has scanned through it and we should soon get some feedback :)
Dana Lewis
@danamlewis
Sep 14 2015 05:49
you mean the rpi stuff? cool
Jason Calabrese
@jasoncalabrese
Sep 14 2015 05:49
looks great @scottleibrand
Ed Raskin
@msrcgm
Sep 14 2015 05:53
Hi guys. I have read through the guide but unfortunately I think I just don't have enough background to implement without serious in person handholding.
I can't even get past the step of seeing my pi hard wired into the router.
Dana Lewis
@danamlewis
Sep 14 2015 05:54
are you mac or pc?
Ed Raskin
@msrcgm
Sep 14 2015 05:54
Mac
Ali---shut up.
Dana Lewis
@danamlewis
Sep 14 2015 06:01
@msrcgm what exact step did you get to, and where are you stuck? (aka what did you do last that was successful?)
Ed Raskin
@msrcgm
Sep 14 2015 06:04
3b (embarrassing) 😭
Which means all I did was successfully plug my pi in.
Dana Lewis
@danamlewis
Sep 14 2015 06:05
Ok. so wifi are in, or not in yet?
ok
Ed Raskin
@msrcgm
Sep 14 2015 06:05
Oh and I managed to stick the sd card in.
👍
Dana Lewis
@danamlewis
Sep 14 2015 06:05
woot :)
do you have a terminal open?
Ed Raskin
@msrcgm
Sep 14 2015 06:06
And the flux capacitor is fluxing.
Yes, terminal
open
Dana Lewis
@danamlewis
Sep 14 2015 06:06
did you do sudo bash yet?
oh wait
you haven't done raspbian yet
?
Ed Raskin
@msrcgm
Sep 14 2015 06:07
Pi hard wired into my airport (30 minutes ago) now drinking myself to sleep realizing I am not an awesome hacker
I do have raspbian because I bought a Cana kit.
Dana Lewis
@danamlewis
Sep 14 2015 06:07
ah, great
so does sound like it's time for you to start with 3b and sudo bash.
Ed Raskin
@msrcgm
Sep 14 2015 06:09
Yes for some reason I am clearly doing something wrong.
Dana Lewis
@danamlewis
Sep 14 2015 06:09
ok talk us through what you've done and/or copy and/or paste error messages or screenshots
Ed Raskin
@msrcgm
Sep 14 2015 06:11
I've shut down for the night, but I will. I am also going to try to get some FaceTime with Ali when he is available. I think that will help and I know he has a weakness for macallen 18. I'm willing to stoop to that level.
Dana Lewis
@danamlewis
Sep 14 2015 06:13
right, but the level you need to be at is to keep trying yourself :) cause that's what you'll need to do to make it through every stage, including this
so next time you get rolling, document what you're doing and show what errors you're getting, and people can give you pointers
and/or we can fix our directions to be more clear
Scott Leibrand
@scottleibrand
Sep 14 2015 06:39
in this particular case, you may need to plug in a monitor and keyboard/mouse to get started. I think with the canakit images you have to tell NOOBS to install Raspbian before you can get started on the rest.
Oliver Schumacher
@oschumac
Sep 14 2015 07:33
@scottleibrand @danamlewis @amazaheri -> loop is closed. And has worked last two nights and stable from system side. Looks alike a good weapon against diabetes monsters. Thanks for support and bringing the project that far :-)
Dana Lewis
@danamlewis
Sep 14 2015 08:07
You're # 7!!!! Woot!!! :) :)
Scott Leibrand
@scottleibrand
Sep 14 2015 08:08
Yay!
Dana Lewis
@danamlewis
Sep 14 2015 08:11
I want to bottle the feeling of how it is every time I hear someone has closed the loop or is making significant progress :)
Scott Leibrand
@scottleibrand
Sep 14 2015 08:14
Are you using openaps-js for determine-basal and/or loop.sh? Any mmhistorytools or openaps-predict?
Oliver Schumacher
@oschumac
Sep 14 2015 08:25
i use openaps-js and loop.sh. loop is rewriten by me. Cause of some some interface changes like using nightscout glucose data. Sending treatments to nightscout and some more minor changes.
Ben West
@bewest
Sep 14 2015 08:26
would you mind sharing it with me?
Oliver Schumacher
@oschumac
Sep 14 2015 08:26
apenaps-predict i am not aware of that.
Ben West
@bewest
Sep 14 2015 08:27
I've been reviewing loops to figure out how to enable openaps to handle loop maintenance as well
Oliver Schumacher
@oschumac
Sep 14 2015 08:27
I will make i branch in my fork tonight.
()
Oliver Schumacher
@oschumac
Sep 14 2015 08:32
The only thing i dislike in the moment is that carelink has a poor range. Does anyone know better solution. How far is rileylink as an example.
Dana Lewis
@danamlewis
Sep 14 2015 08:53
Rileylink is much better, but not sure anyone's got it really working yet or if it's reliable enough for looping. (Would love for it to be so, and sounds like @bewest And @amazaheri Are working on getting one live to test)
Short term solution if you haven't already is try multiple pis/carelinks (one on each side in bed for example)
Oliver Schumacher
@oschumac
Sep 14 2015 09:01
Bed is not a prob for the little bed of my son. But the system is to big to wear on daytimes. If rileylink will work i can restart my Intel Edison project. Then the System will become a wearable. Cause of Intel edison has same performance as a pi but only 10 percent of the power consumption. And a system is 3 times smaller.
Dana Lewis
@danamlewis
Sep 14 2015 09:03
Nice. Yea, that or android would be fantastic for daytime.
I have worn the Pi in a flip belt around the waist, but it kind of bugs me because I'm not used to wearing something there.
Oliver Schumacher
@oschumac
Sep 14 2015 09:13
Yes and my son already wears an insulin pump, dex transmiter, dexcom receiver, xdrip receiver and finally a full sized smartphone. He allready looks like a robokid. :-(. System has to be more integrated to become a wearable. In my edison rig is allready a wixel integrated. Which means edison can receive raw data from dextransmitter. But the carelink is not running on edison. My hope is a: rileylink or b: find a cool insulinpump with bt interface.
Dana Lewis
@danamlewis
Sep 14 2015 09:24
Oh cool for Edison and wixel!
Oliver Schumacher
@oschumac
Sep 14 2015 11:57
@danamlewis do you have a pic of the pi belt?
Lori
@LoriLori
Sep 14 2015 11:58
@timomer has build quite nice app and ported openaps-js to android
Peter Miller
@ochenmiller
Sep 14 2015 13:40
Has anyone pulled a Carelink USB apart to see if it would be possible to get directly a the UART and bypass USB?
Oliver Schumacher
@oschumac
Sep 14 2015 14:20
not yet but i would asume that it work. Maybe need an osziloscope to find the right pins.
Ali Mazaheri
@amazaheri
Sep 14 2015 14:38
@oschumac awesome news, at least you don't hate me for keeping you awake at 2am going through the setup with you that day 😊
Rachel Sandlain
@audiefile
Sep 14 2015 16:57
@oschumac this is flip belt's website (there is a product called spibelt but I don't think it would be big enough to hold everything in the belt. They make a messenger bag style pack that would probably work) https://flipbelt.com
Oliver Schumacher
@oschumac
Sep 14 2015 17:42
@audiefile Thanks, yes we use something similar to that. Some kind of sport belt. My wife made bags into Lars unterwear for the pump. But i don't see Lars an pi wearing. That os far to huge.
Oliver Schumacher
@oschumac
Sep 14 2015 17:49
@amazaheri, everything is okay. You are one of my hero's. Maybe we can chat one more time just chare exipiriences how to setup openaps for a kid. In this moment it seems to work. But it looks alike there are cases where a hypo cannot be covered. Right now i like run the setup without changes. Until next weekend.
Scott Leibrand
@scottleibrand
Sep 14 2015 18:02
I would also be very interested in whether you think any algorithm changes are needed. the other thing you should do, if you haven't already, is raise your min_bg (in Bolus Wizard Settings on the pump) to at least 110.
we have ours set to 110, with the max_bg set to 120.
Scott Leibrand
@scottleibrand
Sep 14 2015 18:10
if you have it set much lower than that, it won't start low-temping early enough for the low-temp to take effect (30-90m later) to avoid a low
Ali Mazaheri
@amazaheri
Sep 14 2015 18:23
feel free to schedule something, yeah I had one of those hypo scenario last night
I have 115 and 125
but he got more insulin than he needed due to late desert
in that case a carb correction needed
and after that smooth ride withopenAPS
I am working on a logic to send those suggestion ahead of time as part of the loop
Oliver Schumacher
@oschumac
Sep 14 2015 18:26
Yes that is the prob. Lars BG is sometimes falling much faster. Like Saturday night. He was dreaming and his BG was falling from 120 to 60 in one hour openaps was acting correctly but not enough. Right know i run 130 and 145.
Ali Mazaheri
@amazaheri
Sep 14 2015 18:28
in other way I am looking at delta and how fast is going low and sending notification before it gets to 60s even with a 0 temop
Scott Leibrand
@scottleibrand
Sep 14 2015 19:20
@oschumac If you're only having problems (on loop) with lows and not highs, you might also try a lower basal pattern and see if that helps preempt lows a bit more. OpenAPS can always raise basal to deal with any high, if you set max_iob and max_basal appropriately.
Ali Mazaheri
@amazaheri
Sep 14 2015 19:24
:+1:
Oliver Schumacher
@oschumac
Sep 14 2015 19:44
which insulin do you use ?
Whe are using Novorapid
Dana Lewis
@danamlewis
Sep 14 2015 19:45
I am on humalog
Holger Sanft
@holgi13
Sep 14 2015 19:56
I am on apidra - anyone else ?
Ali Mazaheri
@amazaheri
Sep 14 2015 20:15
Novolog
and very happy with it
switched from humolog last month
Peter Miller
@ochenmiller
Sep 14 2015 20:19
@oschumac , I notice that the "mini" breakout for Edison has USB otg, have you tried that with the USB Carelink and linux?
Oliver Schumacher
@oschumac
Sep 14 2015 20:20
There comes my big question i use the standart IOB calc. from iob.js. Any Idea to optimize it for the different insulin ? There must be differences. Wasn't Monika calculating some insulin functions in Mathlab ?
@ochenmiller , yes the USB otg i have used. But it won't detect the Carelink propperly. Cause of the old Kerne it 3.10.x should be at least 3.16 or better.
Scott Leibrand
@scottleibrand
Sep 14 2015 20:24
We're planning to make the iob stuff a bit more modular, and probably switch the default over to the iob calculations from openaps-predict, once someone pulls those out as a standalone thing. That will make it a lot easier to pull in various other iob estimation functions like the ones Monica did.
If you want to get started on that feel free. No one has done anything specific yet.
We could also pull in nightscout's iob.js: same code, but now modularized and with unit tests.
Oliver Schumacher
@oschumac
Sep 14 2015 20:28
Okay, IOB calc is new for me. I'll checked the iob.js in a excel sheet. to get a better understanding. It looks alike to have this precise would give us a very good loop.
Ali Mazaheri
@amazaheri
Sep 14 2015 20:29
Appending Z and converting time to UTC resolved the issue with OpenAPS temp visuals on CRM
Scott Leibrand
@scottleibrand
Sep 14 2015 20:29
I think we're well within the stddev already, even with the simplistic insulin activity curve behind iob.js
but wouldn't hurt to get it more accurate and more importantly more testable.
Oliver Schumacher
@oschumac
Sep 14 2015 20:32
Normaly it would be enough to have a table. For every insulin. I would say it must not be some complicated calculation in a script. A table with insulin estimation from 0 min to 180min.
Scott Leibrand
@scottleibrand
Sep 14 2015 20:48
You could also put your table in as a test case, to make sure the formula gives the correct result. Formulas are going to be more precise (no jerky jumps at 5m boundaries) and probably faster to calculate than doing a table lookup.
Ali Mazaheri
@amazaheri
Sep 14 2015 21:21
@scottleibrand @jasoncalabrese this did it openAPSTempBasal.timestamp.Value.ToUniversalTime().GetDateTimeFormats()[101]
We are back ion business with funnelcake and OpenAPS visualization (hacked version)
Jason Calabrese
@jasoncalabrese
Sep 14 2015 21:22
what's the [101] for, really that many formats?
now to figure out how to represent temp basals in NS, then how to get that from careportal and openaps
Ali Mazaheri
@amazaheri
Sep 14 2015 21:28
yes :)
Ben West
@bewest
Sep 14 2015 21:37
is that moment js code?
which will take a "basal program specification"
and turn it into nice json that you can interleave into your history with a simple sort
Ben West
@bewest
Sep 14 2015 21:43
for NS/openaps integration, etc, we should treat anything not iso8601 as a bug, it'll be a lot simpler
once you've got a nice basal history from that generation, it's easier to insert temp's appropriatelyl, so you get a sane list of basal actions as a result
Ed Raskin
@msrcgm
Sep 14 2015 22:16
So my main issue is that I cannot connect the raspberry pi that is plugged into my time capsule with cable. I cannot find the IP address, and even after I find it, I don't know the terminal commands (assuming I find it). sudo bash I realize is just allowing me to change configurations to my Macbook Air and not the raspberry pi -- can anyone help?
Dana Lewis
@danamlewis
Sep 14 2015 22:17
did you plug in with keyboard monitor mouse first?
I think even with the cana kit sd card, you still have to pick to install raspbian when you first boot up your pi
easiest way might be keyboard/monitor/mouse first before using your mac for everything else
Ed Raskin
@msrcgm
Sep 14 2015 22:20
I have no keyboard and mouse to hook into the pi
I guess I need to purchase?
Dana Lewis
@danamlewis
Sep 14 2015 22:21
ok. borrowing/finding a keyboard monitor mouse (stop by library, find a friend, etc.) or getting a console cable that allows you to hook pi to mac is probably preferrable
I know @esteward found monitor mouse etc for $5 or something at goodwill somewhere :), we go down and use the computer lab in our building when we need monitors for the Pi
Chris Hannemann
@channemann
Sep 14 2015 22:23
@danamlewis what about using pi filler and starting from scratch? Too time consuming?
Ed Raskin
@msrcgm
Sep 14 2015 22:28
Totally not worried about cost, more worried about the amount of time it took me to understand that just typing sudo bash into the command line wasn't going to affect my pi, but was going to affect my actual macbook. Ali, I need you man ...
Chris Hannemann
@channemann
Sep 14 2015 22:29
Nah, you got this
Ok, no keyboard, no monitor, no problem; there are multiple roads leading to the same destination
If you take a look at #2 in that documentation page, it has a link
It tells you a whole bunch of ways to setup your RPi; go ahead and try the one that uses Pi Filler
You will be downloading Raspbian and running a little apple script to set it up on the SD card
Here is Pi Filler; make sure you read it's documentation first
Ben West
@bewest
Sep 14 2015 22:35
there's a few ways, I didn't use keyboard/mouse either
this ensures you can get to the console, no matter what
I have one, I can bring it
Dana Lewis
@danamlewis
Sep 14 2015 22:36
@bewest yes, and there's a good guide listed in the setup guide if you have a console cable. but think @channemann 's works better short term before getting hands on a console cable
Ben West
@bewest
Sep 14 2015 22:38
yeah, pi filler looks like good tool for a blind approach
Ed Raskin
@msrcgm
Sep 14 2015 22:40
Is there an adapter for the micro-sd to make it fit into my macbook?
Chris Hannemann
@channemann
Sep 14 2015 22:40
There is; did the kit come with one?
Most microSD cards come prepackaged with an adapter
Ed Raskin
@msrcgm
Sep 14 2015 22:44
Nope -- it just came with the microsd, total bummer
Chris Hannemann
@channemann
Sep 14 2015 22:44
Bummer indeed
Ed Raskin
@msrcgm
Sep 14 2015 22:45
time to run out to the store ...
Chris Hannemann
@channemann
Sep 14 2015 22:45
Alright, no keyboard/monitor, no SD card adapter, no console cable ... yeah, might be worth a quick trip ;-)
Ben West
@bewest
Sep 14 2015 23:13
ok, updated profile for @amazaheri ;-)
Dana Lewis
@danamlewis
Sep 14 2015 23:45
nice @bewest :)