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

17th
Sep 2016
Jason Wittmer
@jbwittmer
Sep 17 2016 00:00
@scottleibrand do you think the nightscout software version would make any difference? We pulled the dev arm rather than 0.9.0 -beta2?
Scott Leibrand
@scottleibrand
Sep 17 2016 00:00
dev should get you 0.0.0-beta3 right? that's what we use quite successfully
Jason Wittmer
@jbwittmer
Sep 17 2016 00:02
I'm not sure but this version asked for token authentication when we wanted to enter data into care portal, which I've never had to do with my setup. I wonder if that's preventing the data from uploading correctly?
I'm trying to revert to the nightscout version that I'm using to see if that fixes it
Chris Oattes
@cjo20
Sep 17 2016 00:03
I disagree about the basal need decrease
Scott Leibrand
@scottleibrand
Sep 17 2016 00:03
if your API_SECRET is correct, that should accomplish the token auth. if you didn't have token auth enabled prior, you might've had an incorrect API_SECRET and it would've worked anyway
Chris Oattes
@cjo20
Sep 17 2016 00:04
because basal requirement also depends on liver glucose output, which we don't control, and can't easily measure
ISF and IC should be more tightly coupled
Scott Leibrand
@scottleibrand
Sep 17 2016 00:04
@cjo20 I'm talking about a situation such as post-exercise sensitivity, where BG drops over time in the absence of carbs
that seems like pretty much the definition of "your basals are too high right now"
Chris Oattes
@cjo20
Sep 17 2016 00:08
APS effectively changes that by altering the target
Scott Leibrand
@scottleibrand
Sep 17 2016 00:09
yeah. with autosens, we can adjust the basal and ISF together as needed. we can't really affect IC ratio though
R. Dennis Steed
@rdsteed
Sep 17 2016 00:09

@elnjensen You are absolutely correct - it is not all about dimensional reduction. On the other hand, it is really nice check when your units are consistent at the end of a calculation. I'm guessing it is bad in astronomy when the calculating the distance to alpha centauri comes out in grams.

My point wasn't so much about the fact that size matters ;-), it was about the fact that in the individual it is fairly predictable how these various factors (which people treat as constants on a day to day basis) actually move in sync with one another.

