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

10th
Jan 2015
Ben West
@bewest
Jan 10 2015 03:30
working on --auto-init
Ben West
@bewest
Jan 10 2015 03:42
it's in wip/more-latest-json-files
Scott Leibrand
@scottleibrand
Jan 10 2015 05:48
so my thinking is that we pull all the pump data from the medtronic, and cgm data from either medtronic or dexcom, all into android
and pull bolus wizard config ("profile") data
overnight, we can implement the exact same algorithm I'm using in DIYPS now, all on the android, without needing connectivity
then, when we see a bolus that's bigger than required to correct down to the bolus wizard target range, we assume that's a meal bolus, and calculate the number of carbs that'd be required to justify that large a bolus
Ben West
@bewest
Jan 10 2015 05:50
nifty, watching the logs now
putting everything in java androidese will suck I htink
Scott Leibrand
@scottleibrand
Jan 10 2015 05:51
then we decay those "assumed carbs" according to a user-configured carb decay rate
Ben West
@bewest
Jan 10 2015 05:51
better to put it in node server attached to network I think
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:51
wonder if they'll make Go native for android
Scott Leibrand
@scottleibrand
Jan 10 2015 05:52
I definitely want this to work offline
Ben West
@bewest
Jan 10 2015 05:52
that would be neat
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:52
java does feel so dated
Ben West
@bewest
Jan 10 2015 05:52
or improve node support
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:52
the new cobol
Ben West
@bewest
Jan 10 2015 05:52
you can stuff everything in webview for js
was playing around with jockeyjs https://github.com/marksvdev/carelink-android
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:52
don't think that would be so stable
Scott Leibrand
@scottleibrand
Jan 10 2015 05:52
I don't care about the language, but it needs to run native on the phone eventually, so the phone doesn't even need a SIM
obviously there'd be the intermediate step of just having the android do the same thing the rPi does now, and just implement whatever DIYPS says
Ben West
@bewest
Jan 10 2015 05:53
I definitely want mine to have a sim
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:53
so you can't get the carbs from the pump? need to guess based on the bolus?
Scott Leibrand
@scottleibrand
Jan 10 2015 05:53
but there's no reason it can't do The Right Thing even when in airplane mode
Dana doesn't enter carbs usually
Ben West
@bewest
Jan 10 2015 05:53
sure
Scott Leibrand
@scottleibrand
Jan 10 2015 05:53
we could
but I think I have an algorithm that'd work even without using bolus wizard to enter them
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:54
seems like there would be an entry app on the phone
Scott Leibrand
@scottleibrand
Jan 10 2015 05:54
no need
easy bolus for your meal, and you're done
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:55
better than touching the pump
Scott Leibrand
@scottleibrand
Jan 10 2015 05:55
the APS watches your BGs as the meal bolus kicks in, and eventually takes over once the carbs expire
I don't want to let my code issue boluses
temp basals only
Ben West
@bewest
Jan 10 2015 05:55
I think a better bolus wizard would help that system a lot
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:55
I want a full remote
Scott Leibrand
@scottleibrand
Jan 10 2015 05:55
it'd be too easy to get "stuck" and issue boluses repeatedly
Ben West
@bewest
Jan 10 2015 05:55
yeah, I want better bolus
Scott Leibrand
@scottleibrand
Jan 10 2015 05:55
which could kill someone
Ben West
@bewest
Jan 10 2015 05:55
not for an actual bolus wizard
I listed 4 - 5 ways to verify this
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:56
the pump still has limits right?
Scott Leibrand
@scottleibrand
Jan 10 2015 05:56
only per-bolus limits
no limits on how often you can bolus
Ben West
@bewest
Jan 10 2015 05:56
there is a clear ACK response on whether or not the pump is attempting your request to bolus
Scott Leibrand
@scottleibrand
Jan 10 2015 05:56
a half unit every 5 minutes, and in a few hours you're in emergency glucagon territory
Ben West
@bewest
Jan 10 2015 05:56
there is a live status that tells you whether or not the pump is currently bolusing
you can cross check the reservoir status
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:57
I'm also thinking less auto and more easy of use
Ben West
@bewest
Jan 10 2015 05:57
and finally you can verify by looking at the history
Scott Leibrand
@scottleibrand
Jan 10 2015 05:57
there are ways to make it safer, but I still don't think I'd trust it without a whole heck of a lot more QA
Ben West
@bewest
Jan 10 2015 05:57
so if you can implement a nice bolus wizard and get all the data easily, it'd be very cool to issue a bolus
this is one of the few parts i would actually trust more than the others
Jason Calabrese
@jasoncalabrese
Jan 10 2015 05:57
not that I don't want auto, but I haven't been able to get my settings to matchup yet
Scott Leibrand
@scottleibrand
Jan 10 2015 05:57
for a manual bolus wizard, that only issues bolus commands on human button press, I'd be less worried
Ben West
@bewest
Jan 10 2015 05:58
yeah, that's what we're talking about I thought
when we say "bolus wizard"
means I'm using an interface and clicking OK
Scott Leibrand
@scottleibrand
Jan 10 2015 05:58
but the whole point of closing the loop is to minimize work on the PWD's part
Ben West
@bewest
Jan 10 2015 05:58
yes, but for now you need meal announcements
I don't want to go do 280 before temp basals are kicking in
and I don't want to guess with easy bolus I ther
either
Scott Leibrand
@scottleibrand
Jan 10 2015 05:59
no, I'm talking about doing your normal guestimated meal bolus, and then letting the loop take over
Ben West
@bewest
Jan 10 2015 05:59
I only use the bolus wizard right now
I don't randomly enter numbers
Scott Leibrand
@scottleibrand
Jan 10 2015 05:59
ok, great. no reason you shouldn't keep using it then
Ben West
@bewest
Jan 10 2015 05:59
I think there's a good reason :)
Scott Leibrand
@scottleibrand
Jan 10 2015 05:59
but a lot of people have figured out "this is a 3U meal" without good carb counts
Ben West
@bewest
Jan 10 2015 05:59
which is that it sucks
which is why I want a better bolus wizard
one where i put in the data, see the right stuff, and hit go
Jason Calabrese
@jasoncalabrese
Jan 10 2015 06:01
thats what I'm thinking
would be nice if there was a way to have to confirm on the pump
so send the request and have to push a button
but guess theres no way to do that
Scott Leibrand
@scottleibrand
Jan 10 2015 06:06
if you're doing that, why wouldn't you just want a recommendation displayed, and then easy bolus it in?
i.e. what DIYPS already does
Ben West
@bewest
Jan 10 2015 06:09
juts pushed changed to allow using the serial number from the prefs
Jason Calabrese
@jasoncalabrese
Jan 10 2015 06:10
great
Ben West
@bewest
Jan 10 2015 06:19
seems to work
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:12
whats the format you need enter the serial number? getting a crash with java.lang.NumberFormatException: Value out of range for byte: "84"
do you enter the prefix letters, etc?
Ben West
@bewest
Jan 10 2015 07:13
what is your serial number?
it's 6 digits long
one of mine is 208850
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:13
568444 for 1 of them
have a 522 and 722 now
Ben West
@bewest
Jan 10 2015 07:13
yeah
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:15
the 722 is a little more used, up button sticks, cracks, etc
Ben West
@bewest
Jan 10 2015 07:16
have you got running with decocare?
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:19
no, primary machine is a mac and didn't get around to setting up vm
Ben West
@bewest
Jan 10 2015 07:19
you can probably use comlink2-uart
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:19
have an old desktop with an old kubuntu that I use for backups
Ben West
@bewest
Jan 10 2015 07:19
ubuntu is pretty good
linux is awesome :-)
Scott Leibrand
@scottleibrand
Jan 10 2015 07:20
rPi is great for decocare too
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:20
I was hoping to skip that and go directly to android
Ben West
@bewest
Jan 10 2015 07:20
thing is we need help making sure export is correct
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:20
feels like it will be a while before I can use this for real
Ben West
@bewest
Jan 10 2015 07:21
insulin pumps are pretty complicated
Scott Leibrand
@scottleibrand
Jan 10 2015 07:21
yeah, there's a lot of validation that's way easier to do on Linux than android.
Ben West
@bewest
Jan 10 2015 07:21
there are tons of records, operationally
much more complicated than cgms, meters
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:22
not sure how I'd get real(ish) data to the pump if it's not being used for real
Ben West
@bewest
Jan 10 2015 07:22
test data is ok
what we are looking to do is verify that record is correct
so you want a fake pump
Scott Leibrand
@scottleibrand
Jan 10 2015 07:22
I had a pump with an old reservoir filled with water initially
Ben West
@bewest
Jan 10 2015 07:22
and run every operation repeatedly for every increment
take csv history, compare
Scott Leibrand
@scottleibrand
Jan 10 2015 07:23
and was just reproducing whatever Dana did on the real one.
Ben West
@bewest
Jan 10 2015 07:23
nah, youwant fake, test data
it's great to use one not in prod
take a baseline ReadHistoryData, then run bunch of commands, run again
take csv export
need windows for that I guess, not sure
works on some mac
or you can use the contour nextlink
with modern mac
to get carelink csv
get capture of usb if you do
but idea is to build up lots of logs like that
get ReadHistoryData before after the command you want to verify
that way we can diff the two and the new one pops out in color
posted how that works on twitter today :)
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:26
what format do I enter the serial, want to see something now
Ben West
@bewest
Jan 10 2015 07:26
but basically requires documenting which parts of csv export should match up with which pages of data binary
i do exactly as on the readme, export SERIAL=208850
same in the android
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:27
getting that exception
Ben West
@bewest
Jan 10 2015 07:27
using decocare?
what are you using?
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:27
android
Ben West
@bewest
Jan 10 2015 07:27
what did you enter?
its just the 6 digits
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:28
568444
Ben West
@bewest
Jan 10 2015 07:28
which exception?
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:28
yeah
Ben West
@bewest
Jan 10 2015 07:28
no perm?
hmmmm
well fwiw, it doesnt' decode any history
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:28
java.lang.NumberFormatException: Value out of range for byte: "84"
Scott Leibrand
@scottleibrand
Jan 10 2015 07:29
Sounds like you need to parse 84 base 10 to octal or hex?
Ben West
@bewest
Jan 10 2015 07:29
someone needs to stub out the remote commands so they all have a decode method which is given buffer of bytes to decode as argument
think if you parse 16, it works
that's the snippet mirnet gave me
pretty simple :-)
it may be possible to do meter type commands and other stuff from stick also
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:30
yeah, thats where the exception is comming from
Ben West
@bewest
Jan 10 2015 07:31
think collectively we should create meter with bunch of radios to do everything
bluetooth, etc, let android app or whatever do everything on bluetooth or whatever transport is selected
jess is already working on some kind of stick that bridges dexcom and medtronic
can do the meter commands
just needs fpga and test strip holder
Jason Calabrese
@jasoncalabrese
Jan 10 2015 07:43
changed the 16 to 10 and I get something, seems like it's talking now
INFO com.nightscout.core.drivers.MiniMed - Serial number: 082700
but no idea what that serial number is
Ben West
@bewest
Jan 10 2015 18:33
@bustavo gitter has backtick stuff singles for this
@bustavo
triple backtick
for multiline
Gustavo
@bustavo
Jan 10 2015 18:34
Ok, let me try that
Ben West
@bewest
Jan 10 2015 18:35
or gist is good too
Gustavo
@bustavo
Jan 10 2015 18:35
So I stopped getting ReadGlucoseHistory data from the 722
```
[
{
"raw": "0b-67-0a-0f-01-00-00",
"date_type": "minSpecific",
"op": "0x10",
"name": "10-Something",
"packet_size": 7
},
{
"raw": "0c-41-0a-0f-01-00-00",
"date_type": "minSpecific",
"op": "0x10",
"name": "10-Something",
"packet_size": 7
},
{
"raw": "0c-49-0a-0f-01-00-00",
"date_type": "minSpecific",
"op": "0x10",
"name": "10-Something",
"packet_size": 7
},
{
"raw": "0c-59-0a-0f-01-00-00",
"date_type": "minSpecific",
"op": "0x10",
"name": "10-Something",
"packet_size": 7
}
]
Ben West
@bewest
Jan 10 2015 18:36
which tool are you using to get it?
Gustavo
@bustavo
Jan 10 2015 18:37
\\
Ben West
@bewest
Jan 10 2015 18:37
is that list_cgm.py against some page of binary data?
can you post the binary page of data to gist?
or online somewhere
Gustavo
@bustavo
Jan 10 2015 18:37
I am using:
python /home/pi/decoding-carelink/bin/mm-send-comm.py --serial 123456 --port /dev/ttyUSB0 --prefix-path /home/pi/decoding-carelink/bin/ tweak ReadGlucoseHistory --page 1 --save
to get the data
Ben West
@bewest
Jan 10 2015 18:38
nice
Gustavo
@bustavo
Jan 10 2015 18:38
then
python /home/pi/decoding-carelink/list_cgm.py /home/pi/decoding-carelink/bin/ReadGlucoseHistory-page-1.data
Ben West
@bewest
Jan 10 2015 18:38
yeah, so there's a ReadGlucoseHistory-page-1.data
Gustavo
@bustavo
Jan 10 2015 18:38
to decode it
Ben West
@bewest
Jan 10 2015 18:38
post that file somewhere
Gustavo
@bustavo
Jan 10 2015 18:38
and I stopped getting BG values
ok
Ben West
@bewest
Jan 10 2015 18:40
are you able to run medtronic carelink to get csv export?
sorry for the hassle :-(
Ben West
@bewest
Jan 10 2015 18:41
hmmmm, just to make sure, can you do that again, but make sure the filename ends with .data instead of .txt
looks like they may have garbled it
with there automagic
Gustavo
@bustavo
Jan 10 2015 18:45
Is there a way I can send to gist directly from the RPi?
found it! give me a minute
Gustavo
@bustavo
Jan 10 2015 18:52
I get a Error: "\x9E" on US-ASCII
Ben West
@bewest
Jan 10 2015 18:57
ah, on rpi
if you do git rev-parse HEAD what does it say?
assuming you are using a git clone?
Gustavo
@bustavo
Jan 10 2015 18:58
5a8d0e8b04bd52e5c6dfa879bb81fc9ce674242d
let me try to rsync the file
Ben West
@bewest
Jan 10 2015 18:59
oo recent :-)
Gustavo
@bustavo
Jan 10 2015 18:59
yeah just updated it today
after that it stopped getting bg data :(
don't know if that is the cause really
Ben West
@bewest
Jan 10 2015 18:59
oh :-(
it was getting it before?
Gustavo
@bustavo
Jan 10 2015 19:00
yes
Ben West
@bewest
Jan 10 2015 19:00
don't think I changed anything in there though
hmmm
Gustavo
@bustavo
Jan 10 2015 19:00
I had an artificial pancreas in the morning :'(
Ben West
@bewest
Jan 10 2015 19:00
gah :-(
Gustavo
@bustavo
Jan 10 2015 19:00
I checked, and there are no changes to the used files
That is why I am almost sure it has nothing to do
Ben West
@bewest
Jan 10 2015 19:00
yeah, I'm pretty sure it's data
Gustavo
@bustavo
Jan 10 2015 19:05
@bewest, just emailed the file
Ben West
@bewest
Jan 10 2015 19:06
ah
it's ok
file is very short
only like 12 records
hmmmmmmmm
looks like a bit more than what is exported
hmmmmm

0000000: 3e3f42440000010f  >?BD....
0000008: 0a670b104547494a  .g..EGIJ
0000010: 0000010f0a410c10  .....A..
0000018: 4c4d0000010f0a49  LM.....I
0000020: 0c104e4f50000001  ..NOP...
0000028: 0f0a590c10504f4e  ..Y..PON
0000030: 4c4a484601000000  LJHF....
0000038: 0000000000000000  ........
Gustavo
@bustavo
Jan 10 2015 19:10
Yeah, no GlucoseSensorData
Ben West
@bewest
Jan 10 2015 19:11
here's raw pay load:
```
3e3f42440000010f
0a670b104547494a
0000010f0a410c10
4c4d0000010f0a49
0c104e4f50000001
0f0a590c10504f4e
4c4a484601000000
going to manually dissect it
just add newlines where the records are
it goes in reverse
wonder what the node js one does for this
bewest@patient:~/src/comlink2-uart$ node lib/session/cgm-history.js ~/Downloads/ReadGlucoseHistory-page-1.data 
null [ { input: '0146484a4c4e4f50100c590a0f010000504f4e100c490a0f0100004d4c100c410a0f0100004a494745100b670a0f01000044423f3e' },
  { head: [ 16 ],
    date: [ 12, 89, 10, 15 ],
    datetime: '2015-1-10T12:25:0',
    body: [ 1, 0 ],
    name: 'SpecialDisplay' },
  { head: [ 16 ],
    date: [ 12, 73, 10, 15 ],
    datetime: '2015-1-10T12:9:0',
    body: [ 1, 0 ],
    name: 'SpecialDisplay' },
  { head: [ 16 ],
    date: [ 12, 65, 10, 15 ],
    datetime: '2015-1-10T12:1:0',
    body: [ 1, 0 ],
    name: 'SpecialDisplay' },
  { head: [ 16 ],
    date: [ 11, 103, 10, 15 ],
    datetime: '2015-1-10T11:39:0',
    body: [ 1, 0 ],
    name: 'SpecialDisplay' } ]
