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

31st
Oct 2015
Ben West
@bewest
Oct 31 2015 00:32
he did, but I knew the hotkeys to bring one up
well, the wrong one
Scott Leibrand
@scottleibrand
Oct 31 2015 01:11
heh
Scott Leibrand
@scottleibrand
Oct 31 2015 04:46
@bewest you around?
Ben West
@bewest
Oct 31 2015 04:46
yes
Scott Leibrand
@scottleibrand
Oct 31 2015 04:46
trying to figure out how to make ns.sh deal properly with the case where none of the treatments.json output has this.enteredBy.indexOf('openaps://')
because they're all some other kind of treatment
Ben West
@bewest
Oct 31 2015 04:47
they should be ignored, is my assumption
Scott Leibrand
@scottleibrand
Oct 31 2015 04:47
ns-get treatments.json'?count=5' $* | json -c "this.enteredBy.indexOf('openaps://') === 0" | json 0
no, it's barfing
Ben West
@bewest
Oct 31 2015 04:47
hmm
Scott Leibrand
@scottleibrand
Oct 31 2015 04:47
return (this.enteredBy.indexOf('openaps://') === 0)
                       ^
TypeError: Cannot call method 'indexOf' of undefined
Ben West
@bewest
Oct 31 2015 04:47
interesting, what is it?
it's within last 5
Scott Leibrand
@scottleibrand
Oct 31 2015 04:48
there is no enteredBy in this case
they're all DIYPS treatments
so I just need a null check
Ben West
@bewest
Oct 31 2015 04:48
all of NS treatments have enteredBy
maybe
Scott Leibrand
@scottleibrand
Oct 31 2015 04:48
either way, wouldn't hurt to null check
Ben West
@bewest
Oct 31 2015 04:48
in this case it's caught an error
NS itself will error without enteredBy, that's one of the few rules for NS treatments
Scott Leibrand
@scottleibrand
Oct 31 2015 04:49
no, it doesn't crash
Ben West
@bewest
Oct 31 2015 04:49
it errors
Scott Leibrand
@scottleibrand
Oct 31 2015 04:49
and they display
Ben West
@bewest
Oct 31 2015 04:49
it says undefined
Scott Leibrand
@scottleibrand
Oct 31 2015 04:50
in the mouseover, yes
Ben West
@bewest
Oct 31 2015 04:50
and there are erros in console
Scott Leibrand
@scottleibrand
Oct 31 2015 04:50
true; had never noticed that
you're telling me I need to update DIYPS to add an enteredBy?
Ben West
@bewest
Oct 31 2015 04:51
yeah, it'd be best to do that
I mean, that's the proper fix
to guard against this error
json -c "(this.enteredBy && this.enteredBy.indexOf('openaps://') === 0)" might do it
but I strongly recommend following NS's expectation of having enteredBy, it's one of the few rules for treatments
Scott Leibrand
@scottleibrand
Oct 31 2015 04:53
adding that now
yep, this.enteredBy && fixed it
Ben West
@bewest
Oct 31 2015 04:55
:-D
Scott Leibrand
@scottleibrand
Oct 31 2015 04:55
and future boluses will have enteredBy: "DIYPS"
Ben West
@bewest
Oct 31 2015 05:41
nice :-D
pretty sure I need to lower basal in afternoon
if you see openaps stippling at half on, half off
does that suggest cutting basal by 50% or less?
like, consistently, for weeks
was pretty sure before, but even more now
Scott Leibrand
@scottleibrand
Oct 31 2015 05:44
you'll want to figure out how much net negative insulin it's giving you on an average afternoon
Ben West
@bewest
Oct 31 2015 05:45
right, if it's 50% for 3 hours
Scott Leibrand
@scottleibrand
Oct 31 2015 05:45
and adjust your basal for the hours leading up to when that usually happens. probably start with decreasing it about half as much as the net-negative
Ben West
@bewest
Oct 31 2015 05:45
let's say it does bang bang, 0% - 100%
and it does this for average on 50% duty cycle, for varying periods over weeks
would be nice to automate this with a calculator
all the data is in NS
I did a backfill of 1000 hours of pump use
Scott Leibrand
@scottleibrand
Oct 31 2015 05:46
so you're 0.9U/hr from 1:30pm on, and 1.1U/hr before that...
Ben West
@bewest
Oct 31 2015 05:47
the 1.1 is problem
I need bit more in morning before lunch-ish
and bit less after
but changing both at once is tricky
Scott Leibrand
@scottleibrand
Oct 31 2015 05:47
if you say it's 50% for 3h, that'd be about 1.4U net negative
Ben West
@bewest
Oct 31 2015 05:47
well, not exactly, I'm rounding grossly because I'm human
today's not a good example
well, actually it is
because openaps went offline and I went low
Scott Leibrand
@scottleibrand
Oct 31 2015 05:48
I'd just start the 0.9 a couple hours earlier
Ben West
@bewest
Oct 31 2015 05:48
combined with too much bolus
you mean end it a little later?
oh start it sooner
well that's thing with starting at midnight
oh, start it earlier
Scott Leibrand
@scottleibrand
Oct 31 2015 05:49
yeah, mid-morning maybe
or late morning
Ben West
@bewest
Oct 31 2015 05:49
10/11am
instead of the 1.1 stuff
Scott Leibrand
@scottleibrand
Oct 31 2015 05:49
yeah
Ben West
@bewest
Oct 31 2015 05:50
hmmmmm
I do find often in morning i need more
when I wake up at 9//10
maybe worry about that next/later
it's ok for now
Scott Leibrand
@scottleibrand
Oct 31 2015 05:50
anything you change in the 10-1pm timeframe will show effect around 12-3
Ben West
@bewest
Oct 31 2015 05:50
3 is ok
it's not on clock, it's when I rise
Scott Leibrand
@scottleibrand
Oct 31 2015 05:51
so if you need more IOB at 9-10am, that's from 7-8am basal
Ben West
@bewest
Oct 31 2015 05:51
there's always a rise when I wake, whenver that is
Scott Leibrand
@scottleibrand
Oct 31 2015 05:51
you don't usually sleep until noon though
Ben West
@bewest
Oct 31 2015 05:51
partly due to compression, partly not
when I review daily/weekly I can see when I rise based on glucose
Scott Leibrand
@scottleibrand
Oct 31 2015 05:51
so dropping to 0.9 at 10am will really only affect your afternoon
Ben West
@bewest
Oct 31 2015 05:52
there's a 45 minute correlation
so the rise I'm talking about moves depending on when I wake
Scott Leibrand
@scottleibrand
Oct 31 2015 05:52
since there's a 2 hour delay in insulin activity
Ben West
@bewest
Oct 31 2015 05:52
right, well
Scott Leibrand
@scottleibrand
Oct 31 2015 05:52
yeah, what range of wake times do you have?
Ben West
@bewest
Oct 31 2015 05:52
huge, 8am - 12pm
Scott Leibrand
@scottleibrand
Oct 31 2015 05:53
so if 12pm is the latest, your rise will be done by then even on late days
Ben West
@bewest
Oct 31 2015 05:53
hmmm
need to think through this
Scott Leibrand
@scottleibrand
Oct 31 2015 05:53
so after 10am your basal should be set based on what's happening after 12pm
just remember everything is offset 2h
so be setting your basal 2h prior to when you want the effect
Ben West
@bewest
Oct 31 2015 05:54
yeah, I try, there are lot of confounding factors
some of them will go away
Scott Leibrand
@scottleibrand
Oct 31 2015 05:54
at the very least make the 0.9U/hr start at 11am
Ben West
@bewest
Oct 31 2015 05:54
this is what dr/healthcare is supposed to be for, but we need new support system for using this device
this device has some subtle assumptions built in
and they're ok, but they mean gaming the system in different ways
I'm used to gaming the broken medtronic + meter system
Scott Leibrand
@scottleibrand
Oct 31 2015 05:55
obviously it assumes your basals are reasonable, or that you'll adjust them to be
Ben West
@bewest
Oct 31 2015 05:55
this has gotten me some bad habits
Scott Leibrand
@scottleibrand
Oct 31 2015 05:55
what other assumptions?
Ben West
@bewest
Oct 31 2015 05:55
with this machine, those habits are not necessarily useful
hmm, so this setup assumes you have good basals, are doing everything "reasonable" to maintain control, et
maybe not so hidden, but there are subtle ways they impact usage of the device itself
the way you tend to game it
in that way, it changes the relationship between me and the device... changes the rules of the game, but not the game overall
Scott Leibrand
@scottleibrand
Oct 31 2015 05:58
so I see you have a LowBattery event at 5:02pm...
Ben West
@bewest
Oct 31 2015 05:58
right, it went offline :-(
Scott Leibrand
@scottleibrand
Oct 31 2015 05:58
did that get uploaded when it happened, or only after you replaced it?
Ben West
@bewest
Oct 31 2015 05:58
btw, rayovac is no good
not sure
Scott Leibrand
@scottleibrand
Oct 31 2015 05:58
we should note that next time a battery dies
Ben West
@bewest
Oct 31 2015 05:58
can do a git grep to figure it out
Scott Leibrand
@scottleibrand
Oct 31 2015 05:58
are you doing anything special to upload those battery and reservoir events?
Ben West
@bewest
Oct 31 2015 05:58
git log --grep "foo" and similar are vary useful
nope, they get converted to Note types automatically
want to add some more logic to make them prettier
Scott Leibrand
@scottleibrand
Oct 31 2015 05:59
I wonder if we'll start to see those. have only noticed the midnight "totals" one
Ben West
@bewest
Oct 31 2015 05:59
yeah, you should start seeing all kinds of stuff now
midnight, battery, low reservoir
any wizard usage
dual's are tough still
Scott Leibrand
@scottleibrand
Oct 31 2015 06:00
we should build a low reservoir warning into nightscout
Ben West
@bewest
Oct 31 2015 06:00
and all the temps
hmmm
maybe an indicator
Scott Leibrand
@scottleibrand
Oct 31 2015 06:01
some sort of pill or badge that sits at the top after a low reservoir warning until the next prime event
Ben West
@bewest
Oct 31 2015 06:01
we can report battery/resrevoir as well
formatted as nice notes or whatever
but would be nice to have reservoir right next to battery
Scott Leibrand
@scottleibrand
Oct 31 2015 06:01
yeah
Ben West
@bewest
Oct 31 2015 06:01
I know how to make fonts, if someone can make the graphic
Scott Leibrand
@scottleibrand
Oct 31 2015 06:01
that'd require a new upload though right?
we're not uploading reservoir.json
and pumphistory only has low reservoir events; no status otherwise
Ben West
@bewest
Oct 31 2015 06:02
anything with eventType note can have a notes which gets formatted nicely
the rule I implemented is to copy any un-noticed thing into notes and add a few other fields
but it's easy to add more notes for other types
but yeah, for NS
a RAGE plugin would be required, lol
Scott Leibrand
@scottleibrand
Oct 31 2015 06:05
heh, seems we can do better than just reservoir age
at least for openaps users
and definitely for minimed connect users
since they get very frequent reservoir data uploads
Ben West
@bewest
Oct 31 2015 06:06
idea is age tells you when to change it
maybe bad name
but consistent with others
Scott Leibrand
@scottleibrand
Oct 31 2015 06:07
yeah, but age is crude: better to actually warn when reservoir is getting low
Ben West
@bewest
Oct 31 2015 06:07
yeah, it's really just reservoir
Scott Leibrand
@scottleibrand
Oct 31 2015 06:07
especially when we get nice alerts of that fact from the pump
Ben West
@bewest
Oct 31 2015 06:07
wonder if it could be future compatible with ble pens
diabeticgonewild
@diabeticgonewild
Oct 31 2015 08:58
I just wanted to let you guys know that I am in the home stretch with respect to modeling for my particular project, relative to the amount of work I have put in this year.
I have programmed in my first set of a system of differential equations for this project and now I am programming in a Markov chain Monte Carlo to work with the differential equations. This system of differential equations and this Markov chain Monte Carlo are less complex than the one that will ultimately provide the information enabling me to make a virtual copy of myself. However, I need to do this step to obtain values for something that may not converge otherwise if I don't. Plus, it's a hard thing to program so I might as well start off with something easier then do "a harder version of it", which will give me 22 sets of probability distributions for the unique parameters. This will ultimately represent me as a diabetes patient.
diabeticgonewild
@diabeticgonewild
Oct 31 2015 09:05
After I have those 22 parameters as probability distributions, I will need to program a nonlinear model predictive controller. Once that is done, I will be able to do virtual simulations for safety and verification purposes.
Once that is all verified, I will run it and interface with OpenAPS tools
Tim Howard
@tghoward
Oct 31 2015 13:12
@diabeticgonewild have you thought about machine learning techniques as your model inputs for the Monte Carlo? I've had a lot of success with random forests (boosted regression trees is another) in completely different applications. I certainly can't claim to understand what you are doing with the differential equations, and perhaps random forests won't apply here, but it can take lots of complex variables and make pretty good predictions with new input data.
diabeticgonewild
@diabeticgonewild
Oct 31 2015 14:28
No, I haven't considered ML. But I am confident about the stuff coming out from Cambridge in general with respect to research. Everything that I have read over the years has been solid. I want to follow it as well as since the work is reproducible and that is a girt.
Gift
Thank you for the suggestion @tghoward ! I will definitely consider it! 😍
Tim Howard
@tghoward
Oct 31 2015 14:42
No problem, sound good. Good luck putting it all together.
diabeticgonewild
@diabeticgonewild
Oct 31 2015 14:54
Hahahaha! No kidding! I definitely have an uphill battle ahead of me! But I am way to close to solving it and I have worked way too hard to give up on it!
diabeticgonewild
@diabeticgonewild
Oct 31 2015 15:20
I do have some housekeeping to do with respect to my work, but my repo is here: https://github.com/diabeticgonewild/Artificial-Pancreas-2015-Mathematical-Model/tree/master
Lots and lots of stuff....
I just need to wake up a little bit more...
Scott Leibrand
@scottleibrand
Oct 31 2015 17:13
so it looks like the Accu-chek Spirit Combo pump/meter can set temp basal rates on the pump over bluetooth from the meter... Has anyone looked into that? Could we RE their protocol and build ourselves a DIY "meter" to control the Spirit pump?
Jason Calabrese
@jasoncalabrese
Oct 31 2015 17:17
Think that's @timomer's goal
Scott Leibrand
@scottleibrand
Oct 31 2015 17:19
And that pump/meter combo system is available pretty much everywhere, right?
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:27
yeah, USA, EU, Israel, etc.
Scott Leibrand
@scottleibrand
Oct 31 2015 17:28
cool
that's the first BLE-controlled pump I'm aware of besides the Dana R (which isn't available here)
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:31
I would prefer the spirit combo over a Medtronic pump, if all said and done
However, if they don't get a closed-loop partner, I could totally see them getting out of the insulin pump business.
Scott Leibrand
@scottleibrand
Oct 31 2015 17:32
wonder if we could recruit anyone who has one to start reverse engineering the comms
heh, maybe we can be their "partner" :)
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:32
That would be super, super, awesome!
Scott Leibrand
@scottleibrand
Oct 31 2015 17:32
in reality we couldn't actually be a partner
but if OpenAPS worked with new Roche pumps, that would drive sales some
have they been used in any APS trials that you know of?
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:33
BTW, I intend on sharing all of my work (have been pushing updates to GitHub as I go along).
let's search "roche" AND "artificial pancreas"
yeah
Scott Leibrand
@scottleibrand
Oct 31 2015 17:34
oh, DiaS, of course
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:35
Yeah...
Scott Leibrand
@scottleibrand
Oct 31 2015 17:35
now it all comes together. so this isn't really a new discovery. :)
Peter Miller
@ochenmiller
Oct 31 2015 17:35
PWD is playing "Bert" in "Mary Poppins" Hank the Pank is about to fly with him for "Step in time" musical number. Pretty sure that's a first. Costume crew made a special belt to hold it all.
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:36
I really, really like the Hovorka team's work overall. There is very little objectionable about their modeling and their choices, especially with respect to a controller. It's really top notch research. Much better than the Dalla Man stuff, the stuff coming out of Stanford University (the controller, specifically), etc.
I don't deny that the work is very time-consuming and complicated, but it builds up well, and past research is easily used and applied for better things, so it's not like they are reinventing the wheel. And each thing they do just gets better and better.
Eric
@ecc1
Oct 31 2015 17:42
The Accu-Chek combo seems to use regular Bluetooth, not BLE. I wonder how battery life would be in an openaps system ... BTW, FCC reports are here: https://apps.fcc.gov/oetcf/eas/reports/ViewExhibitReport.cfm?mode=Exhibits&RequestTimeout=500&calledFromFrame=N&application_id=34eMw1S30PTx%2BnooRCqfRQ%3D%3D&fcc_id=VWI1239
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:47

I am concerned about any "automated" insulin delivery (in a bad way) because of my health problems. I basically have autoimmune autonomic neuropathy (that is not diabetes-related). Most of you know that, and nothing can really account for how erratic my body is. Just FYI guys, it's really severe autonomic neuropathy, and if you think some of the stuff I have shared with you is terrifying, with respect to my medical problems, there is a "ton" that I have filtered out.

I also do know not to share this kind of stuff (having "diabetes complications" but not actually having them) around kids that are affected by T1D as it would be traumatic and harmful for them. I think some of the adults with T1D and parents kind of "root for me"/"cheer me on" cause my autonomic neuropathy "was not diabetes related after all", and so it is kind of like "ammo" to you guys. Plus there is a stigma surrounding diabetes complications (nobody should deny that is true), and for it to be something else is kind of a good defense mechanism anyways.

Eric
@ecc1
Oct 31 2015 17:47
Oh, that FCC link is for the Accu-Check Insight, sorry
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:47
I think it's bluetooth 2.1
But yeah, sorry for the weird post. I was just stating my perspective on my "weird" situation....
Sometimes it's just best to get things off of your chest. But if a kid with T1D found out what I was going through....and "the diabetes horror story that I am living" (except it's not!) I would have an extremely guilty conscience...forever.
diabeticgonewild
@diabeticgonewild
Oct 31 2015 17:52
But I will drop it now. I got it off of my chest.
timomer
@timomer
Oct 31 2015 18:02
Correct, I am working on replacing the Accu-Chek combo meter with a mobile phone app, I just need to get my hands on a spare pump + meter
Matthias Granberry
@mgranberry
Oct 31 2015 18:02
@timomer you have it pairing?
timomer
@timomer
Oct 31 2015 18:02
If I get anything working, hopefully I can port it to the spirit too
diabeticgonewild
@diabeticgonewild
Oct 31 2015 18:03
That would be awesome!
timomer
@timomer
Oct 31 2015 18:03
no, I have only gotten as far as sniffing the traffic via a ubertooth
Its well over my head, so have reached out for assistance
Scott Leibrand
@scottleibrand
Oct 31 2015 18:03