Scott Leibrand
@scottleibrand
Sep 17 2016 00:10
@rdsteed what's your take on my intuition above about 20% increased sensitivity?
R. Dennis Steed
@rdsteed
Sep 17 2016 00:10
@scottleibrand Sorry, I was away for a bit, must have missed it.
Scott Leibrand
@scottleibrand
Sep 17 2016 00:12
"it appears that a 20% increase in sensitivity should correspond to a 20% decrease in basal needs, a 20% increase in ISF, and a 20% decrease in IC ratio."
R. Dennis Steed
@rdsteed
Sep 17 2016 00:12
@scottleibrand Ok - saw your 20% comment. That is exactly right.
Scott Leibrand
@scottleibrand
Sep 17 2016 00:13
:+1: thx
Chris Oattes
@cjo20
Sep 17 2016 00:13
There is a difference between those three things though. Two of them describe the reaction to an amount of insulin, the third is just an amount of insulin
Scott Leibrand
@scottleibrand
Sep 17 2016 00:14
I don't think that's right. the basal rate is supposed to be the amount of insulin required to keep your BG level, in the absence of carbs
and the IC ratio is supposed to be the amount of insulin required to return your BG to the same place it started after a meal of a certain size
R. Dennis Steed
@rdsteed
Sep 17 2016 00:18
@scottleibrand @cjo20 Although the relation between IC and ISF is intuitively modeled as a simple dilution, the basal requirement is more complex. However, empirically they move together.
Chris Oattes
@cjo20
Sep 17 2016 00:18
Basal requirement (U) = liver release (g) * IC (u/g)
Bolus required (U) = food intake (g) * IC (u/g)
Correction required (U) = change_required (BG) / ISF (BG / U)
The 20% change applies to the rightmost item in each of the 3 equations
Scott Leibrand
@scottleibrand
Sep 17 2016 00:20
so, I guess you're saying that changing all three by 20% only works if liver release is unchanged
Chris Oattes
@cjo20
Sep 17 2016 00:20
yes
Scott Leibrand
@scottleibrand
Sep 17 2016 00:20
when do you see it change significantly?
I don't think I've ever seen any evidence of it changing much
Chris Oattes
@cjo20
Sep 17 2016 00:21
I don't know, I can't measure it. I would be surprised if it was constant in the case where you've been doing exercise though, because your body is trying to re-stock muscles with energy
Scott Leibrand
@scottleibrand
Sep 17 2016 00:22
I would guess that liver release in that case is modulated by insulin levels: as BG drops from increased glucose uptake due to increased ISF, the pancreas releases less insulin, causing glucagon release and glucose release from the liver
Chris Oattes
@cjo20
Sep 17 2016 00:23
That's believable.
Scott Leibrand
@scottleibrand
Sep 17 2016 00:23
maybe @rdsteed knows if there's any research on whether the liver's glucose release varies over time independently of glucagon levels
R. Dennis Steed
@rdsteed
Sep 17 2016 00:23
Liver production actually changes all the time. When you are eating something with carbs, the liver starts sucking up carbs and storing it away as glycogen. Depending on glucagon, it can make proteins into glucose as well. When the liver's glycogen stores are maxed, the excess glucose gets made into fat. The body can't make fat back into glucose, but can make it into ketone bodies that can be used as an alternate fuel. And that is still over simplified.
Chris Oattes
@cjo20
Sep 17 2016 00:24
My gut feeling is that a 20% increase in sensitivity due to exercise will result in <20% reduction in basal requirements
R. Dennis Steed
@rdsteed
Sep 17 2016 00:24
What we can say is that at rest with the blood sugar stable in the normal range (about 100), the liver is putting out about 2 mg/kg/min.
At rest and not eating.
Scott Leibrand
@scottleibrand
Sep 17 2016 00:25
what accounts for variation in basal needs through the course of the day?
Chris Oattes
@cjo20
Sep 17 2016 00:26
insulin sensitivity changes. Hormone levels, adrenaline etc.
Scott Leibrand
@scottleibrand
Sep 17 2016 00:26
does the liver's production vary based on diurnal hormones? or do those hormones cause glucagon release?
R. Dennis Steed
@rdsteed
Sep 17 2016 00:27
Don't get me started on circadian rhythms vs diurnal rhythms. It's a whole new level of complexity.
Scott Leibrand
@scottleibrand
Sep 17 2016 00:28
heh
R. Dennis Steed
@rdsteed
Sep 17 2016 00:31
Anyway, in control theory, it's important not to try to put together models that are unidentifiable with the available information. Quantum effects are pretty much unimportant at the organism level.
What's important to realize, if your basal needs at breakfast are higher than other times of the day, then your carb coverage needs are similarly increased.
Chris Oattes
@cjo20
Sep 17 2016 00:36
Do you have any feel for how liver release changes when you aren't at rest?
R. Dennis Steed
@rdsteed
Sep 17 2016 00:38
@scottleibrand I apologize if I seem snarky or pedantic. Sometimes I think it is an occupational hazard with endos. Anyhow, the liver's production (or uptake of glucose) depends on many hormones besides insulin and glucagon, the concentrations of metabolites (not only carbohydrates, but amino acids and fatty acids as well), and direct neurological stimulation. And we're learning more about it all the time.
garykidd
@garykidd
Sep 17 2016 00:39
@scottleibrand not totally sure how your script setup works but it might be worth considering an easy way for folks to add cgm receiver for G5, for NS and maybe share either all together or be able to toggle easily. Nice script though.
Scott Leibrand
@scottleibrand
Sep 17 2016 00:40
@rdsteed no worries. Great input: very informative.
Chris Oattes
@cjo20
Sep 17 2016 00:41
Do you know ballpark figures for what happens to glucose release? If someone runs for 30 minutes, will it go up to 2.5mg/kg/min? or 10mg/kg/min?
(And yes, I realise it'll change based on a variety of factors, including exercise intensity, aerobic or anaerobic respiration etc.)
R. Dennis Steed
@rdsteed
Sep 17 2016 00:46
@cjo20 Good question. Unfortunately, the answer is "it depends". If you have carb loaded and your liver is full of glycogen, then the liver should crank out glucose as a fuel. However, if you get up and run before breakfast, the liver will crank out much less glucose as the body runs on alternate fuels (eg fat).
Chris Oattes
@cjo20
Sep 17 2016 00:47
I'm just trying to get an idea for what might be a sensible range
What range of mg/kg/min would count as "yeah, that's reasonable"?
R. Dennis Steed
@rdsteed
Sep 17 2016 00:53
@cjo20 I don't know off the top of my head.
Chris Oattes
@cjo20
Sep 17 2016 00:53
Ok :)
R. Dennis Steed
@rdsteed
Sep 17 2016 00:57

@cjo20 Just asked the Google. Check out this article - http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2269151/

It looks at trained cyclists using radioactive tracers.

