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

29th
Nov 2014
Scott Leibrand
@scottleibrand
Nov 29 2014 00:15
tried tweak ReadRTC and got:
ERROR:decocare.stick:size (0) is less than 64 and not 15, which may cause an error.
CRITICAL:decocare.stick:download_packet:Stick transmit[TransmitPacket:PowerControl:data:unknown] reader[ReadRadio:size:0] download_i[1] status[<LinkStatus:0x03:status:size=??LinkStatus:error:True:reason:[]:size(0)>] poll_size[0] poll_i[False] command[<ReadRadio:size:0>]:ERROR:bad dl raw! bytearray(b'\x01U\x00\x00\x02\x00\x00\x00\x05\x03\xfe\x00\x00\x06\x1d\x00\x00\x02\x15\x00\xac\x03\x95\x05 \x00s\x00\x00\x00\x00\x00\x00\x01\x00\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'):ACK!?
Traceback (most recent call last):
  File "./bin/mm-send-comm.py", line 8, in <module>
    app.run(None)
  File "/home/pi/decoding-carelink/decocare/helpers/cli.py", line 103, in run
    self.prelude(args)
  File "/home/pi/decoding-carelink/decocare/helpers/cli.py", line 139, in prelude
    pump.power_control( )
  File "/home/pi/decoding-carelink/decocare/session.py", line 83, in power_control
    data = self.stick.download( )
  File "/home/pi/decoding-carelink/decocare/stick.py", line 743, in download
    data = self.download_packet(size)
  File "/home/pi/decoding-carelink/decocare/stick.py", line 673, in download_packet
    ack, response = reader.respond(raw)
  File "/home/pi/decoding-carelink/decocare/stick.py", line 273, in respond
    raise BadDeviceCommError("bad dl raw! %r" % raw)
