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

5th
Sep 2015
Ben West
@bewest
Sep 05 2015 00:06
hard to see how the containerization thing will work like that
maybe it just works though
Scott Leibrand
@scottleibrand
Sep 05 2015 05:11
@jasoncalabrese I've started attempting to port the wip/iob-cob stuff over to funnel cake. I started with this diff of everything I did: https://gist.github.com/scottleibrand/b15de1d1e7807023010a
I was able to incorporate a lot of it into the correct places in https://github.com/scottleibrand/cgm-remote-monitor/commits/openaps-viz, but there is some stuff, particularly in lib/data.js, where I need to make some more changes but am not sure how what I did the first time around maps to the refactored code.
in particular, the key thing I haven't yet done in the new code base is https://gist.github.com/scottleibrand/b15de1d1e7807023010a#file-iob-cob-diff-L422
any pointers on where that should go?
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:16
wondering if there should be a start treatment for a temp basal with a length, and then we can generate the micro boluses from that
might be easier to render if it was one thing instead of a bunch of dots
we've been putting everything in entries, even custom stuff from RileyLink
lets us use the same api
just needs a different type
Scott Leibrand
@scottleibrand
Sep 05 2015 05:21
hmm, so in that case pretty much none of my code is applicable?
the problem with trying to normalize the data first is you just move all the complexity into the normalization, and then still have to deal with just as many records
in the OpenAPS case, you have temp basals that last for 3 minutes before getting overridden
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:24
don't think it needs to be normilized at first
think we should store it as we get it
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:24
with a different type
then at load transform it
Scott Leibrand
@scottleibrand
Sep 05 2015 05:24
I'm fine uploading to treatments with some sort of temp basal type
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:25
maybe store something very close to the command sent to the pump
but decoded
Scott Leibrand
@scottleibrand
Sep 05 2015 05:25
no, this is coming from pump history
so it'd be the data the pump gives back
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:25
right, could store both
to verify/review
Scott Leibrand
@scottleibrand
Sep 05 2015 05:26
sure, but you only want to display what the pump says actually happened
storing and displaying requested and enacted temp basals is a different problem, which @amazaheri @esteward and I all have various solutions for
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:26
one thing you'll see and might not like is codacy, does static analysis
so points out stuff like quotes, == vs ===, reuse of vars, etc
Scott Leibrand
@scottleibrand
Sep 05 2015 05:27
probably good for me to improve my coding. :)
was only 2 issues, 3 snuck it
Scott Leibrand
@scottleibrand
Sep 05 2015 05:29
so the data the pump gives us is two records for each temp basal, one with a rate the other with a duration
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:29
lots of the stuff it catches doesn't matter much, but clearing those helps find the real issues
Scott Leibrand
@scottleibrand
Sep 05 2015 05:29
logical thing to do is to consolidate those into one temp basal record if we're going to use entries
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:29
yeah, thats what I was just thinking
Ben West
@bewest
Sep 05 2015 05:30
for openaps design, I consider the "recommendation", the "request", and the "response", and the "result" all as different "reportable" things
Scott Leibrand
@scottleibrand
Sep 05 2015 05:30
yeah, we're just dealing with "results" here
Ben West
@bewest
Sep 05 2015 05:30
the NS api should be able to handle anything with a type, and it's fairly easy to tweak the api to aggregate/search for various things
Scott Leibrand
@scottleibrand
Sep 05 2015 05:30
IMO tracking request and response are useful for real-time monitoring, but out of scope for this exercise
I have another idea to improve my reporting there, but it will involve json display on pebble with Cards for Pebble, not nightscout
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:31
could add them later for sure
Scott Leibrand
@scottleibrand
Sep 05 2015 05:32
and @amazaheri has some good push notifications for enacted temps, along with a sql database to store it all for machine learning stuff
Ben West
@bewest
Sep 05 2015 05:32
sure, just overview on the fine grained semantics :-)
Scott Leibrand
@scottleibrand
Sep 05 2015 05:32
yes. thanks. so back to displaying actual pump history events...
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:32
for careportal would we store something similar to the combined rate/duration, seems like it
Scott Leibrand
@scottleibrand
Sep 05 2015 05:33
yeah. I assume you'll allow people to put in a 30 minute temp, and then 15 minutes later override it with something different?
my code deals with that all the time
so how would we go about defining a new type for entries?
and allowing API upload of it?
Ben West
@bewest
Sep 05 2015 05:34
the api allows it
the rules are fairly simple:
1.) have a type field
2.) have an iso date string field
3.) have a property with the name of the type field
ok, have a date field in js ms as well
Scott Leibrand
@scottleibrand
Sep 05 2015 05:37
so if we combine TempBasalDuration into TempBasal, we'd have:
{
"_type": "TempBasal",
"temp": "absolute",
"timestamp": "2015-09-04T18:36:32",
"rate": 0.0,
"duration": 30,
}
and would just need to figure out what to do about date
Ben West
@bewest
Sep 05 2015 05:37
eg, for pump history documents, might use type: "medtronic"
yeah, need to add type: "medtronic"
and date
Scott Leibrand
@scottleibrand
Sep 05 2015 05:37
well, there are also "_type": "Bolus",
Ben West
@bewest
Sep 05 2015 05:37
then it's perfect
_type != type
Scott Leibrand
@scottleibrand
Sep 05 2015 05:38
are you thinking we have both type: and _type: ?
Ben West
@bewest
Sep 05 2015 05:38
yeah, sure
also
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:38
but if we want to use this for careportal, wed convert the pump history to a treatment? a treatment into a pumphistory?
Ben West
@bewest
Sep 05 2015 05:38
need to add medtronic: $_type
entries is for stuff generated by medical device?
so it comes as type: medtronic
Scott Leibrand
@scottleibrand
Sep 05 2015 05:39
yeah, I want to keep treatments and pump data separate
Ben West
@bewest
Sep 05 2015 05:39
there then needs to be a medtronic property on the record...
Scott Leibrand
@scottleibrand
Sep 05 2015 05:39
and just do any attempted merge at display time
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:39
not as worried about the data in mongo as the in memory model
Ben West
@bewest
Sep 05 2015 05:39
so my suggestion is to use the value of _type
that way it's a medtronic type of record
and medtronic property points to type of record it is
Scott Leibrand
@scottleibrand
Sep 05 2015 05:40
are you saying it'd be "medtronic": "bolus" ?
Ben West
@bewest
Sep 05 2015 05:40
correct
Scott Leibrand
@scottleibrand
Sep 05 2015 05:40
and "medtronic": "tempBasal"?
k
Ben West
@bewest
Sep 05 2015 05:40
right
yeah, type value needs to be a property n ame
Scott Leibrand
@scottleibrand
Sep 05 2015 05:40
but also, in the same record, "type": "medtronic"
Ben West
@bewest
Sep 05 2015 05:40
so might as well copy _type
correct
Scott Leibrand
@scottleibrand
Sep 05 2015 05:40
k
Ben West
@bewest
Sep 05 2015 05:41
any record with a type and a date is valid in NS api
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:41
type value isn't always a property name, don't think we need to force that
Ben West
@bewest
Sep 05 2015 05:41
but also needs a property with the name of the value of type
and it also needs an iso date string
those are the four rules
Scott Leibrand
@scottleibrand
Sep 05 2015 05:42
@jasoncalabrese with regard to in memory model, I think we have both medtronic boluses and careportal treatment boluses in memory as separate things
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:42
but ui will deal with them as the same
Scott Leibrand
@scottleibrand
Sep 05 2015 05:42
and when we go to display them, we can deduplicate if we want
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:43
thinking that converting your entry to a treatment on load might be good
or maybe temp are something else
Scott Leibrand
@scottleibrand
Sep 05 2015 05:44
well, converting pumphistory events into treatments is essentially what I did: https://gist.github.com/scottleibrand/b15de1d1e7807023010a#file-iob-cob-diff-L422
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:44
there a thing called sbx (sandbox) that it used by the plugins
Scott Leibrand
@scottleibrand
Sep 05 2015 05:44
I don't remember where I did the deduplication in nightscout
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:44
it has data, sbx.data
Scott Leibrand
@scottleibrand
Sep 05 2015 05:45
or maybe I didn't, not sure
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:45
so maybe sbx.data.tempBasals would be good
there were only about 2 files then
Sulka Haro
@sulkaharo
Sep 05 2015 05:46
Ding. Scott awesome you're talking Nightscout :)
Scott Leibrand
@scottleibrand
Sep 05 2015 05:46
oh, I remember
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:46
on the server sbx.data is basicly an instance of data.js
Scott Leibrand
@scottleibrand
Sep 05 2015 05:47
my code doesn't deal with Bolus events at all
Sulka Haro
@sulkaharo
Sep 05 2015 05:47
The one feature I'm missing the most in Nightscout right now is automated downloading of treatments
Scott Leibrand
@scottleibrand
Sep 05 2015 05:47
those get entered as treatments by diyps
so the deduplication occurs there
so yeah, we really can't use my code as is: we need to handle pump bolus events and figure out whether (and if so, how) to dedupe them against care portal boluses
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:48
dedupe could be hard
Scott Leibrand
@scottleibrand
Sep 05 2015 05:48
yeah, you have to make assumptions
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:48
think we need to see it for real first
Scott Leibrand
@scottleibrand
Sep 05 2015 05:49
like "if you have a treatment and a pump bolus of the same size less than 10 minutes apart, ignore the treatment" or something
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:50
yeah
Scott Leibrand
@scottleibrand
Sep 05 2015 05:50
or you can just say we don't support both entering and uploading at the same time
and if you try, your IOB will be too high
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:50
I was thinking of doing grouping
Scott Leibrand
@scottleibrand
Sep 05 2015 05:50
(or too low if they're low-temps)
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:50
so at that time you'd see the pump bouls, but on hover you'd see the was treatement for the same too
Scott Leibrand
@scottleibrand
Sep 05 2015 05:50
grouping is fine for display
I'm more worried about calculating IOB correctly
especially with BWP
funnel cake is slick, btw. upgraded my bedside display site: I think it's better even without the temp basal display while we get that part fixed up
anyway, dedupe is a hard problem we can tackle later
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:52
yeah
Scott Leibrand
@scottleibrand
Sep 05 2015 05:53
so if we figure out the date and structure the json properly in openaps, how do I upload the result to the NS API?
is that just a POST with a json payload?
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:53
yeah to /api/v1/entries
a single json object or an array
@bewest added some nice things to the api
Scott Leibrand
@scottleibrand
Sep 05 2015 05:54
and does it need API_SECRET?
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:54
yeah, add the api secret, for treatments and careportal we have it open now, but we need to close that hole
with the profile editor you can enter the api secret on the client
Scott Leibrand
@scottleibrand
Sep 05 2015 05:55
except on my digitalocean node instance

on that instance when I click Authenticate I get:

Uncaught TypeError: $(...).dialog is not a function hashauth.js:66
requestAuthentication @ hashauth.js:66
onclick @ index.html:1

on azure it works fine
might be related to Failed to load resource http://<server>/bower_components/jquery-ui/themes/ui-darkness/jquery-ui.min.css: the server responded with a status of 404 (Not Found)
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:58
do an npm install
Scott Leibrand
@scottleibrand
Sep 05 2015 05:59
I did just to get it working at all
Jason Calabrese
@jasoncalabrese
Sep 05 2015 05:59
bower didn't run right
maybe wipe the /bower_components dir
Scott Leibrand
@scottleibrand
Sep 05 2015 06:01
npm WARN prefer global json2csv@2.2.1 should be installed with -g
npm WARN cannot run in wd Nightscout@0.8.0 node node_modules/bower/bin/bower --allow-root install (wd=/var/www/github/cgm-remote-monitor)
use -g?
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:03
don't think that matters
-g is bad
Scott Leibrand
@scottleibrand
Sep 05 2015 06:04
npm ERR! Tell the author that this fails on your system:
npm ERR! node node_modules/bower/bin/bower --allow-root install
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:04
it's for system wide tools
Sulka Haro
@sulkaharo
Sep 05 2015 06:04
What's the currently smallest known device that can run openaps? Our 4 year old absolutely refuses to carry anything larger than a single phone with him, and complains even about that.
Scott Leibrand
@scottleibrand
Sep 05 2015 06:04
@TC2013 has it running on Android
but he's using a completely different algorithm
Sulka Haro
@sulkaharo
Sep 05 2015 06:05
Yes, and that's a partial implementation of the protocols
It almost works with our pump, except the parsing of temp basal data goes haywire
Haven't had the time to debug what's going on
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:06
might even be something old not right in node_modules
Scott Leibrand
@scottleibrand
Sep 05 2015 06:06
bah, now I completely screwed up my funnel cake install it looks like
maybe I'll blow it away and start with a fresh clone
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:06
try wiping node_modules first
Scott Leibrand
@scottleibrand
Sep 05 2015 06:08
maybe I need to upgrade npm:
npm WARN engine benv@1.1.0: wanted: {"node":">= 0.12.0"} (current: {"node":"0.10.33","npm":"1.4.28"})
and node
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:16
don't think it's requires 0.12
working at all now?
upgrading node would update npm
Scott Leibrand
@scottleibrand
Sep 05 2015 06:17
blew it away and starting over
npm WARN cannot run in wd Nightscout@0.8.0 node node_modules/bower/bin/bower --allow-root install (wd=/var/www/github/cg
m-remote-monitor)
do I need to cd .. and npm install cgm-remote-monitor ?
that looks better
still running though
bah, still failing to load bower_components
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:21
try running node_modules/bower/bin/bower --allow-root on its own
Scott Leibrand
@scottleibrand
Sep 05 2015 06:22
that did it
and now authenticate works too
thx
I'm a bit reluctant to enter anything via the profile editor, though, since it writes to the same db DIYPS uses :)
maybe tomorrow or sunday when I have time to debug. :)
hmm, BGI disappeared? :(
I want that back. is there an undocumented ENABLE for it?
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:31
yeah, they'd probably step on each other
has support for time ranges
for sens, carbratio, any property
Scott Leibrand
@scottleibrand
Sep 05 2015 06:32
yeah, saw that. snazzy. :)
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:32
would write with an array
probably break you other stuff
Scott Leibrand
@scottleibrand
Sep 05 2015 06:32
any easy way to get BGI back?
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:32
will read simple values or arrays
was wondering if we should have BGI plugin
or name it something else
Scott Leibrand
@scottleibrand
Sep 05 2015 06:33
I'm talking about Blood Glucose Impact (of insulin activity)
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:33
and need to put the forecast in a plugin
maybe its the same plugin
Scott Leibrand
@scottleibrand
Sep 05 2015 06:34
I guess that depended on some of the cob and purple line stuff you didn't port
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:34
yeah BGI
on auotpilot writing BWP
Scott Leibrand
@scottleibrand
Sep 05 2015 06:34
that's the other thing I need to figure out how to port as a plugin
:)
guess that's what you just said: forecast
yeah, plugin needs a function named forecast, with a predicted property
don't need the avgLoss there
just an array of points
Scott Leibrand
@scottleibrand
Sep 05 2015 06:36
any requirements for how many points to return?
no
but need to do something to adjust the forecast window
Scott Leibrand
@scottleibrand
Sep 05 2015 06:37
wonder what we should call our forecast plugin
purpleline? :)
@danamlewis is sleeping, but I think she'd like that
1 plugin can do multiple things
might work to have the bgi and purple line as the same plugin
Scott Leibrand
@scottleibrand
Sep 05 2015 06:39
yeah
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:39
it could generate alarms too
Scott Leibrand
@scottleibrand
Sep 05 2015 06:39
could make the forecast window a function of the zoom level
60m @ 6h, 120m @ 12h, 240m @ 24h
window/6
maybe the plugin should request a forecast time
and then we pick the biggest
should be able to overlay multiple forecasts with what's there now
have them show in the Show Plugins list, and you can pick and choose in the client
Scott Leibrand
@scottleibrand
Sep 05 2015 06:41
just because purpleline can predict out DIA hours, doesn't mean we want to display that when zoomed in
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:42
yeah
when it gets flat it doesn't make sense anymore either
Scott Leibrand
@scottleibrand
Sep 05 2015 06:42
yeah
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:42
adjusting the forecast size with data might be jumpy
Sulka Haro
@sulkaharo
Sep 05 2015 06:42
Scott the plugin stuff will be self-evident very quickly once you dig into the code
Scott Leibrand
@scottleibrand
Sep 05 2015 06:43
maybe default to 1/6 of the historical for now, so it always uses the same amount of real estate
yeah, it looks like it from what jason's been posting
getting late or I'd dive in. :)
Sulka Haro
@sulkaharo
Sep 05 2015 06:43
I'd love to hear how you like the architecture once you're up to speed
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:43
could pass something to the plugin
put it in the sbx, on chart zoom
Scott Leibrand
@scottleibrand
Sep 05 2015 06:44
a lot better than the old spaghetti code I can already tell :)
Sulka Haro
@sulkaharo
Sep 05 2015 06:44
Yeah any needs for extending the API one way or the other, shout
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:44
easy to add tests now too
Scott Leibrand
@scottleibrand
Sep 05 2015 06:44
I need someone to walk me through that once I have something that needs covered
Sulka Haro
@sulkaharo
Sep 05 2015 06:44
My only wish is, let's aim to keep the plugin side as css free as possible
As in, add more or less generic visualization code to the base and have the plugins just call that
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:45
it dom free too
Sulka Haro
@sulkaharo
Sep 05 2015 06:45
Yes
Scott Leibrand
@scottleibrand
Sep 05 2015 06:45
agreed. ok, let me sleep on all this and then pick it up tomorrow or sunday.
Sulka Haro
@sulkaharo
Sep 05 2015 06:45
dom freedom
Scott Leibrand
@scottleibrand
Sep 05 2015 06:45
thx for the help
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:46
could split the cob/iob too have them separate or combined
Sulka Haro
@sulkaharo
Sep 05 2015 06:46
❤️ you're helping with Nightscout again
Scott Leibrand
@scottleibrand
Sep 05 2015 06:46
:)
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:46
like how @kenstack does it in dash
Scott Leibrand
@scottleibrand
Sep 05 2015 06:47
IMO both iob and cob are dependencies for doing any sort of decent forecast
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:47
yeah, but would be cool, toggle them
Sulka Haro
@sulkaharo
Sep 05 2015 06:47
The posts on facebook where people look at the bwp math early diyps style and figure out their profile is off is so awesome
Scott Leibrand
@scottleibrand
Sep 05 2015 06:47
although maybe we could turn openaps' bolus snooze algorithm into a forecast predictor with a wide cone, like ar2 but smarter
:)
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:47
make adjustment to profile without saving and see the effect
was thinking about that
adjust cone size on both top and bottom based on active insulin
Sulka Haro
@sulkaharo
Sep 05 2015 06:48
Side question - adjustments to the plugin code would allow this to be run inside openaps, right?
Scott Leibrand
@scottleibrand
Sep 05 2015 06:49
not sure what you mean
Sulka Haro
@sulkaharo
Sep 05 2015 06:49
Plugin API I mean
Share the exact same source cross the board
Scott Leibrand
@scottleibrand
Sep 05 2015 06:49
I plan to have openaps (attempt to) upload everything it can to nightscout
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:49
sharing code would be nice
Sulka Haro
@sulkaharo
Sep 05 2015 06:49
Dedupe the implementation of same algorithms in both systems
Scott Leibrand
@scottleibrand
Sep 05 2015 06:49
but mostly it'll just be formatting things properly for the upload API
oh, gotcha
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:50
little modules for the calculators
Scott Leibrand
@scottleibrand
Sep 05 2015 06:50
not sure yet if there's enough overlap to matter
IOB calculation maybe
that one shares a lot of code
Jason Calabrese
@jasoncalabrese
Sep 05 2015 06:51
wondering if all the active insulin calculations should be in IOB or somewhere else
Scott Leibrand
@scottleibrand
Sep 05 2015 06:51
I like doing them all in one place
I even added bolusiob to the data set iob.js returns for openaps
so it's returning iob, activity, and bolusiob
since it can calculate all three at the same time with no extra work
Sulka Haro
@sulkaharo
Sep 05 2015 06:52
The server-side sbx unit test already allow command-line execution of the code
Scott Leibrand
@scottleibrand
Sep 05 2015 06:52
here bolusiob is the accelerated-decay version I'm using for bolus snooze
haven't looked at the funnel cake refactored code, but should be fairly easy to get to the point where the same iob.js gets called by both nightscout and openaps
was thinking I want to do the same for @TC2013's roundtrip, if there is a way to call javascript from android
so we can have roundtrip call iob.js and determine-basal.js and not have to port the core algorithm code to get it running on android
but I really am about to turn into a pumpkin, so good night all. :)
Sulka Haro
@sulkaharo
Sep 05 2015 07:04
Night!
Sulka Haro
@sulkaharo
Sep 05 2015 07:48
And yes, it's possible to run Javascript inside Android and iOS apps. Both even allow the code to be updated in live apps.
Apple allowing dynamic code updates is pretty new
Theoretically we could implement iOS and Android apps that only implement platform specific API to talk to a BLE device and visualization, then share 100% of the code to parse packets + algorithms
That'd be very cool
Sulka Haro
@sulkaharo
Sep 05 2015 07:55
I think the only thing preventing that from happening very quickly is the fact that we're not pulling the efforts together too well. A lot of individuals doing their own thing. Pooling the efforts in this manner could mean we'd have a working thing in no time.
Jason Calabrese
@jasoncalabrese
Sep 05 2015 08:21
lots of science projects, somethings still need to be figured out but it does seem like there's enough consensus on some of the core things
Oskar Pearson
@oskarpearson
Sep 05 2015 10:59
Hey all. I'm working through loop.sh on openaps-js - specifically https://github.com/openaps/openaps-js/blob/master/bin/loop.sh#L36-L40
My understanding is that the glucose.json.new report is configured ala https://github.com/tghoward/betacb/blob/master/openaps.ini#L26-L29
So, the output report (the glucose.json.new file) contains these values:
Am I right in that understanding so far?
Oskar Pearson
@oskarpearson
Sep 05 2015 11:04
My issue is... I don't have a dexcom CGMS :) I've got a medtronic CGMS. It doesn't have the equivalent glucose method. So when trying to run the report, I get this:
openaps report invoke glucose.json.new
Traceback (most recent call last):
  File "/root/venv-openaps/bin/openaps-report", line 82, in <module>
    app( )
  File "/root/venv-openaps/local/lib/python2.7/site-packages/openaps/cli/__init__.py", line 44, in __call__
    self.run(self.args)
  File "/root/venv-openaps/bin/openaps-report", line 75, in run
    output = app(args, self)
  File "/root/venv-openaps/local/lib/python2.7/site-packages/openaps/cli/subcommand.py", line 50, in __call__
    return self.method.main(args, app)
  File "/root/venv-openaps/local/lib/python2.7/site-packages/openaps/reports/invoke.py", line 24, in main
    task = app.actions.commands['add'].usages.commands[device.name].method.commands[report.fields['use']]