garykidd
@garykidd
Sep 17 2016 01:30
I know its in the docs but I didnt understnad how to turn on Meal Assist?
Tim Mecklem
@tmecklem
Sep 17 2016 02:17
@ecc1 I got the SRF cc1110 breakout board working with openaps, thanks in part to your help.
Thanks again!
This is great. That srf board is tiny and it gets at least the range of the slice of pi with the srf premounted.
IMG_0989.JPG
Eric Jensen
@elnjensen
Sep 17 2016 03:11
@rdsteed said 'Good question. Unfortunately, the answer is "it depends". ' I often tell my students that that is the answer to almost every interesting question. :smile:
Eric Jensen
@elnjensen
Sep 17 2016 03:18
Nice to see the discussion of changing basal rates along with carb ratios. As part of gearing up for OpenAPS, I took a step back and looked carefully at my various settings in my pump. I had done a fair amount of basal testing so those rated were in decent shape (though I did smooth out a few spots to make it a more coherent 24-hour cycle), but my carb ratios for different meals had been set by some pretty ad hoc decisions I had made over time. Looking at them, I realized just what has just been discussed here, that if I need more basal insulin in the morning, I probably need more insulin per gram of carbs, too. So I shifted accordingly, and so far it has been working well. Hard to separate from other factors, of course, but it does all hang together.
@scottleibrand Thanks for the clarification on the Explorer board stacking. I had been wondering about combining it with the OLED board, but that won't work because that board only has one connector, too. But it looks like the I2c board could be an option, with a separate OLED attached.
Ryan Dalisky
@rdalisky
Sep 17 2016 03:22
Can someone lend me a hand with a report not working?
I'm trying to upload missing entries (specifically my medtronic enlite cgm records). The loop is running fine off the cgm (Yay!), but this report is outputting [].
[report "nightscout/recent-missing-entries.json"]
oper = format-recent-type
use = shell
reporter = JSON
device = ns
remainder = tz entries raw-cgm/glucose-nightscout.json
json_default = True
Therefore I'm getting no cgm readings in nightscout. All temp basals are showing!
To be clear the raw-cgm/glucose-nightscout.json that is called by the above report, it is working and is populated just fine.
Scott Leibrand
@scottleibrand
Sep 17 2016 03:38
@rdalisky check your NS entries API endpoint. That output indicates that the entries have already been uploaded. Maybe their format just isn't a match for what NS expects?
Ryan Dalisky
@rdalisky
Sep 17 2016 03:41
@tmecklem had me manually seed the report and then it uploaded fine. He said on both setups he has done he has had to do that first otherwise nightscout "didn't seem to know what to do with the records."
lmaguire
@lmaguire
Sep 17 2016 03:41
Hi there, I'm trying to upload treatments.json and recently/combined-treatments.json, but I cannot find the information to make the reports. Would anybody be able to quickly tell me what commands are in the reports?
Tim Mecklem
@tmecklem
Sep 17 2016 03:42
yeah, it’s like it didn’t know how to compare the local entries with <nothing> for the missing entries report. I’ve had to do that on both openaps nightscout installs I’ve done from scratch.
Maybe I missed a step or something. As soon as I seeded nightscout all was well.
Scott Leibrand
@scottleibrand
Sep 17 2016 04:05
Very well could be a logic flaw in the compare script. Anyone want to take on troubleshooting and fixing it? If nothing else should PR the "seeding" step into the docs.
Tim Mecklem
@tmecklem
Sep 17 2016 04:08
I could try to set up a new one tomorrow. I’ve got a new Edison install going, wouldn’t be too hard to set up another temporary nightscout instance
Mitchell Slep
@moomoobloo
Sep 17 2016 04:42
is there some option that will make openaps print out the command line it invokes?
Scott Leibrand
@scottleibrand
Sep 17 2016 04:53
Depends. For an alias, report, or what?
Mitchell Slep
@moomoobloo
Sep 17 2016 04:53
report i guess
actually for a use command
either would be helpful though
Scott Leibrand
@scottleibrand
Sep 17 2016 05:20
So there is openaps report show foo.json --cli
But sounds like you're looking for something deeper than that? I'd probably need specifics.
Mitchell Slep
@moomoobloo
Sep 17 2016 05:21
thanks, --cli is what i was trying to remember
Tim Street
@tim2000s
Sep 17 2016 10:57
Does oref0 use the sgv tend information when making a decision? I'm working out whether I need to pass that to my file from my 640g uploaded bg data.
*tend=trend
timomer
@timomer
Sep 17 2016 11:17
@danamlewis yes please that would be great, I'll PM you my email
garykidd
@garykidd
Sep 17 2016 14:02
any idea why when I am connected to my iphone is connected to RP3 via BT, and my hotspot is enabled, I don't have internet access?
Eric Jensen
@elnjensen
Sep 17 2016 14:12
@garykidd Do you have a data plan on your phone, or only wifi? For my iPhone, if you turn on the hotspot, it turns off the phone's wifi internet connection. It still uses wifi to connect to the hotspotted other machine, but doesn't use wifi to connect to the internet anymore, just uses cellular data. So unfortunately you can't use it to share a wifi connection.
Tim Street
@tim2000s
Sep 17 2016 14:37