bewest@patient:~/src/comlink2-uart$
same as list_cgm
5 records
claims 7 byteseach though
Gustavo
@bustavo
Jan 10 2015 19:17
I am restarting the sensor to see if that generates new data in there
Gustavo
@bustavo
Jan 10 2015 19:22
It added SensorSync & CalBGForGH data
Lets see if after this I start getting GlucoseSensorData again
It will take another 15 mins before I know
so I do see ~4 records for 16, 0x10
but, it looks like it's too aggressive somoehow
which model do you have?
Gustavo
@bustavo
Jan 10 2015 19:28
722
Ben West
@bewest
Jan 10 2015 19:28
I think original decoding was 722
hmmm
hmmmm
well
like
so, 0x01 is some kind of "stop sync" record
like, EOF at the time... looks like legit records in there
Gustavo
@bustavo
Jan 10 2015 19:29
Maybe it has something to do with the sensor
I started the sensor on the 754
and after 3 days
I started it on the 722
Ben West
@bewest
Jan 10 2015 19:30
but 0x10 has a anote ...
maybe it's fewer
Gustavo
@bustavo
Jan 10 2015 19:30
So the 754 marked sensor end, but it kept working on the 722
Ben West
@bewest
Jan 10 2015 19:30
hmmmmm
maybe there's a flag that changes meaning/size of packet or something
this thing says 7 byte packet
but
according to that dissection...
Gustavo
@bustavo
Jan 10 2015 19:32
it now added a DataEnd entry
```
[
{
"date": "2015-01-10T13:34:00",
"date_type": "none",
"op": "0x01",
"name": "DataEnd",
"packet_size": 0
}
]
.
*finally got the backticks
[
    {
      "date": "2015-01-10T13:34:00", 
      "date_type": "none", 
      "op": "0x01", 
      "name": "DataEnd", 
      "packet_size": 0
    }
  ]
I got one again!!
:D
[
    {
      "packet_size": 0, 
      "name": "GlucoseSensorData", 
      "date": "2015-01-10T13:34:00", 
      "date_type": "prevTimestamp", 
      "op": 60, 
      "sgv": 120
    }, 
    {
      "date": "2015-01-10T13:39:00", 
      "date_type": "none", 
      "op": "0x01", 
      "name": "DataEnd", 
      "packet_size": 0
    }
  ]
Ben West
@bewest
Jan 10 2015 19:39
hmmm
would be good to compare
if you can get carelink csv export
and put it in some place with the history file
that would be perfect
Gustavo
@bustavo
Jan 10 2015 19:39
never done a carlink csv export
Ben West
@bewest
Jan 10 2015 19:39
you can use contour nextlink on mac
Gustavo
@bustavo
Jan 10 2015 19:41
I don't have the nextlink
pancreas is alive again! :D
*wish I could refer to the organ not the software heh
Scott Leibrand
@scottleibrand
Jan 10 2015 19:43
heh
Ben West
@bewest
Jan 10 2015 19:47
oh, I might have ...something
were you 148 earlier?
144
140
2015-01-10T12:55:00 144 ?
Gustavo
@bustavo
Jan 10 2015 19:48
pump says: 12:53pm - 145
12:58pm - 141
1:03pm - 136
1:03pm - 132
12:48pm - 149
Ben West
@bewest
Jan 10 2015 19:51
ooooo the cgm logic makes my head hurt :(
so to be clear, there were definitely glucose records in that time
and the tool doesn't export them
is that right?
Gustavo
@bustavo
Jan 10 2015 19:52
Yes
Ben West
@bewest
Jan 10 2015 19:52
ok, that 0x10, 16, record is important
according to our current logic, that eats a bunch of bytes
Gustavo
@bustavo
Jan 10 2015 19:53
And the sensor restart somehow made the new ones appear again
Ben West
@bewest
Jan 10 2015 19:53
without eating them the way we do, it generates lot of glucose records
the times are weird though
there's some kind of offset indicator or something
I'm getting times on the 05 minute marks
00, 05
you were saying on the 03's
:03, :08
Gustavo
@bustavo
Jan 10 2015 19:54
Does reading the data from the pump generate a record?
Ben West
@bewest
Jan 10 2015 19:54
yes
Gustavo
@bustavo
Jan 10 2015 19:54
I check exactly every five minutes
Ben West
@bewest
Jan 10 2015 19:54
well, sorto f
yes, if you issue that WriteTimeSync command
it generates new datetime in the history :-)
I forget if the tool does that
there's a command to do it
Gustavo
@bustavo
Jan 10 2015 19:55
I am using mm-temp-basals.py to set the basals
But they get set with a delay of almost 2 minutes from when the script starts running
Ben West
@bewest
Jan 10 2015 19:56
you have a private repo up somewhere?
Gustavo
@bustavo
Jan 10 2015 19:56
Bitbucket
Ben West
@bewest
Jan 10 2015 19:56
I'm bewest there
most places
I looked at ihawk and made some changes to make things easier
Scott Leibrand
@scottleibrand
Jan 10 2015 19:57
would my code be useful here?
Gustavo
@bustavo
Jan 10 2015 19:57
Let me share it with you
Ben West
@bewest
Jan 10 2015 19:57
maybe, should definitely compare things
Gustavo
@bustavo
Jan 10 2015 19:57
Just remember its a WIP! :D
Ben West
@bewest
Jan 10 2015 19:57
I think you have me access to diyps
Scott Leibrand
@scottleibrand
Jan 10 2015 19:57
yeah, but the rPi stuff isn't there
Ben West
@bewest
Jan 10 2015 19:58
I've been looking at it, but don't think the rpi stuff is
yeah
would be interesting to take a look
Gustavo
@bustavo
Jan 10 2015 19:58
Just gave you access, its called sim_pancreas
Ben West
@bewest
Jan 10 2015 19:58
I can make a tool in decocare to work with these things
thinking maybe json server or something
the python stuff is pretty robust/reliable IMO
Gustavo
@bustavo
Jan 10 2015 19:58
everything is under /lib/tasks/
Scott Leibrand
@scottleibrand
Jan 10 2015 19:58
it's pretty simple. let's try this:
This message was deleted
yuck
lemme gist it
Ben West
@bewest
Jan 10 2015 19:59
maybe secret gist?
basically, we need to get bunch of carelink csvs and documented/paired with history pages
it's super simple, and doesn't do any CGM stuff
@bustavo I think I count 20 candidate glucose records in there
4 of those 0x10 records, looks like there may be a 4 byte datetime, then 3 params or osomething
I think the three byte 00 00 01 is a 3 byte param or something
should open issue
Gustavo
@bustavo
Jan 10 2015 20:48
Ok
I will & add your gist as reference
Ben West
@bewest
Jan 10 2015 20:48
thanks
sorry for the hassle
also, it would be super to see if you can get records csv export from carelink
Gustavo
@bustavo
Jan 10 2015 20:49
Don't worry!! I can't thank you enough for your work!!
kenstack
@kenstack
Jan 10 2015 20:49
@bustavo why the 2 min delay on temp basal ? It should be instant
Ben West
@bewest
Jan 10 2015 20:50
yeah, there's a query for pump status that will tell you temp basal
Gustavo
@bustavo
Jan 10 2015 20:50
@kenstack it has to do with how slow the RPi becomes when loading the environment for the Rails app
The script starts and then has to load ruby env / load libraries / etc
It saves some info to SQLite db
Ben West
@bewest
Jan 10 2015 20:51
2 seconds is pretty quick
hehe
rails is slow to boot... most web frameworks are though
Gustavo
@bustavo
Jan 10 2015 20:51
yes
since script is set up as cron job, it loads everything every 5 min
But I need that in order to see what is happenning and how it is reacting while I do testing
Ben West
@bewest
Jan 10 2015 20:55
is it ok to put this on github private repo?
bitbucket .... github has nicer design I think
Gustavo
@bustavo
Jan 10 2015 20:56
sim_pancreas?
Ben West
@bewest
Jan 10 2015 20:56
yeah
I freed some up private repos
ah, I see a rakefile that looks interesting
Gustavo
@bustavo
Jan 10 2015 20:58
Yes its ok. Just please strip the serials in /lib/tasks/ruby_pancreas.rake
The rakefile is the app itself
There is only one view that queries the db to take a look at the history
The rakefile has the treatment setup with the fuzzy-logic controller
Ben West
@bewest
Jan 10 2015 20:59
interesting, so you did some experiments to make sure the temp basal was accurate?
on 722
Gustavo
@bustavo
Jan 10 2015 20:59
Right now I am trying to make a view with a surface plot that will show current treament areas
The experiment is basically watching my BG react and adjusting
Being a bit of a daredevil here
So, please be careful if you decide to use the script
Ben West
@bewest
Jan 10 2015 21:03
yeah, I'm just looking at what people are doing with it
and looking to making it easier
the temp basal tool needs some love I think
it should report json-out
Sulka Haro
@sulkaharo
Jan 10 2015 21:04
SimPancreas sounds like a game a lot of people will be very excited to play in the future ;)
Ben West
@bewest
Jan 10 2015 21:04
probably include clock
Gustavo
@bustavo
Jan 10 2015 21:04
yeah
Ben West
@bewest
Jan 10 2015 21:05
there's a way to use /dev/fd/6 and friends I think
to get them written back to your process inline
but, I'm toying with notion of using tcp or http or something
mqtt?
websocket
Gustavo
@bustavo
Jan 10 2015 21:06
mqtt
seems to be lighter from what Ive read
Ben West
@bewest
Jan 10 2015 21:06
basically script would start, connect to remote, write/messages/respond to them, then finish/disconnect
Gustavo
@bustavo
Jan 10 2015 21:06
but have no real references
Ben West
@bewest
Jan 10 2015 21:06
I've been using it 100% for weeks on adnroid-uploader
kenstack
@kenstack
Jan 10 2015 21:06
@bewest I am really confident in temp basal re decocare - I've run it 100's of times - I even tried cutting power to the pi mid execution - it either works or the command isn't sent - as long as you query after you know what happened on the 722
Ben West
@bewest
Jan 10 2015 21:06
month actually
nice
would be good to publish on blog or something
Sulka Haro
@sulkaharo
Jan 10 2015 21:07
The lightness of the protocol is cool, but MQTT's "guaranteed delivery when possible, but just once" is extremely nice
kenstack
@kenstack
Jan 10 2015 21:07
Yes - on my list :) im deep into this prediction stuff right now to layer on ihawk
Ben West
@bewest
Jan 10 2015 21:07
ok, would prefer mqtt over websocket
:-)
awesome
I'm already using cloud mqtt
but it's no longer netlocal
or would rather decocare be a daemon itself?
was thinking script would run, and then end as it does today
so it connects, then does everything, then disconnects/dies
or is it better to config, connect, run forever?
kenstack
@kenstack
Jan 10 2015 21:09
I've got the basics working in mathematica and will rewrite in either node or js or Java depending on implamentation - in using the absorbtion curves from Scheiner for low medium hi gi, want to add exercise etx
Gustavo
@bustavo
Jan 10 2015 21:10
js!
:D
kenstack
@kenstack
Jan 10 2015 21:11
Just depends where we want to run it - im leaning towards having the Apache serve it so yes likely js - though a true cloud solution maybe more stable
The pi or whatever still craps out due to wifi now and again
Ben West
@bewest
Jan 10 2015 21:12
js is easy to run everywhere
I like node... gah, comlink2-uart is so close
Gustavo
@bustavo
Jan 10 2015 21:12
@kenstack add something like this to your scripts:
Ben West
@bewest
Jan 10 2015 21:12
would be easy to run it in daemon mode with that
kenstack
@kenstack
Jan 10 2015 21:12
Yeah - and I like the fact that js is frakencode ish :)
Gustavo
@bustavo
Jan 10 2015 21:12
  # Check for internet connection
  unless `ifconfig wlan0 | grep -q "inet addr:"`

    # If no internet connection, restart connection
    `ifup --force wlan0`

  end
Mine never disconnects unless I go out of range, but then reconnects when I get near a known network
kenstack
@kenstack
Jan 10 2015 21:13
Yep - have that now - still seems to hang - we can discuss offline maybe I screwed something up or the wifi dongle sucks
Though it's way better then before
Without that I couldn't go 8 hours ...
Ben West
@bewest
Jan 10 2015 21:15
it's possible to run a simple local mqtt server too
Gustavo
@bustavo
Jan 10 2015 21:15
It seems to go to sleep by default
Ben West
@bewest
Jan 10 2015 21:15
issue is remote mobile connecting to same thing
kenstack
@kenstack
Jan 10 2015 21:15
Then again I was in charge of a large development effort for copiers long ago - we solved the embedded controller flakiness problem .... Most copiers reboot every 12 hours :)
Ben West
@bewest
Jan 10 2015 21:16
for insulaudit-ssh-tools, I use ssh port forward to inject agent inside remote network using ssh key
Gustavo
@bustavo
Jan 10 2015 21:16
unless something is being copied right? hehe
kenstack
@kenstack
Jan 10 2015 21:16
Probably 100,000 of those babies still rebooting twice a day :)
Ben West
@bewest
Jan 10 2015 21:16
only way for it to work is using that ssh key
kenstack
@kenstack
Jan 10 2015 21:16
Yes :)
I like the ssh idea - at some point we need to add
security
Ben West
@bewest
Jan 10 2015 21:17
yeah, I like it, it's simple to wire up special account, this how git@github.com works, and lots of other things too
Ben West
@bewest
Jan 10 2015 21:27
@bustavo I just tried a small change which gets this: https://gist.github.com/bewest/c157f7dad2efc0e376f4
Gustavo
@bustavo
Jan 10 2015 21:27
Gets everything again!
let me try it
Ben West
@bewest
Jan 10 2015 21:29
dunno, it's not quite what you mentioend above
you had data point at 12:53 and I think 1:03
Gustavo
@bustavo
Jan 10 2015 21:29
hmm
Ben West
@bewest
Jan 10 2015 21:30
maybe
ok, maybe 01 is offset 5 minutes
and 0 is offset 1 on minute?
one minute instead of five?
Gustavo
@bustavo
Jan 10 2015 21:31
don't know
Ben West
@bewest
Jan 10 2015 22:33
don't think so
you are not using mm-latest
there are options for reservoir-out and everything else now
pure json file