KeyError: 'glucose'
Has anyone got this working with a medtronic CGMS?
timomer
@timomer
Sep 05 2015 11:06
@scottleibrand @sulkaharo porting the openaps js to android is not that difficult if you already understand the code - it was more adjusting the functions to fit a native app was the challenge
Oskar Pearson
@oskarpearson
Sep 05 2015 11:38
And - the glucose report effectively should look like this: https://github.com/bewest/openaps-example/blob/master/glucose.json
Oskar Pearson
@oskarpearson
Sep 05 2015 14:41
Does anyone have a newer version of loop.sh, which doesn't require "openaps suggest"? Or the appropriate aliases in openaps.ini that fix it?
https://github.com/amazaheri/openaps-js/blob/master/bin/loop.sh#L56 runs "openaps suggest", but openaps/openaps@8677235 deleted it in June
I'm guessing that we now use an alias and a plugin for it, but I'm having trouble figuring out what it would be. Perhaps it's because it's 4pm and I've not had breakfast or lunch :)
Chris Hannemann
@channemann
Sep 05 2015 15:19
@oskarpearson RE: MM CGM, @loudnate is the man to talk to there. His loop is running with one, and the openaps plugins in his repos (specifically opeanps-glucosetools) handle both MM and Dex cgm data.
Nathan Racklyeft
@loudnate
Sep 05 2015 15:54
Hey @oskarpearson, have you tried calling the Medtronic device commands to retrieve glucose, openaps use <MM-Device-Name> iter_glucose_hours 1?
I'd recommend spending some time getting familiar with the reporting and commands provided in openaps before jumping into a loop script.
Scott Leibrand
@scottleibrand
Sep 05 2015 16:16
+1 to that. The openaps suggest line just references an openaps alias that you'll need to create. Mine currently does:suggest = report invoke profile.json iob.json requestedtemp.online.json requestedtemp.offline.json
Scott Leibrand
@scottleibrand
Sep 05 2015 16:39
Also, thanks for all your PRs today.
Oskar Pearson
@oskarpearson
Sep 05 2015 17:27
Thanks so much for the pointers.
I've got openaps returning glucose data - but right now I don't have an attached CGMs. We only have one left before we have to order a new batch, so I'm trying to get absolutely everything going before we connect the sensor. But of course that's a bit of a catch-22 :)
I was hoping to send data to nightscout based on the old data, and then test the modelling a bit. But there's a lot of stuff in the loop script that's not documented :) (I'm glad, to some degree - it means people need to understand what they are doing before plugging it in :)
Scott Leibrand
@scottleibrand
Sep 05 2015 17:43
Heh exactly. ;-)
Ali Mazaheri
@amazaheri
Sep 05 2015 18:13
Capture2.PNG
Capture.PNG
Capture2.PNG @scottleibrand Your Azure SQL and webAPI all setup and confiured just posted a test from sendtempbasal-azure.js to your endpoint
Dana Lewis
@danamlewis
Sep 05 2015 18:15
I'll take a look at the readme's later, that's one of the things we want to balance - being nice but also being serious about people understanding what they're doing. Something I also want to make repetitive in the documentation throughout, too for anyone who skips the readme or forgets it
@amazaheri Cool we are en route for hiking but will play with tonight
Ali Mazaheri
@amazaheri
Sep 05 2015 18:16
awesome! have fun
I sent the credential to SQL via email to @scottleibrand as well
Dana Lewis
@danamlewis
Sep 05 2015 18:17
Ya saw that thx
diabeticgonewild
@diabeticgonewild
Sep 05 2015 18:40
This is important information that everyone that is working on this "project" needs to know (will make a post to openaps-dev eventually).