getting an odd one with oref0-enacted.json - this is the error and the traceback:

Sep 17 15:31:16 raspberrypi openaps-loop: oref0-enacted/enacted-temp-basal.json  raised  type object argument after ** must be a mapping, not list
Sep 17 15:31:16 raspberrypi openaps-loop: pump://JSON/set_temp_basal/oref0-enacted/enacted-temp-basal.json
Sep 17 15:31:16 raspberrypi openaps-loop: Traceback (most recent call last):
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/bin/openaps-report", line 4, in <module>
Sep 17 15:31:16 raspberrypi openaps-loop:     __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
Sep 17 15:31:16 raspberrypi openaps-loop:   File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 743, in run_script
Sep 17 15:31:16 raspberrypi openaps-loop:   File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 1531, in run_script
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
Sep 17 15:31:16 raspberrypi openaps-loop:     app( )
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
Sep 17 15:31:16 raspberrypi openaps-loop:     self.run(self.args)
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
Sep 17 15:31:16 raspberrypi openaps-loop:     output = app(args, self)
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
Sep 17 15:31:16 raspberrypi openaps-loop:     return self.method.main(args, app)
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 40, in main
Sep 17 15:31:16 raspberrypi openaps-loop:     output = task.method(args, app)
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
Sep 17 15:31:16 raspberrypi openaps-loop:     output = self.main(args, app)
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 431, in main
Sep 17 15:31:16 raspberrypi openaps-loop:     results = self.upload_program(program)
Sep 17 15:31:16 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 523, in upload_program
Sep 17 15:31:16 raspberrypi openaps-loop:     return dict(error="missing required input fields", missing=missing, input=dict(**program))
Sep 17 15:31:16 raspberrypi openaps-loop: TypeError: type object argument after ** must be a mapping, not list

Any ideas what's going on here? My loop hasn't changed. My sgv upload data is coming from 640G without direction information.