decocare.errors.BadDeviceCommError: bad dl raw! bytearray(b'\x01U\x00\x00\x02\x00\x00\x00\x05\x03\xfe\x00\x00\x06\x1d\x00\x00\x02\x15\x00\xac\x03\x95\x05 \x00s\x00\x00\x00\x00\x00\x00\x01\x00\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
Ben West
@bewest
Nov 29 2014 00:16
wow
can you edit that to put ````` around it?
er
triple tick
hmm
I think that's ok
what if i you run it again without --init?
looks like it might already be warm
not sure what's going on there
Scott Leibrand
@scottleibrand
Nov 29 2014 00:23
hmm, ran it again unchanged at it picked it up fine
Ben West
@bewest
Nov 29 2014 00:24
interesting
yeah
ok, what model is this?
Scott Leibrand
@scottleibrand
Nov 29 2014 00:24
ok, so the original problem I was troubleshooting was the "since" stuff
523
Ben West
@bewest
Nov 29 2014 00:24
if I parse that another way
there are error bytes in tehre basically
and I don't know how to handle them
so I bailed out
this makes it so you can run the thing again and the stick itself still works
call me lazy
it's possible to detect and workaround these issues...
it's a very robust stystem
I like it quite a bit, I just wish I knew more about these errors
parsed another way...
>>> s
<LinkStatus:0x03:status:size=512LinkStatus:error:True:reason:['STATUS: transmit in progress!', 'STATUS: receive overflow!', 'STATUS: OK']:size(512)>
>>> s.respond(b)
(bytearray(b'\x01U\x00'), bytearray(b'\x00\x02\x00\x00\x00\x05\x03\xfe\x00\x00\x06\x1d\x00\x00\x02\x15\x00\xac\x03\x95\x05 \x00s\x00\x00\x00\x00\x00\x00\x01\x00\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'))
>>> s
<LinkStatus:0x03:status:size=512LinkStatus:error:True:reason:['STATUS: transmit in progress!', 'STATUS: receive overflow!', 'STATUS: OK']:size(512)>
>>>
I think the device requests sleeping for a few seconds sometimes
I don't know how to do that
running python -m decocare.stick $(python -m decocare.scan) is a great way to quickly sanity test things
just checks stick diagnostics
prettier:
bytearray(b'\x01U\x00\x00\x02\x00\x00\x00\x05\x03\xfe\x00\x00\x06\x1d\x00\x00\x02\x15\x00\xac\x03\x95\x05 \x00s\x00\x00\x00\x00\x00\x00\x01\x00\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
err

>>> print lib.hexdump(b)
0000   0x01 0x55 0x00 0x00 0x02 0x00 0x00 0x00    .U......
0008   0x05 0x03 0xfe 0x00 0x00 0x06 0x1d 0x00    ........
0010   0x00 0x02 0x15 0x00 0xac 0x03 0x95 0x05    ........
0018   0x20 0x00 0x73 0x00 0x00 0x00 0x00 0x00     .s.....
0020   0x00 0x01 0x00 0x92 0x00 0x00 0x00 0x00    ........
0028   0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00    ........
0030   0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00    ........
0038   0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00    ........
>>>
Scott Leibrand
@scottleibrand
Nov 29 2014 00:28
big paste incoming... :)
This message was deleted
Ben West
@bewest
Nov 29 2014 00:29
gist
Scott Leibrand
@scottleibrand
Nov 29 2014 00:29
gah
yeah, gist
Ben West
@bewest
Nov 29 2014 00:31
loooks clean
Scott Leibrand
@scottleibrand
Nov 29 2014 00:31
look at the "since" stuff
the summary at the very end
Ben West
@bewest
Nov 29 2014 00:31
try ./myproc 2>&1 | tee my.log
oh you just copypased probably
hmm
ah
Scott Leibrand
@scottleibrand
Nov 29 2014 00:32
I am dumping the output to .json
with --parser-out
This message was deleted
Ben West
@bewest
Nov 29 2014 00:33
hmm, can't see from this how many were dumped
is this an example of that date filtering gone wrong?
hard for me to tell
Scott Leibrand
@scottleibrand
Nov 29 2014 00:33
but the key problem is:
find records since 2014-11-28T15:58:01
SINCE 2014-11-28T15:58:01
found record TempBasalDuration 2014-11-25T18:03:28
etc.
Ben West
@bewest
Nov 29 2014 00:33
since 3pm today?
and it found records two hours from now
Scott Leibrand
@scottleibrand
Nov 29 2014 00:34
that's three days ago
Ben West
@bewest
Nov 29 2014 00:34
yes
those records do not show up in the output
in the json
Scott Leibrand
@scottleibrand
Nov 29 2014 00:34
I can add the json to the gist
Ben West
@bewest
Nov 29 2014 00:34
those are the "remainders" the extras
I get pages full of data
you only want some of the records
so I filter them out
or try to ;-)
may be buggy as #$@
the since list is a quick list of everything I saw
not everything being output as results
so that can explain why the json is empty even though there are records since...
it's definitely not empty
just all old, prior to the date you're supposedly filtering for
Ben West
@bewest
Nov 29 2014 00:36
lol
oh
it's all prior?
Scott Leibrand
@scottleibrand
Nov 29 2014 00:36
yeah, many days prior
Ben West
@bewest
Nov 29 2014 00:36
right
Scott Leibrand
@scottleibrand
Nov 29 2014 00:36
through 11-26
Ben West
@bewest
Nov 29 2014 00:38
I see it
updated
pushed
wip/export/mongoable-date
Scott Leibrand
@scottleibrand
Nov 29 2014 00:39
thx
now the output .json is empty
Ben West
@bewest
Nov 29 2014 00:41
for last 30 minutes?
might be expected
Scott Leibrand
@scottleibrand
Nov 29 2014 00:41
yeah, lemme make sure there was data
Ben West
@bewest
Nov 29 2014 00:41
give it 60 minutes instead
Scott Leibrand
@scottleibrand
Nov 29 2014 00:41
there is data, but ok
Ben West
@bewest
Nov 29 2014 00:41
oh
hmmm
hmmm
Scott Leibrand
@scottleibrand
Nov 29 2014 00:43
SINCE 2014-11-28T15:42:34
  * found record TempBasalDuration 2014-11-25T18:03:28
  * should quit True False
  * found record BasalProfileStart 2014-11-25T18:03:28
  * should quit True True
  * found record TempBasal 2014-11-25T23:08:09
  * should quit True True
  * found record TempBasalDuration 2014-11-25T23:08:09
  * should quit True True
  * found record BasalProfileStart 2014-11-25T23:38:09
  * should quit True True
  * found record BasalProfileStart 2014-11-26T00:00:00
  * should quit True True
```json
something's still not right
Ben West
@bewest
Nov 29 2014 00:43
nope
that's right
those are all older
this matches the behavior I just described
the list there shows the data observed, not the data being output
Scott Leibrand
@scottleibrand
Nov 29 2014 00:43
why does it not show the more recent ones than BasalProfileStart 2014-11-26T00:00:00 ?
Ben West
@bewest
Nov 29 2014 00:44
you wanted since 33pm on the 28th
that's older
that's 26th
Scott Leibrand
@scottleibrand
Nov 29 2014 00:44
there are lots more since that one that should also be filtered
Ben West
@bewest
Nov 29 2014 00:44
because it only looks at one page at a time
looking for items since
so this only needs to look at the first page
so that's basically what's on the first page
Scott Leibrand
@scottleibrand
Nov 29 2014 00:44
so are our latest items not on the first page?
Ben West
@bewest
Nov 29 2014 00:44
?
Scott Leibrand
@scottleibrand
Nov 29 2014 00:45
I can re-paste the latest output if it'd be helpful
is there an easy command-line gist generator?
Ben West
@bewest
Nov 29 2014 00:45
my suggestion is to use ReadHistoryData --page 0, --page 1, etc a few times
along with list_history to get an idea of what is on each page
Scott Leibrand
@scottleibrand
Nov 29 2014 00:45
can I screen-share you into this pi somehow?
Ben West
@bewest
Nov 29 2014 00:46
hmm, you can probably let me ssh in somehow
Scott Leibrand
@scottleibrand
Nov 29 2014 00:46
it's behind a NAT
Ben West
@bewest
Nov 29 2014 00:46
if you port forward some external ip/port into the thing
hmm, stiil possible to bounce around
Scott Leibrand
@scottleibrand
Nov 29 2014 00:46
lemme see how easy that is with this airport
Ben West
@bewest
Nov 29 2014 00:46
I can let you ssh with magic params into one of my servers
that might work
Scott Leibrand
@scottleibrand
Nov 29 2014 00:47
reverse tunnel?
Ben West
@bewest
Nov 29 2014 00:47
yeah
for right now
I recommend unplugging/replugging the stick
python -m decocare.stick $(python -m decocare.scan)
Scott Leibrand
@scottleibrand
Nov 29 2014 00:48
I can't remember my airport's password, so let's try rtunnel
Ben West
@bewest
Nov 29 2014 00:48
that gets you a nice clean session
those counters should be increasing without any wonky behavior
if you get negative numbers or numbers switching in wierd ways, time to unplug/replug
Scott Leibrand
@scottleibrand
Nov 29 2014 00:49
all clean
Ben West
@bewest
Nov 29 2014 00:50
ok, so if you ask for mm-latest.py 60, it should grab data for last hour
someting about that power on --init is not right
Scott Leibrand
@scottleibrand
Nov 29 2014 00:51
is it better to --init on some other command before mm-latest.py?
Ben West
@bewest
Nov 29 2014 00:51
I think they should all share the same code
oh, use error on my end maybe
yeah
I didn't set it
ha
serial
my favorite way ot init things
is mm-send-comm.py --init sleep 0
moving it a bit closer seems to help
I don't have any records for last hour
so I can keep increasing...
Scott Leibrand
@scottleibrand
Nov 29 2014 00:54
anyway, let's ssh -R
you have a server you can create me an account on?
Ben West
@bewest
Nov 29 2014 00:55
but if I increase to 1000 I get records
if I shorten to 500 I get no records
if I increase to 750 I get some records
Scott Leibrand
@scottleibrand
Nov 29 2014 00:56
or should I make you an account on mine?
Ben West
@bewest
Nov 29 2014 00:57
hold on sec
ok ssh ... bewest@bewest.io
I installed your key from github
Scott Leibrand
@scottleibrand
Nov 29 2014 00:58
cool
I'm in
Ben West
@bewest
Nov 29 2014 00:59
so hmmm if you do -R :3535:RPIIP:23 bewest@bewest.io
where RPIIP is your locally natted rpi ip
Scott Leibrand
@scottleibrand
Nov 29 2014 01:00
did that with 2929 and 22
Ben West
@bewest
Nov 29 2014 01:00
nice
ok
in that ase
Scott Leibrand
@scottleibrand
Nov 29 2014 01:00
screen, or ?
Ben West
@bewest
Nov 29 2014 01:00
do
screen -x soctt
heh
Scott Leibrand
@scottleibrand
Nov 29 2014 01:01
one sec
Ben West
@bewest
Nov 29 2014 01:01
or
Scott Leibrand
@scottleibrand
Nov 29 2014 01:01
oh, add a key?
Ben West
@bewest
Nov 29 2014 01:02
it's harder here, but
oh ok
run uh
run
hehe
ssh to bewest.io
run forward-env -S scott
Scott Leibrand
@scottleibrand
Nov 29 2014 01:02
go ahead
Ben West
@bewest
Nov 29 2014 01:02
that will push your keys into our screen
oh
Scott Leibrand
@scottleibrand
Nov 29 2014 01:03
you can drive until we get to my pi
Ben West
@bewest
Nov 29 2014 01:03
you have to do those steps
in a new terminal
ssh to bewest.io
and run that command
if you have an ssh keychain to the pi
it will forward it through to our env
Scott Leibrand
@scottleibrand
Nov 29 2014 01:03
ah, I was just gonna add your key to my authorized_keys
Ben West
@bewest
Nov 29 2014 01:04
oh ok
yeah
do that
Scott Leibrand
@scottleibrand
Nov 29 2014 01:04
which key?
Ben West
@bewest
Nov 29 2014 01:05
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXALUJm1rP/BVpoVulvPlMhveuBZsQzDdeetm7j1AdDNSD1w1nJ6d7UJvoXsHsyqAMglOMmmVcEQoec1JMy4u986xCJmHxW9vVNCPMJzShjODrPOUkfkhpkqRRuPf6QJVol0D01p93GR7IK4zpGGcErfUms+KUQTKfNchlX9lvwINj05lJjfc8DjJ1A6dtsBw2tWKMKATB/duKscmf8FacsUcDInpyKL+k4xG/nQfRHhBwQ9N3K31pvZ1UdaaCAYJGhsUd5V8kVo8tx5I74j0PplqTTm/tTZWiuKs7m9LVRgiAekx3O2l1BDwhQ34lsLiFD7g0Ll4kGCxwNpX/FiGh bewest@patient
I <3 ssh
log in again
Scott Leibrand
@scottleibrand
Nov 29 2014 01:08
should that be -60 or just 60?
what did that do?
not much yet, apparently. :)
Ben West
@bewest
Nov 29 2014 01:12
wf
oh there we go
tab completion
:-)
now you have tab complete
Scott Leibrand
@scottleibrand
Nov 29 2014 01:13
yay. persistent?
Ben West
@bewest
Nov 29 2014 01:13
you need to . /etc/bash_completion in your .bashrc
but yeah
ok this turns on Radio
boom
grabbing data
no data in last 60 minutes?
but looks like some in...
Scott Leibrand
@scottleibrand
Nov 29 2014 01:15
should be lots
Ben West
@bewest
Nov 29 2014 01:15
days
so lets make it 1000
Scott Leibrand
@scottleibrand
Nov 29 2014 01:15
she's been bolusing for dinner
Ben West
@bewest
Nov 29 2014 01:15
hmmm
Scott Leibrand
@scottleibrand
Nov 29 2014 01:20
I'm already tracking that branch
Ben West
@bewest
Nov 29 2014 01:20
:)
just triple checking
this works for me
uhhhh
lol
here we go
boom
sorry buddy
Scott Leibrand
@scottleibrand
Nov 29 2014 01:23
heh, so what'd you find?
missing a larger?
or ?
Ben West
@bewest
Nov 29 2014 01:23
yes
I was ignoring model altogether
so you were getting the smalle rparsing
no recorsd
Scott Leibrand
@scottleibrand
Nov 29 2014 01:23
ah
Ben West
@bewest
Nov 29 2014 01:23
no relible ones anywya
pushed
Scott Leibrand
@scottleibrand
Nov 29 2014 01:24
(that's @kenstack's modified version, deleting to fix tab-complete) :)
Ben West
@bewest
Nov 29 2014 01:26
there we go
crossing fingers
yup
or is it gone
haha did pump ago away?
Scott Leibrand
@scottleibrand
Nov 29 2014 01:28
no...
Ben West
@bewest
Nov 29 2014 01:29
it's ok
ok here we go
hmmmmmmm
no it's ok
it's ok
:-)
hmmm
hmmmmmmmmm
bah
bad radio, badddddd radio
!!!!!!
it works
Scott Leibrand
@scottleibrand
Nov 29 2014 01:31
yay
Ben West
@bewest
Nov 29 2014 01:31
wheeee
what I did is use the stick flush thingy
Scott Leibrand
@scottleibrand
Nov 29 2014 01:32
anything else we need to check?
Ben West
@bewest
Nov 29 2014 01:32
that stick diagnostic is really good at clearing things out
Scott Leibrand
@scottleibrand
Nov 29 2014 01:32
gotta go
bbiab
Ben West
@bewest
Nov 29 2014 01:33
ah
almost got you set up with udev
Scott Leibrand
@scottleibrand
Nov 29 2014 01:33
sorry, back
washing machine flooded, but only a small amount of water
Ben West
@bewest
Nov 29 2014 01:33
lol
Scott Leibrand
@scottleibrand
Nov 29 2014 01:34
thought it was a lot more
Ben West
@bewest
Nov 29 2014 01:34
which washing machine?
dish or clothes
Scott Leibrand
@scottleibrand
Nov 29 2014 01:34
mine
that's a dishwasher. washing machine = clothes.
anyway, udev what?
Ben West
@bewest
Nov 29 2014 01:34
my connection seems to have hung
oh there we go
j
Scott Leibrand
@scottleibrand
Nov 29 2014 01:35
what does that do?
Ben West
@bewest
Nov 29 2014 01:35
ok wattch this
ok
unplug usb
stick
and plug it in again
watch what happens
Scott Leibrand
@scottleibrand
Nov 29 2014 01:36
one sec, it's downstairs
Ben West
@bewest
Nov 29 2014 01:36
oh
well, it makes it so you don't have to ./insert.sh anymore
boom
that happened automatically
Scott Leibrand
@scottleibrand
Nov 29 2014 01:36
cool
Ben West
@bewest
Nov 29 2014 01:37
means we can use it right away
no muckery/tom-foolery needed
Scott Leibrand
@scottleibrand
Nov 29 2014 01:38
no more minutely insert.sh cron. :)
Ben West
@bewest
Nov 29 2014 01:38
nope
done with that
this just works
ok
so
Scott Leibrand
@scottleibrand
Nov 29 2014 01:39
I need to leave in 15m: anything else we should do/check?
Ben West
@bewest
Nov 29 2014 01:39
this looks good
Scott Leibrand
@scottleibrand
Nov 29 2014 01:40
is there a better way to do locking?
Ben West
@bewest
Nov 29 2014 01:40
cool
looks like I messed with something
Scott Leibrand
@scottleibrand
Nov 29 2014 01:41
I made them symlinks before
I can do that again, unless there's a better way
Ben West
@bewest
Nov 29 2014 01:41
the command I just ran is supposed to do it nicely
kenstack
@kenstack
Nov 29 2014 01:43
Hey guys just joining - I just run insert.sh in my bashrc when I boot the pi and mod the permissions - has
been solid
Ben West
@bewest
Nov 29 2014 01:43
udev is better
Scott Leibrand
@scottleibrand
Nov 29 2014 01:43
if you want to be able to plug the pi in and just go
Ben West
@bewest
Nov 29 2014 01:43
yeah, udev does that
Scott Leibrand
@scottleibrand
Nov 29 2014 01:43
I was doing a cron hack so it'd work without having to log in, but udev does it at boot
kenstack
@kenstack
Nov 29 2014 01:44
Will check that out for sure - haven't had issues
Ben West
@bewest
Nov 29 2014 01:44
you notice there's a chance to run custom script even
Scott Leibrand
@scottleibrand
Nov 29 2014 01:44
you're probably also not trying to make your rig mobile. :)
if it stays plugged in, nbd
if you're constantly unplugging the battery to charge it...
:)
kenstack
@kenstack
Nov 29 2014 01:44
Ahh to avoid login yes that makes sense
Ben West
@bewest
Nov 29 2014 01:44
udev just does makes it work when its plugged in
and also can clean up on unplug
kenstack
@kenstack
Nov 29 2014 01:45
Yes got it cool
Ben West
@bewest
Nov 29 2014 01:46
no
remove all those symlinks
Scott Leibrand
@scottleibrand
Nov 29 2014 01:46
heh k
Ben West
@bewest
Nov 29 2014 01:51
shrug
ok
Scott Leibrand
@scottleibrand
Nov 29 2014 01:51
heh, you kept doing decocare instead of decoding-carelink, so I symlinked it for you. :)
Ben West
@bewest
Nov 29 2014 01:53
ok, should work?
Scott Leibrand
@scottleibrand
Nov 29 2014 01:53
looks good so far...
Ben West
@bewest
Nov 29 2014 01:53
hehe
Scott Leibrand
@scottleibrand
Nov 29 2014 01:53
yay
ok, I need to head out
thx for the help
Ben West
@bewest
Nov 29 2014 01:55
yeah
seeya :-)
kenstack
@kenstack
Nov 29 2014 01:55
Ben would it be ok to add gusravo
Ben West
@bewest
Nov 29 2014 01:55
yeah
'course
kenstack
@kenstack
Nov 29 2014 01:55
Gustavo
Ben West
@bewest
Nov 29 2014 01:55
bustavo
kenstack
@kenstack
Nov 29 2014 01:55
Awesome he and I are going to work on threshold suspend etc
Ben West
@bewest
Nov 29 2014 01:55
good
kenstack
@kenstack
Nov 29 2014 01:55
Cool thank you
Scott Leibrand
@scottleibrand
Nov 29 2014 01:56
thx again. I logged out all the ssh stuff. l8rs
Ben West
@bewest
Nov 29 2014 01:56
keys deleted
<3 ssh
Scott Leibrand
@scottleibrand
Nov 29 2014 01:56
yeah. :)
kenstack
@kenstack
Nov 29 2014 01:57
Quick non - sw question - im going to chat with some lawyers next week on the FDA stuff to get more background ok the line between a device and just research / algorithms etc - any suggested background reading for me ? Case histories etc ?
Again im all for working with the FDA - just want to understand the lines
Ben West
@bewest
Nov 29 2014 01:58
hmmm
I would focus more on liability
not FDA
liability and insurance
honestly, wrt FDA, they are open... I'll bring you along next time if you want
we should start new activity just for this stuff
kenstack
@kenstack
Nov 29 2014 02:00
Would be great thanks !
Ben West
@bewest
Nov 29 2014 02:00
with the lawyers, bigger thing is going to be insurance and liability
would be good to get their advice on that
kenstack
@kenstack
Nov 29 2014 02:01
yes on the list for sure. The warranty and license is important there - but will confirm for sure - I have little
knowledge of the lines on medical devices and what is distribution etc
Will let you know what I find - im looking for a lawyer with fda device experience
Ben West
@bewest
Nov 29 2014 02:02
posting on github counts as distribution
the FDA told us that
no one has this kind of experience, I think
our open source tactics turn some things on it's head
kenstack
@kenstack
Nov 29 2014 02:04
yeah that's what I'd like to understand - there are always grey areas - and the definition of a complete app ie device versus instructions
Dana Lewis
@danamlewis
Nov 29 2014 02:05
Fyi the MIT guys are talking to a lawyer friend next week
He might be one who has most experience in this area and can be a resource. Waiting for the MIT guys to respond
kenstack
@kenstack
Nov 29 2014 02:05
I actually have a meeting with Gomez on the 9th
Ben West
@bewest
Nov 29 2014 02:05
yeah, would be good
kenstack
@kenstack
Nov 29 2014 02:06
I'm happy to throw a few $ at this if need be - Id really like to do this - for my kid and everyone
Ben West
@bewest
Nov 29 2014 02:07
:-)
Dana Lewis
@danamlewis
Nov 29 2014 02:07
Is Gomez your legal contact or someone else? Awesome :)
kenstack
@kenstack
Nov 29 2014 02:07
No Gomez is the guy who runs the mit hacking health care group
Dana Lewis
@danamlewis
Nov 29 2014 02:10
Oh cool. Different than the MIT profs
kenstack
@kenstack
Nov 29 2014 02:11
I met him when he and costik spoke at a jack conference here in Ann Arbor
Ben West
@bewest
Nov 29 2014 02:13
the fda told us if we were to do bolus, that their attitude would change
Dana Lewis
@danamlewis
Nov 29 2014 02:14
I think the care portal app with step stages is perfect for that convo. Stage 1 data entry stage 2 bolus stuff. Stage 1 get it done while stage 2 changes convo
Ben West
@bewest
Nov 29 2014 02:15
yeah, hopefully
we are stretching a lot of their limits all at once :-)
kenstack
@kenstack
Nov 29 2014 02:15
It's why I left bolus off the sw
This is why Id like to get some advice - there is a line between making it too easy (distribution) and research etx that Id like clarification on - then again we may be the first to get in this fuzzy area - though I think Gomez is all over it. Then again most of his stuff is used outside the USA
Dana Lewis
@danamlewis
Nov 29 2014 02:17
That's why having it as separate from NS is good, Ben
They say this is what they want :) for us to talk!
Ben West
@bewest
Nov 29 2014 02:18
yup
I mean FDA does too
I have no problem bringing this to FDA.... this is what was supposed to happen
I provide the linking/data transport
kenstack
@kenstack
Nov 29 2014 02:18
Example - the same software could be considered educational if it's teaching people abojt the effects of high gi foods on bg over 5 hours versus explicitly being a bolus calculator
Ben West
@bewest
Nov 29 2014 02:18
that's it's own thing
then other apps provide bolus, etc...
has to be done in open because a bolus wizard that works on 20 people is not good enough for everyone
Dana Lewis
@danamlewis
Nov 29 2014 02:19
Ken, agreed that is a big component of NS, visualization. That's DIYPS-lite essentially
Ben West
@bewest
Nov 29 2014 02:19
yeah, the parameters should all be visualized
so I can say "I don't believe that"
"I'm tweaking it"
Dana Lewis
@danamlewis
Nov 29 2014 02:20
Tempted to do a write up on this and have people sign u
kenstack
@kenstack
Nov 29 2014 02:20
yes
Dana Lewis
@danamlewis
Nov 29 2014 02:20
P to help w various Fda convos
Like the stage1-2 care portal app
kenstack
@kenstack
Nov 29 2014 02:22
I assume the FDA wants to discuss by project and not clarify areas of work (stages) or am I wrojg ?
Ben West
@bewest
Nov 29 2014 02:22
mmmm, so with nightscout I've been doing both
they historically do things faster on a per project basis
they are interacting with us quickly
and we don't care about time line for "approval"
just enough of a relationship to not get shut down
kenstack
@kenstack
Nov 29 2014 02:23
That's good re quickly
Ben West
@bewest
Nov 29 2014 02:23
yeah
so
we dont care about the same things vendors do
kenstack
@kenstack
Nov 29 2014 02:23
Yes that's the key not shut down :)
Ben West
@bewest
Nov 29 2014 02:24
so we are willing to give them things that vendors usually balk at
kenstack
@kenstack
Nov 29 2014 02:24
Exactly right - we and vendors are 100 percent differnt on goals
Ben West
@bewest
Nov 29 2014 02:24
like data on failures, etc
kenstack
@kenstack
Nov 29 2014 02:24
Yep
Ben West
@bewest
Nov 29 2014 02:24
we make that part of our devel process...
so that changes our conversation with them
because they care more about process than result
result is 100% always going to be wrong for someone at some time
process helps hedge against it
so in terms of interacting with them
they just want to know more about what's going on
they are interested both in our process as a way to get things done faster and to verify things
and the results
they are limited in what they can volunteer/opine/say
kenstack
@kenstack
Nov 29 2014 02:26
Yes that's right. The key will be to create some sort of discussion around our process With open source And their question around responsibility - it's a fair question
Ben West
@bewest
Nov 29 2014 02:26
exactly
so our special risks are things like
do we depend on individuals that might lose a job/time to work and disappear
kenstack
@kenstack
Nov 29 2014 02:26
I don't have a perfect answer in my head yet - will talk to Gomez and get his take
Ben West
@bewest
Nov 29 2014 02:26
and things like
are we sure that we can detect/find people that have problems
kenstack
@kenstack
Nov 29 2014 02:27
Mits lawyers must have gone thru this
Ben West
@bewest
Nov 29 2014 02:27
or if we find a problem, can we notify people who might be affected?
so it's the whole lifecycle of software
not just install, but maintenance, support
they don't care what it looks like so long as all the bases are covered
yeah, we are on the hook for documenting this for them in our next interaction
they want it in december
I told them maybe jan
heh
but we are on the hook for it
kenstack
@kenstack
Nov 29 2014 02:28
im thinking - and don't kill me :) - you may need an org to really do this - even if it's volunteer
Ben West
@bewest
Nov 29 2014 02:28
yeah, we have Nightscout Foundation now
I've been considering doing a for-profit llc myselef
but still a little too much work than I'm ready to take on Ithink :_(
kenstack
@kenstack
Nov 29 2014 02:28
That's a good discussion ben
Ben West
@bewest
Nov 29 2014 02:28
the non-profit org is good for now
kenstack
@kenstack
Nov 29 2014 02:29
Have you spoken to costik ?
Ben West
@bewest
Nov 29 2014 02:29
yeah, a bit
my experience is that my goals on this have changed over time
originally I wanted to be "put out of business"
to just do a little bit and show them (big vendors) how to do it and go back to my life
but now, I've done a substantial amount of work
kenstack
@kenstack
Nov 29 2014 02:30
Let me talk to the lawyers next week and I'll add this to the list - im less interested in for or not for profit - whatever works im not looking to make $ - but we may need something to really do this safely for everyone
Ben West
@bewest
Nov 29 2014 02:30
enough that I want to continue delving into it and making great stuff for a long time
kenstack
@kenstack
Nov 29 2014 02:30
Users and developers :)
Ben West
@bewest
Nov 29 2014 02:31
yeah, I've been really pushgin the open source philosphy... users are co-developers, etc...
it acts as high-pass filter, it really does self-select for people and keep people that aren't ready out
kenstack
@kenstack
Nov 29 2014 02:31
That's cool ben - would be great for the big boys to take the lead and I can just buy a solution - don't see it though
Ben West
@bewest
Nov 29 2014 02:31
yeah, over time I don't see it
someone has to completely disrupt
dis-intermediate
all those fancy things
kenstack
@kenstack
Nov 29 2014 02:32
Yes - it does re self select - but - just said this to costik - it doesn't scale though - we can help techies and other high end users - can't help the masses though
Ben West
@bewest
Nov 29 2014 02:32
oh yeah, that's what a premium service is for
kenstack
@kenstack
Nov 29 2014 02:32
Yes - exactly
Ben West
@bewest
Nov 29 2014 02:32
bundle all the stuff as premium good/service... was exactly what we did at meraki
I have bulk data plans so I can manage the cell data network
with mqtt/protobuf, plans cost $1.50 / month
kenstack
@kenstack
Nov 29 2014 02:33
Hell Id buy it all from you if you were selling it :)
Cool
Ben West
@bewest
Nov 29 2014 02:33
yeah... I've done ~10... going slow
just... wary of a lot of things
kenstack
@kenstack
Nov 29 2014 02:35
You should be - gotta tell you - I used to sit on a lot of foundation boards etx - I dropped all of them - usually became self focused orgs who forgot what the point was - not saying this about nightscout i have no idea don't know it at all - but go slow - also - this ks FDA - it adds a huge wrinkle
but - I haven't seen a more worthy cause in a very long time
Also I'm not sure we will disrupt - they may get there in time (the vendors) -
id like to have a simple solution sooner vs later
Ben West
@bewest
Nov 29 2014 02:51
yeah... star was is in the future, but all the technology they are surrounded with is old, broken, dirty
so build new mouse trap vs improve existing one?
lot of vendors keep having the hubris to think they can convert the world to their system
but it's the most viral system that will stick
means combination of new "mouse traps" plus making old ones better
FDA is interesting.... I'm fairly sure an open source process is something they would like... they aren't in the job of prescribing what that is, but at least amenable to discussing what it might be
kenstack
@kenstack
Nov 29 2014 03:01
It'sgreat - if they weren't so open they'd shut down nightscout and all this
Vendors are scared too - I get it - they want to take lowest risk to market like the stupid threshold suspend in the medtronic - it's brainless - but they needed something they could market as closed loop and would pass quickly
Ben West
@bewest
Nov 29 2014 03:03
yeah, it's just the disconnect between the marketing and what they've done that drives people crazy
and then they blame FDA, which isn't really fair
kenstack
@kenstack
Nov 29 2014 03:05
Yeah - I get people's frustration but it's complicsted - everyone has differnt goals - users vendors and fda
Ben West
@bewest
Nov 29 2014 03:06
yeah
and each has a constellation of rights that don't always perfectly align
kenstack
@kenstack
Nov 29 2014 03:06
The marketing is ridiculous though - but I get it - they need to establish themselves as the leader
Exactly re rights
Ben West
@bewest
Nov 29 2014 03:07
they could be a little more modest I think... an awful lot of the customers are going to know better
http://boingboing.net/2012/08/23/civilwar.html this guy has an interesting framing of the argument, he calls it rights of owners vs operators, among other things
touches on medical devices... I don't think he was aware of our situation
but his points on legs are interesting... anyone who needs a set of legs is going to buy a set of legs instead of a house if they have to
kenstack
@kenstack
Nov 29 2014 03:10
:) good point :) will read - Prob is insurance may not pay ;)
Ben West
@bewest
Nov 29 2014 03:10
right, so you'll finance it
and be in debt rest of life
and what happens when you miss a payment
the vendor may decide where you can go and how fast instead of you
kenstack
@kenstack
Nov 29 2014 03:17
It's a huge issue - this is why I like doing the sw for this - can just give it away or worst case a nominal fee to cover premium
Ben West
@bewest
Nov 29 2014 03:18
yeah, or do it kind of like wordpress/asterisk, DIY is free, hosted-bundle is premium
the premium has several true premium options for support, and subsidizes the DIY
kenstack
@kenstack
Nov 29 2014 03:20
Yep
If we can avoid the whole
insurance thing for people it's huge
Ben West
@bewest
Nov 29 2014 03:45
I mean liability insurance for me
FDA claims having approval doesn't offer any protections
Ben West
@bewest
Nov 29 2014 04:25
ah
BasalProfileStart?
oh
Scott Leibrand
@scottleibrand
Nov 29 2014 04:30
sweet, we just sent temp basal commands to dana's pump!
Ben West
@bewest
Nov 29 2014 04:30
haha
that's awesome
Scott Leibrand
@scottleibrand
Nov 29 2014 04:30
went into utilities, connect to devices, pc connection to put it into listen mode
Dana Lewis
@danamlewis
Nov 29 2014 04:30
:D
Ben West
@bewest
Nov 29 2014 04:30
interesting
and then it does it?
wow
wow
Dana Lewis
@danamlewis
Nov 29 2014 04:31
Yup! 522
Sorry 523
Ben West
@bewest
Nov 29 2014 04:31
interesting
so
Scott Leibrand
@scottleibrand
Nov 29 2014 04:31
waiting now to see how long it stays in that mode
Dana Lewis
@danamlewis
Nov 29 2014 04:31
But only stays in listening mode for maybe 1-2min? On screen at least
Scott Leibrand
@scottleibrand
Nov 29 2014 04:31
looks like it's only a minute or so. :(
Ben West
@bewest
Nov 29 2014 04:31
there's some menus for keypad I think too
Dana Lewis
@danamlewis
Nov 29 2014 04:31
Testing to see if we can still command when screen goes away
Ben West
@bewest
Nov 29 2014 04:31
wonder what happens if we stick the stick's serial number as a keypad on the pump
hrmmm
there's a command to turn that on
Dana Lewis
@danamlewis
Nov 29 2014 04:32
Nah didn't work after it timed out
Ben West
@bewest
Nov 29 2014 04:32
does that screen come on when carelink does stuff?
Dana Lewis
@danamlewis
Nov 29 2014 04:32
No, not after it timed out
Ben West
@bewest
Nov 29 2014 04:33
but when carelink from MM runs, does the screen come up?
there's a command to put it into that listen mode, fairly sure
Dana Lewis
@danamlewis
Nov 29 2014 04:35
Nope. Fidgeting with other menu setting options to see if there's something we can do to change that, otherwise yea having a command to run it to listen mode to push any actions from DIYPS will be necessary
Scott Leibrand
@scottleibrand
Nov 29 2014 04:35
just tried putting the stick ID into the "other devices" section
Ben West
@bewest
Nov 29 2014 04:35
o_O
interesting
are there 3 different menus with serial numbers?
"other devices", "meter"
is "keypad" one, I wonder
Scott Leibrand
@scottleibrand
Nov 29 2014 04:38
no, but "remote" is an option
remote IDs are apparently numeric
Ben West
@bewest
Nov 29 2014 04:38
hrm
Scott Leibrand
@scottleibrand
Nov 29 2014 04:38
other devices are hexadecimal
Ben West
@bewest
Nov 29 2014 04:38
interesting
Scott Leibrand
@scottleibrand
Nov 29 2014 04:39
the code I see on the stick is one digit too long for "other devices" though
I wonder if I should truncate the first or last digit and try that
Ben West
@bewest
Nov 29 2014 04:40
almost anything is worth a try
so 523 has to be massaged into listening mode first
how long is that good for?
Scott Leibrand
@scottleibrand
Nov 29 2014 04:40
like 2 minutes
Ben West
@bewest
Nov 29 2014 04:40
none of the carelink software does this?
like when you use the normal mm software
Scott Leibrand
@scottleibrand
Nov 29 2014 04:41
dunno. it seems to imply it's for using a PC to change settings
Ben West
@bewest
Nov 29 2014 04:41
yeah, that would be main use
Scott Leibrand
@scottleibrand
Nov 29 2014 04:41
maybe for a doctor setting basal profiles or something.
oh, I see "saving and restoring" settings
Ben West
@bewest
Nov 29 2014 04:43
yes
I have a decompiled version of paradigm pro
with everything needed to implement storing settings
bunch of commands already for retrieving settings
I have not implemented them
want to be sure everything I've got now is good
Scott Leibrand
@scottleibrand
Nov 29 2014 04:53
any idea what happened with the TypeError: describe_rate() takes exactly 3 arguments (2 given) thing?
kenstack
@kenstack
Nov 29 2014 05:18
I can query the 723 no problem it's the temp basal commands that require the listen mode
the remote - does it allow temp basal or just easy bolus ?
Scott Leibrand
@scottleibrand
Nov 29 2014 05:19
afaik just bolus and suspend
kenstack
@kenstack
Nov 29 2014 05:20
There used to be sw on the pro version to set pump settings from pc
Dana Lewis
@danamlewis
Nov 29 2014 05:24
Remote only bolus and suspends. It is stupid.
There was a bolus, an act (to confirm) and suspend button
Heard a rumor of a future gen remote but nothing concrete or any details
Scott Leibrand
@scottleibrand
Nov 29 2014 05:27
I think our best bet is going to be getting some remotes etc. and see how they talk to the pump, and then auth ourselves the same way the remote is, and see what we can do
kenstack
@kenstack
Nov 29 2014 05:27
Yep ordering monday
Dana Lewis
@danamlewis
Nov 29 2014 05:28
Also Medtronic research device might teach us something
Almost ready to submit, maybe by Monday.
kenstack
@kenstack
Nov 29 2014 05:31
What is that ?
Dana Lewis
@danamlewis
Nov 29 2014 05:34
They have a device they give to researchers for APS, that does what we are trying to hack. We are submitting a research proposal to hopefully get one to use.
It's a Bluetooth thing that interfaces between pump and computer
Scott Leibrand
@scottleibrand
Nov 29 2014 05:35
@bewest: bewest/decoding-carelink#51
kenstack
@kenstack
Nov 29 2014 05:36
Sweet
Ben West
@bewest
Nov 29 2014 05:36
:-)
well, I'm also requesting docs for protocol
and review on my implementation
Dana Lewis
@danamlewis
Nov 29 2014 05:37
Asking on all sides :D
Ben have you sent them stuff yet for review?
Ben West
@bewest
Nov 29 2014 05:38
no :-(
Dana Lewis
@danamlewis
Nov 29 2014 05:38
No worries, was jw
Ben West
@bewest
Nov 29 2014 05:40
there's a command for everything though
kenstack
@kenstack
Nov 29 2014 05:48
Gustavo is trying the easy button push now - perhaps we can fake it with an easy bolus
Ben West
@bewest
Nov 29 2014 05:48
:-)
kenstack
@kenstack
Nov 29 2014 05:48
I'm wondering if they turned all this off due to the hacker thing a few years ago
Ben West
@bewest
Nov 29 2014 05:49
for now we'll be like perl
there's more than one way to do things
kenstack
@kenstack
Nov 29 2014 05:51
:)
Struggling - all button commands error on his pump regardless of pc connection or not he will post to your repo the error
I will try on my sons pump (723) Tomkrrow
Dana Scott could you issue button commands in or not in pc connect ?
They work perfectly on 722 and older
Scott Leibrand
@scottleibrand
Nov 29 2014 05:56
Ben fixed a bunch of things for me. You'll need his latest wip branch.
mongo exportable date or some such.
I'm still filing issues to help him fix the remaining 523 incompatibilities
kenstack
@kenstack
Nov 29 2014 05:58
Hah - I took me 10 lines of code and like 5 hours to fix thst in my parser !!!! Should have waited ! :)
I noticed on your last post you had zeros in the pump time !
Scott Leibrand
@scottleibrand
Nov 29 2014 05:59
Reporting bugs is the most efficient way to get them fixed. :-)
kenstack
@kenstack
Nov 29 2014 05:59
Yeah yeah :)
Scott Leibrand
@scottleibrand
Nov 29 2014 05:59
zeros were from booting up a pump that'd been off for long enough to lose the time.
kenstack
@kenstack
Nov 29 2014 05:59
He probably fixed it in 2 min .... Took me hours
Also realize the rest of the output is not json - watch the ' and the capital letters
kenstack
@kenstack
Nov 29 2014 06:06
I wish I had his background ! Would save myself whole days !
Dana Lewis
@danamlewis
Nov 29 2014 06:07
I was just telling Scott how glad I am that we are at a point where there are several of us all working in this area :)
Ben West
@bewest
Nov 29 2014 06:11
me too
honestly, it blows my mind people besides me are working on this
kenstack
@kenstack
Nov 29 2014 06:43
It's great - it says the time is right ! Gusravo and I were just discussing - please add him when you have time he is all in !
Ben West
@bewest
Nov 29 2014 06:44
this is public room
I think you can give him the url
kenstack
@kenstack
Nov 29 2014 06:44
ahh ok !
Thought you needed an invite - will send to him
Ben West
@bewest
Nov 29 2014 06:48
I just added him also, not sure thats needed
I see his icon over there
ping @bustavo
kenstack
@kenstack
Nov 29 2014 06:50
@bustsvo
Gustavo
@bustavo
Nov 29 2014 16:28
I'm here now, thanks for including me.
Gustavo
@bustavo
Nov 29 2014 16:37
Today, I'll try to do some tests with the old remote control I found in my "intended to be reusable hardware" box. Its a very old remote... a MMT-500RMX I found absolutely no references for it online. Has three buttons, If I remember well they should be ESC ACT & EASY BOLUS
I've also been trying to find research on MD-Logic Artificial Pancreas Systems and have found a couple of papers & resources with algorithms: http://care.diabetesjournals.org/content/suppl/2010/02/02/dc09-1830.DC1/DC091830_Revised_Appendix_for_uploading.pdf
Gustavo
@bustavo
Nov 29 2014 16:46
Found it on the FCC ID database! Its this one: https://apps.fcc.gov/eas/GetApplicationAttachment.html?id=154763
kenstack
@kenstack
Nov 29 2014 17:40
I have been reading a bunch of review articles on the same will post after the Michigan game ... Which is brutal ...
I am very interested in discussing Dana and
Scott your algo. I'm struggling to see why a simple pid with meal annoucement isn't statistically similar in performance to more complicated methods. I'm also interested in your thoughts on parameter optimization - what are your plans ? I'm workingbon threshold suspend which is quite simple but Id likely to quickly move to low bg lowering of basal which is essentially going to be a one sided pid. Pid is used in 90 percent of commercial
process controls - im surpised we would need more but maybe I'm wrong ? I'm also interested in how to help detect señsor drop outs from pressure vs a low. I saw one incredibly complicated algo - I can't imagine this is practical.
Ben West
@bewest
Nov 29 2014 21:18
yes
kenstack
@kenstack
Nov 29 2014 21:18
I'm assuming I will over damp but what are your plans ? I know you aren't going to distirbute code but I'm very interested in your algos as I get into this - im thinking to stsrt with simple
pid
Ben West
@bewest
Nov 29 2014 21:18
I just got a contract to help a researcher gather the data to validate one such algorthm (to detect bad sensors)
kenstack
@kenstack
Nov 29 2014 21:18
Cool
Ben West
@bewest
Nov 29 2014 21:18
I think the key is keeping code isolated in separate repos
like decoding-carelink is pretty much just a curl type of library
kenstack
@kenstack
Nov 29 2014 21:19
Yes agree - or just share the algo
Ben West
@bewest
Nov 29 2014 21:19
there should be lots of small apps/libs to do one small thing
and then other small apps which use those things together
kenstack
@kenstack
Nov 29 2014 21:19
Anyone can code it (well a pro could:)
Ben West
@bewest
Nov 29 2014 21:19
so we can split up code for our strengths
kenstack
@kenstack
Nov 29 2014 21:19
Yes
Ben West
@bewest
Nov 29 2014 21:19
and then assemble it together somehow
makes it easier to validate each piece
kenstack
@kenstack
Nov 29 2014 21:19
Totally agree
Ben West
@bewest
Nov 29 2014 21:20
so concrete near term
I want to make a community, hosted "app" which uses the network to do alarm generation
kenstack
@kenstack
Nov 29 2014 21:20
Plus helps avoid the concerns around a completed app
Ben West
@bewest
Nov 29 2014 21:20
and consider ripping it out of nightscout
you can opt into it by configuring tiny bit here/there so that alarm generation is done outside nightscout
and nightscout is just doing redisplay
kenstack
@kenstack
Nov 29 2014 21:20
I have a fairly hacked together alarm system now that runs on a Java host 24/7 - been an interesting experience :)
Ben West
@bewest
Nov 29 2014 21:21
the aggregator hopefully shows how thi smight be done
kenstack
@kenstack
Nov 29 2014 21:21
Works flawlessly since there is a monitnsfript that keeps running it
Ben West
@bewest
Nov 29 2014 21:21
in terms of ... a server can act as another client on the the "data bus" for each nightscout... it can generate alarms
would be interesting to hook up graphite
kenstack
@kenstack
Nov 29 2014 21:22
Yes the alarm system needs to be separate and has redundant access to uploads
Ben West
@bewest
Nov 29 2014 21:22
same thing with predictions
kenstack
@kenstack
Nov 29 2014 21:22
My alarm system goes bananas when mongo goes down
Ben West
@bewest
Nov 29 2014 21:22
we can provide tunable and more varied predictions and things
if they are outside the app
kenstack
@kenstack
Nov 29 2014 21:22
Yes silos and an outside alarm system - I use pushover
Ben West
@bewest
Nov 29 2014 21:23
darryl and some others have done some interesting things with that
lot of options
native messaging, pushover, clickatell, twilio
we're adding mqtt now
Scott Leibrand
@scottleibrand
Nov 29 2014 21:27
as far as actual closed loop, I'm going to be uploading insulin data from pump, and getting carb estimates via manual entry (either direct to DIYPS, or via bolus wizard on pump).
Ben West
@bewest
Nov 29 2014 21:28
I've been playing around with a bolus wizard technique in order to distinguish better between correction and food IOB
IOB is tracked per bolus
but without an id
they just show up with ages in same order in a list
so what I've been doing is running the bolus wizard twice
once with 0 food, and all correction
and then again with all the same inputs but with any food
and I run the whole thing, even if it's 0 units
reason is that it forces recording IOB components
kenstack
@kenstack
Nov 29 2014 21:31
Intereting - don't we get that data from the medtronic bolus wizard ? I think there are errors but that's how I Calc it - are you seeing missed records ? Sorry maybe I misunderstood
Ben West
@bewest
Nov 29 2014 21:31
correct, using bolus wizard creates record of IOB
that's why I'm using it
the reason I do it twice is to separate between food and correction
in the bolus records themselves
it's just a total insulin for bolus by the motor
kenstack
@kenstack
Nov 29 2014 21:32
Scott thanks ! I was asking more on the algo to increase or decrease dosages based on error in target bg
Ben West
@bewest
Nov 29 2014 21:32
the wizard itself dinstinguishes between correctiona nd carbs
but the IOB records do not
and the bolus wizard itself does not
er
Scott Leibrand
@scottleibrand
Nov 29 2014 21:32
@kenstack I'm in process of writing down what I want to do, actually
if ($min < $min_bg_est) { #temp to zero for 30m }
elseif ($min < $target_bg) { #cancel any high-temps, let any low-temps run }
elseif ($min > $max_bg_est) { #high-temp as required to get $bg_est down to $max_bg_est
ugh, sorry
kenstack
@kenstack
Nov 29 2014 21:33
The
Scott Leibrand
@scottleibrand
Nov 29 2014 21:33
$min is the lowest predicted future BG
kenstack
@kenstack
Nov 29 2014 21:33
Bolus wizard gives the details on what part of the correction was food or bg right ? That's how I Calc it
Scott Leibrand
@scottleibrand
Nov 29 2014 21:34
$min_bg_est=90;
$target_bg=110;
$max_bg_est=120;
Dana Lewis
@danamlewis
Nov 29 2014 21:34
Ben remember that IOB is not net though..so not sure if you want to take it completely from the bolus wizard entry. We calculate and use net IOB.
Ben West
@bewest
Nov 29 2014 21:34
oh, for net, they simply sum the components
that's not something I really buy... what are you doing?
I want to visualize what they are doing
and then improve :-)
Scott Leibrand
@scottleibrand
Nov 29 2014 21:34
$bg_est = the "eventual" predicted BG after all insulin and carbs kick in
no, net = net of temp basals
kenstack
@kenstack
Nov 29 2014 21:34
Got it - so you are going to drop basal to adjust a low bg
Scott Leibrand
@scottleibrand
Nov 29 2014 21:35
medtronic's algorithm is solely based on boluses
Dana Lewis
@danamlewis
Nov 29 2014 21:35
Ben they don't do net like we do
Ben West
@bewest
Nov 29 2014 21:35
preferable to making me stop what I'm doing and eat :-)
Scott Leibrand
@scottleibrand
Nov 29 2014 21:35
if you temp to zero, that has no effect on their IOB calculation
kenstack
@kenstack
Nov 29 2014 21:35
Yes it's like the supper bolus
Ben West
@bewest
Nov 29 2014 21:35
@danamlewis yeah, would be interesting to contrast them, visually
with support of observations
kenstack
@kenstack
Nov 29 2014 21:35
Super bolus calculator I am also working on
Ben West
@bewest
Nov 29 2014 21:36
visualizing it can help us get away from "making recommendations"
Scott Leibrand
@scottleibrand
Nov 29 2014 21:36
we have super bolus calculations in #DIYPS if you want to copy them
Ben West
@bewest
Nov 29 2014 21:36
like, using bret victor's techniques to visualize process rather than make a recommendation
Scott Leibrand
@scottleibrand
Nov 29 2014 21:36
I'll have to pull out the code though
kenstack
@kenstack
Nov 29 2014 21:36
in terms of classic iob I think of it as full (all) food and carb portions
Cool on super bolus ! It's my fav thing when my kid eats 100 carbs :)
I want to visualize actual
Ben West
@bewest
Nov 29 2014 21:37
yeah, diyps-lite should help a lot with that
Scott Leibrand
@scottleibrand
Nov 29 2014 21:37
really? we never use super bolus for large meals, because the insulin hits before all the carbs do
kenstack
@kenstack
Nov 29 2014 21:37
current bg and expected to easily make a decision
Ben West
@bewest
Nov 29 2014 21:37
yeah, I have to delay for big carbs like that sometimes
Scott Leibrand
@scottleibrand
Nov 29 2014 21:37
we mostly use it to make corrections happen faster
kenstack
@kenstack
Nov 29 2014 21:37
Ever eat bisquick panckaes ? My kids favorite
Ben West
@bewest
Nov 29 2014 21:37
oh yeah, those are good
kenstack
@kenstack
Nov 29 2014 21:37
I use it for both
Scott Leibrand
@scottleibrand
Nov 29 2014 21:37
we tend to do early preboluses instead
kenstack
@kenstack
Nov 29 2014 21:38
Huge fast carb ingestions and corrections
Scott Leibrand
@scottleibrand
Nov 29 2014 21:38
if you do a bolus to correct to 80 up to an hour prior to the meal, you'll have enough iob that the pancakes don't all hit BG
kenstack
@kenstack
Nov 29 2014 21:38
Yes .... Can you talk to my 14 he old ???
:)
Scott Leibrand
@scottleibrand
Nov 29 2014 21:38
hah
Ben West
@bewest
Nov 29 2014 21:38
lol
pre-bolus is really really tough
but, temp basal can also help moderate
but requires more work
it's tough :-(
kenstack
@kenstack
Nov 29 2014 21:39
Yeah - I hassle my poor kid it's tough
Scott Leibrand
@scottleibrand
Nov 29 2014 21:39
so yeah, if you miss a pre-bolus, super-bolus is a good 2nd best solution I think
we haven't tried it yet, but I was thinking we should
Ben West
@bewest
Nov 29 2014 21:39
if he had a tool to visually see
kenstack
@kenstack
Nov 29 2014 21:39
Yep - use it all the time
Ben West
@bewest
Nov 29 2014 21:39
I'm planning on eating pancakes... what might happen if....
kenstack
@kenstack
Nov 29 2014 21:40
I pull 2 hours of basal upfront and drop basal to 10 percent
Ben West
@bewest
Nov 29 2014 21:40
then he could get used to it and prebolus on his own
kenstack
@kenstack
Nov 29 2014 21:40
Yes would be great -
Ben West
@bewest
Nov 29 2014 21:40
kenstack
@kenstack
Nov 29 2014 21:40
He's a great kid and for a teen in great control - just want to kill
Ben West
@bewest
Nov 29 2014 21:40
you can lay 100 carb circle on there
kenstack
@kenstack
Nov 29 2014 21:40
him sometimes :)
Ben West
@bewest
Nov 29 2014 21:41
and then play around with bolus before/after
it's super tough
kenstack
@kenstack
Nov 29 2014 21:41
Yes I wrote that in mathematica for him years ago !! He shakes his head at me as
does
mt wife :)
Ben West
@bewest
Nov 29 2014 21:41
oh you wanted to exercise, too? ;-)
kenstack
@kenstack
Nov 29 2014 21:41
Ok I ask for that sometimes :)
Ben West
@bewest
Nov 29 2014 21:41
heh
yeah, it's tough
we just don't have the right tools .... yet....
kenstack
@kenstack
Nov 29 2014 21:42
Yet !
Ben West
@bewest
Nov 29 2014 21:42
here's a pump... in order to use it effectively you'll need to manage several complex functions in your head at all times, good luck
kenstack
@kenstack
Nov 29 2014 21:42
Yes ... Thank God he is a math science kinda kid
Gotta get visual and easy
Ben West
@bewest
Nov 29 2014 21:43
hard not to be with this
it's easier with science... in science there's not much judgement, ideally, to experiments and data
so it's easier to let every test just be a test/observation without any judgement if it's just another experiment
is he into minecraft?
kenstack
@kenstack
Nov 29 2014 21:44
Yeah - my wife is much smarter then me but is a phd psychologist - math not her thing - visual is key - oh look I'm trending above should
correct
Aren't all kids ? He's a bit old
now but yes
He's been hacking minecraft
Ben West
@bewest
Nov 29 2014 21:45
that's more like it
yes... I'm wondering if diabetes and minecraft is a good platform for getting youth into coding
somehow
lot of natural hooks
I definitely got more involved with computers when I wanted to play quake 2 expert ctf with my friends in highschool
learned how to run servers, how to work modems
learned about how to be responsible for shared resources :-)
kenstack
@kenstack
Nov 29 2014 21:51
Hysterical :) yes minecraft is the perfect thing for kids - he started messing with it and it's the only reason he learned some Java
Now learning swift and javascript
Ben West
@bewest
Nov 29 2014 21:51
yeah, amazing
wow
kenstack
@kenstack
Nov 29 2014 21:52
He and i are working on an apple watch app for nightscout
Ben West
@bewest
Nov 29 2014 21:52
haha
nice
would be interested to put nightscout in minecraft somehow
kenstack
@kenstack
Nov 29 2014 21:52
That is a cool idea - a t1d fork
Scott Leibrand
@scottleibrand
Nov 29 2014 21:52
if ($min < $min_bg_est) { # temp to zero for 30m }
elseif ($min < $target_bg) { # cancel any high-temps, let any low-temps run }
elseif ($min > $target_bg) { # cancel any low-temps, let any high-temps run }
elseif ($min > $max_bg_est) { # high-temp as required to get $min down to $max_bg_est (up to 30m at +1U/hr) }
pretty sure that's all the logic we need for closed loop
obviously the complexity is in generating $min from BG, insulin, and carbs, but that logic is all in DIYPS-lite (Nightscout) already
kenstack
@kenstack
Nov 29 2014 21:54
Got it Scott thanks you'll adjust in 30 min increments ? A classic pid loop has derivative integral and absolute components to the correction - I'll share it as soon as I decide on the specific tuning algo
It's all about the parameter tuning
Ben West
@bewest
Nov 29 2014 21:55
lane d from mm has done some great work on that
kenstack
@kenstack
Nov 29 2014 21:55
I bet - can he share it ?
Ben West
@bewest
Nov 29 2014 21:56
there's a reference to the poster at the top: https://gist.github.com/bewest/cdef7a53f9af5e2286bc
hmmm
Scott Leibrand
@scottleibrand
Nov 29 2014 21:56
do those algorithms incorporate IOB and COB?
Ben West
@bewest
Nov 29 2014 21:56
yes
Scott Leibrand
@scottleibrand
Nov 29 2014 21:56
or are they solely based on BG like AR?
kenstack
@kenstack
Nov 29 2014 21:56
I'm really upset thst all these nih and jdrf funded researchers are now keeping algos proprietary - it's wrong if they take tax $
Ben West
@bewest
Nov 29 2014 21:57
yeah
kenstack
@kenstack
Nov 29 2014 21:57
Many options - I'll find some references tonight Scott and post
Ben West
@bewest
Nov 29 2014 21:57
yeah... seems wrong
kenstack
@kenstack
Nov 29 2014 21:57
Most are hybrid - they override classic pid settings when then know iob or a carb event happened
Though classic pid seems pretty damn good
Will check out lanes
Ben West
@bewest
Nov 29 2014 21:58
his newer one does account for insulin and carbs
but I don't have it :-)
kenstack
@kenstack
Nov 29 2014 22:00
Same with the bu guy but he isnt talking about it
Ben West
@bewest
Nov 29 2014 22:00
damiano?
kenstack
@kenstack
Nov 29 2014 22:01
Yep
So my spies tell me :)
He apparbetly made reference recently to not being totally event controlled - I know some people who know him - the stuff he is trying to license out will use inputs from non bg ply
only
Ben West
@bewest
Nov 29 2014 22:03
I think he plans on just using the cgm
kenstack
@kenstack
Nov 29 2014 22:03
Scott the one to look at is by Chen - his parameter estimation is good
Ben West
@bewest
Nov 29 2014 22:03
does not care so much about announcements and things
kenstack
@kenstack
Nov 29 2014 22:04
That's what he says but I think in reality he is going use inputs so I was told - I don't know him though just going based on people close to it
Ben West
@bewest
Nov 29 2014 22:04
worth being skeptical
kenstack
@kenstack
Nov 29 2014 22:04
Either way if it works im good :)
Ben West
@bewest
Nov 29 2014 22:05
mmmm. whenever you adopt technology, it's like having a pet or something... you live by the same rules it does
kenstack
@kenstack
Nov 29 2014 22:05
If you look at the orig Yale paper (weizener sp?) it compares with and without inputs in a simple
pid
I see no reason why not to use the data
And with glucagon it may be ok to just react to bg
Without we need to be smarter
Ben West
@bewest
Nov 29 2014 22:06
yeah, I'd prefer to see us be smarter about one drug before adding a second
kenstack
@kenstack
Nov 29 2014 22:06
I'll likely have state parameters and smithing between states - low, high, post meal etc
Smoothing
I just saw the poster -
simulatiion is a critical piece and that's cool. It angers me the uva one now costs $10k a year to license from a private company and that's the one jdrf and everyone else pushed thru the FDA to get it accredited ?? Ugh !!
I was in digital printjng and I have done a lot of work on measuring migration of chemicals into
kenstack
@kenstack
Nov 29 2014 22:12
Packaging and food - the fda accepts 100 percent simulation now no testing needed - maybe we can push them in a similar
way
we will change the FDA/regulation process
already started with Nightscout... it fits perfectly into their regulatory science agenda
kenstack
@kenstack
Nov 29 2014 22:15
Yes it does
The pharma r and d thing is a long convo ... What a mess
Ben West
@bewest
Nov 29 2014 22:16
yup
kenstack
@kenstack
Nov 29 2014 22:16
Costik and I were just talking about a simulator
Need a good one to do this
I'm really pissed abojt the uva one
Ben West
@bewest
Nov 29 2014 22:17
yeah, idea was to turn that also.js thing into open source simulator
run it on big ssl server somewhere
kenstack
@kenstack
Nov 29 2014 22:17
Yeah we will need somethjng -
Ben West
@bewest
Nov 29 2014 22:17
something like that
kenstack
@kenstack
Nov 29 2014 22:17
it's a worthy project
Ben West
@bewest
Nov 29 2014 22:17
operate it same way as aggregator
or similar
kenstack
@kenstack
Nov 29 2014 22:17
Yes
Ben West
@bewest
Nov 29 2014 22:18
offer a widget page to let people tweak the parameters and see what effects it has
time is short
kenstack
@kenstack
Nov 29 2014 22:19
Gotta run - talk soon - need to be able to run a lot of sims - and for long periods with error build up in the params - we need to decide on an interface
I've had issues with pid in chemical manufacturing with error in params - you never know where the params can go
Need limits etc history resets
kenstack
@kenstack
Nov 29 2014 22:40
I
Scott Leibrand
@scottleibrand
Nov 29 2014 23:18
@bewest: what would be the easiest way to get the output of ReadRTC added to the mm-latest.py output json? I'd want it to look something like this:
{
"_type": "LastRead",
"timestamp": "2014-11-29T15:13:41",
"date": 1417302821000.0
}
idea being, I want to know whether I've gotten the latest data off the pump, even if nothing has happened recently.
Ben West
@bewest
Nov 29 2014 23:19
sure
I'll add a flag for json output for rtc
Scott Leibrand
@scottleibrand
Nov 29 2014 23:20
sweet, thx
Ben West
@bewest
Nov 29 2014 23:20
hmm, something like --rtc-out clock.json
Scott Leibrand
@scottleibrand
Nov 29 2014 23:20
k