Need peer reviewed journal articles on diabetes for personal research or for insurance issues (appeals)?

The U.S. Government has a tool for locating libraries in your area that participate in Inter Library Loan (ILL) so you can obtain virtually any journal article you want! (Make sure to search pubmed.com or scholar.google.com for articles you want!)

Go to nnlm.gov/members or call 1-888-346-3656 to find which libraries in your area participate in Inter Library Loan. (Select "loansome doc" in the selection tool when searching.)

See the image I am about to link.

I used the search utility for the link I posted above with "loansome doc" (the national library of medicine's inter library loan) and I found this local library which is open to the public: http://i.imgur.com/PfPVMGi.jpg
diabeticgonewild
@diabeticgonewild
Sep 05 2015 18:46
This is for Americans only.
diabeticgonewild
@diabeticgonewild
Sep 05 2015 19:00
Also for @scottleibrand and @bewest somebody on Facebook got ahold of the translator from Medtronic that translates Bluetooth to RF and it can even deliver boluses. See: http://i.imgur.com/CgbEJAU.jpg
Dana Lewis
@danamlewis
Sep 05 2015 19:02
Losing signal, can you tell what country he is in?
Oskar Pearson
@oskarpearson
Sep 05 2015 19:09
If there are any FCC or regulatory ids / model ids or similar on it that would be great too. There are sometimes reasonably detailed technical manuals based on FCC id
diabeticgonewild
@diabeticgonewild
Sep 05 2015 19:12
He lives in Montreal, Quebec
Similar regulatoryaws to the US
Similar regulations in the sense that Canada is less lax than Europe but less strict than US
Ben West
@bewest
Sep 05 2015 19:13
I think it's basically the same as rileylink
diabeticgonewild
@diabeticgonewild
Sep 05 2015 19:14
Sorry was taking a shower.
I guess but it still is directly from the manufacturer. You aren't scavenging to find things to reverse engineer with.
Like @bewest You needed Paradigm PAL and Bolus remote to do your work. No question about that.
Ben West
@bewest
Sep 05 2015 19:17
no, you need a pump that accepts commands
and a way to send them
bolus remote is one way
carelink usb stick is another
the medtronic connect is another, and works the same way as rileylink
diabeticgonewild
@diabeticgonewild
Sep 05 2015 19:17
I have searched FCC ids like crazy
Ben West
@bewest
Sep 05 2015 19:17
they literally do the same thing and work the same way
if we open it up, it may even have the same chips
diabeticgonewild
@diabeticgonewild
Sep 05 2015 19:18
I doubt it with the rileylink given circuit design
Ben West
@bewest
Sep 05 2015 19:18
I'm pretty sure both devices use a cc1110
they probably use the same bluetooth chip as well
cc2540
diabeticgonewild
@diabeticgonewild
Sep 05 2015 19:20
I wouldn't get too excited. Circuit design is very versatile, given you follow certain conventions like passive sign convention and Kirchhoffs voltage and circuit laws
BTW, FCC ID search is down this weekend for Labor Day upgrades, according to FCC.gov so can't do a hardcore search to find similar images this weekend...
diabeticgonewild
@diabeticgonewild
Sep 05 2015 19:27
My cousin who is an electrical engineer who works on medical devices says that Medtronic uses proprietary communications technologies because they are filthy rich.