PieterGit
@PieterGit
Sep 17 2016 14:38
i'm trying to debug the uploading of dexcom cgm to ns. I see
GRANTED: ::ffff:<<IP>> no-token api:entries:read default
DENIED: ::ffff:<<IP>> no-token api:entries:create
when I use a 'ns-upload-entries cgm/cgm-glucose.json'. Should I change anything to allow uploading CGM data. I checked the API_SECRET, but somehow uploading cgm does not work
Tim Street
@tim2000s
Sep 17 2016 14:39
Would it be possible that the medtronic.py script is trying to use the contour nextlink rather than the carelink to send the instruciton as I have both connected to the Pi3?
Tim Street
@tim2000s
Sep 17 2016 14:48
Ah - looks like a timing issue. Anyone any ideas about this one from oref0.json? My bg time is showing up as correct and so is the system time on the Pi, so I'm not sure where the incorrect time data is coming from.
[{"msg":"BG data is too old, or clock set incorrectly Sat Sep 17 2016 16:39:04 GMT+0100 (BST) vs Sat Sep 17 2016 15:43:10 GMT+0100 (BST)"}]
garykidd
@garykidd
Sep 17 2016 15:33
@elnjensen yeah I have data plan/ hotspot plan. My rpi3 is connected via wifi but can't seem to get internet access.
Tim Street
@tim2000s
Sep 17 2016 15:48
Ah - looks like a timing issue. Anyone any ideas about this one from oref0.json? My bg time is showing up as correct and so is the system time on the Pi, so I'm not sure where the incorrect time data is coming from.
[{"msg":"BG data is too old, or clock set incorrectly Sat Sep 17 2016 16:39:04 GMT+0100 (BST) vs Sat Sep 17 2016 15:43:10 GMT+0100 (BST)"}]
Ignore this - issue was the data being uploaded with an incorrect timezone.
Tim Street
@tim2000s
Sep 17 2016 15:56
Got it. My 640G enlite system is now speaking to nightscout using the RPi3, and OpenAPS is then looping based on that data pulled back from NS. Seems to be working quite nicely too!
Scott Leibrand
@scottleibrand
Sep 17 2016 17:30
Nice! Re: trend, we don't use the Dexcom "flat" "45up" etc. trend info do anything. Instead, we use the last 30m of glucose data to calculate them ourselves.
@tim2000s looks like you're still on oref0 master. Would be interested if the 640g as CGM source still works on oref0 dev.
The "missing" thing relates to a suggested.json that doesn't recommend any action. It's supposed to spit out which fields were missing (usually rate and duration in that case).
garykidd
@garykidd
Sep 17 2016 19:09
@tim2000s I thought 640g couldnt have temp basals enacted remotely?
Having an issue with BT hotspot...I can pair RP3 with my iphone (not easily) but once paired I cant get internet access on pi...is there something that I am missing?
Scott Leibrand
@scottleibrand
Sep 17 2016 19:19
@garykidd Tim's just using the 640g as a CGM. A 522 is actually delivering the insulin.
garykidd
@garykidd
Sep 17 2016 19:38
I almost figured that but wasnt sure. It'd be nice to get an insider to see if there's amy kind of secret key/back door to activate what MM disabled with newer pumps
maybe I should stick to my BT probelms...UFB. I've been at this for days...it kills you when the stuff that is supposed to be simple is so difficult.
Scott Leibrand
@scottleibrand
Sep 17 2016 21:29
Just updated the oref0-setup.sh script, and could use more testers: https://github.com/openaps/oref0/wiki/Setup-Script-Testing
Tim Mecklem
@tmecklem
Sep 17 2016 21:57
IMG_0997.JPG
Meet “Eddie” :)
Dana Lewis
@danamlewis
Sep 17 2016 21:58
:)
Tim Mecklem
@tmecklem
Sep 17 2016 21:59
He’s in one of those t:slim glucose tablet tins they gave away at events. My wife insisted that I get it to fit inside that particular tin :)
C-Ville
@C-Ville
Sep 17 2016 22:01
@tmecklem nice, looks like you got some of the last SRF boards out there
Tim Mecklem
@tmecklem
Sep 17 2016 22:01
yeah :(
Eric
@ecc1
Sep 17 2016 22:01
Is reception OK like that? I'd be worried about most of the antenna being inside the "Faraday cage"
Tim Mecklem
@tmecklem
Sep 17 2016 22:01
I’ve got three more that have the firmware flashed.
It seems to be doing okay. It worked with the lid on too, but that’s just asking for trouble.
Tim Street
@tim2000s
Sep 17 2016 22:02
@scottleibrand I need to pull D
own the dev line for that. I've had enough gotchas with the 640 data so far that I might give it a few days before I start the dev line working.
Looking forward to meal assist plus though...
Tim Mecklem
@tmecklem
Sep 17 2016 22:03
The wifi did surprisingly well with the lid closed too.
Tim Street
@tim2000s
Sep 17 2016 22:03
@garykidd Wi-Fi on my Rpi3 is shot. It won't connect to anything. The only ip address it comes up with is an 81...* Address which isn't on my network.
Tim Mecklem
@tmecklem
Sep 17 2016 22:04
I’d feel a lot better if the electronics were well attached to that plate. At least the SRF, it’s the weakest part. Can I hot glue it to the plastic?
Never done that before :)
I’ve got it semi-attached with wall tack right now.
I also decided to include that adafruit lipo charger so that it can charge the battery at 500mA
C-Ville
@C-Ville
Sep 17 2016 22:10
i am suprised that google does not lead a way to increase the charging current of the breakout board to a reasonable number. I think they say aomewhere that the current it is is by default programmed to 190 mA, but could in theory be set to higher values, question is how.....
Tim Mecklem
@tmecklem
Sep 17 2016 22:12
:shipit:
Now I need to figure out the dex communication part. I’ll use NS for now since NS acts as a Share client to get BG. We were using USB to get BG directly before.
I’ve been thinking about using and adapting some of the LoopKit frameworks to do BLE serial to the edison and keep from having to fuss with hotspots
Scott Leibrand
@scottleibrand
Sep 17 2016 22:30
@tim2000s have you tried running dhclient to renew your IP?
Eric
@ecc1
Sep 17 2016 23:51
@C-Ville This link (probably in response to @sulkaharo ?) shows the tiny SMT resistor one would have to change ... https://communities.intel.com/message/371113#371113
C-Ville
@C-Ville
Sep 17 2016 23:58
@ecc1 I thanks, I somewhere saw recommending changing this resistor, but this would not bump the charge current, only increase the time that you can charge if my understanding is correct