@timomer what do you think of posting something like this to CGM in the Cloud?
Pay it Forward opportunity:

Does anyone here have an old Accu-Chek Combo they're no longer using? If so, and you'd be willing to donate/lend it for research, Tim Omer is working on reverse-engineering the meter to pump communications, with the intent of remotely controlling temporary basals on the pump and making it part of an #OpenAPS system. He says: "If only I can get my hands on a spare - if anyone can get me a pump and meter to loan out, I am confident I can get it hacked with the right help." So if anyone has an old pump they can lend to the cause, it would be much appreciated by all of us hoping for an #OpenAPS solution that uses a modern pump. And of course, we'd welcome help from anyone with skills to help with the hacking, as well.

timomer
@timomer
Oct 31 2015 18:04
the developer of the ubertooth has offered his assistance, whats cool
Yep I did, to a lot of groups - got a few offers but did not lead anywhere - I need to do this again as now I can advertise the HAPP app that will use it
got to go out, welcome to PM me with any questions
Scott Leibrand
@scottleibrand
Oct 31 2015 18:05
I'm thinking of posting that, if you're ok with it.
@timomer: would that be OK with you for me to post?
timomer
@timomer
Oct 31 2015 18:06
yep sure
thank you!
Scott Leibrand
@scottleibrand
Oct 31 2015 18:06
cool thx
posted. :)
timomer
@timomer
Oct 31 2015 18:07
fyi, its not much, but will be adding info here https://sites.google.com/a/n-omer.co.uk/hackabetes/home/pump-control
Matthias Granberry
@mgranberry
Oct 31 2015 18:55
That's not looking good. It'll probably take a firmware dump.
Scott Leibrand
@scottleibrand
Oct 31 2015 18:56
hmm, yeah, that might be a lot harder then.
there might be more opportunity for pairing a new "meter" though
that security analysis is on the paired session: if you can replicate pairing, you can do the same crypto from the DIY "meter"
but maybe not easily, depending on how non-standard the crypto is
Matthias Granberry
@mgranberry
Oct 31 2015 19:34
if they have some shared key it's going to be hard.
it shows that it's encrypted and message authentication is being done. I guess if the first step is to pair and exchange keys it's not hopeless.
but it's probably pointless to sniff on anything unless you do a bluetooth mitm.
Lori
@LoriLori
Oct 31 2015 21:43
Combo, Insight are not BLE just BT 2.0 :(
pump is master (scans for remote), we can see remote on andriod, can't pair it
sniffing comm between BT chip and main in Combo remote could be BT HCI but it might not
AdrianLxM
@AdrianLxM
Oct 31 2015 21:45
If they did such a good job as with the whole insight pump (they now are replacing them for combos again) they will have done a huge mistake with encryption ;)
Lori
@LoriLori
Oct 31 2015 21:46
should remote combo BT chip comm be taking role of securing everything, it would be nice to just sniff main->BT comm
understand it and mount it next to BLE chip -> BT chip extracted from combo
nobody ever went this way
nobody has spare Combo :(
@AdrianLxM any link to Insight recall ? just hear about remote being not so reliable, some people mentioned moving back to Combo
AdrianLxM
@AdrianLxM
Oct 31 2015 21:56
It is not a recall. But after not being able to produce reservoirs (they just have prefilled ones with one tye of analogue - they don't even have insulin), not being able to produce one infusion set, now they have a recall for all their steel infusion set. Aparently they can break and leave behind a steel needle. Tha
That means they just have one infusion set left and it's a plastic one. That's why they offer to switch back to the combo where there are plenty of steel infusion sets.
Lori
@LoriLori
Oct 31 2015 21:59
sounds like in The Martian book, first lunch of supplies :(