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

4th
Mar 2019
jaylagorio
@jaylagorio
Mar 04 00:29
@Ricco555 You might get faster help over in https://gitter.im/nightscout/public
Riko L
@Ricco555
Mar 04 06:21
thanks. wil try
lottainkeri
@lottainkeri
Mar 04 07:12
@scottleibrand no it didn't. It just stopped working suddenly. I presume it's a HW failure. I was able to get the BG values and everything in NS for an hour and then it died again.
JohnDoeAkira
@JohnDoeAkira
Mar 04 08:27
@scottleibrand thanks for the tip ! I thought that if I put a temporary basal on the pump, openaps would remove it to set its own temp basal. Does it work only when the temp basal is set on careportal or does is also work with temp basal on the pump itself.
boc-the-git
@boc-the-git
Mar 04 09:48
@Ricco555 did you have any luck with the openaps installation?
Jan Schenk
@jansche
Mar 04 09:51
@boc-the-git @Ricco555 experiencing the same problems with updating my rigs. The Edison is currently useless, I'm stuck. Any help is appreciated.
boc-the-git
@boc-the-git
Mar 04 09:52
I think there's a few of us in the same boat @jansche :(
If anyone is around who could guide me through any debugging steps (for the next hour), I'm happy to do so
Jan Schenk
@jansche
Mar 04 09:53
Re: nightscout autoconfigure-device-crud
So I better prepare the one working rig to be mobile (it's a stationary one), so I don't have to stop looping out of home...
boc-the-git
@boc-the-git
Mar 04 09:55
Yea, this last couple days has highlighted to me I need to sort out a backup
boc-the-git
@boc-the-git
Mar 04 10:24
So I'm a bit out of my depth in terms of the language, and my git knowledge is shamefully poor..
Is it possible that this change is what is causing us all so much grief with trying to install openaps for the last few days?
https://github.com/openaps/oref0/pull/1214/commits/c2cf86b6cc04d59f5a6ab2e61cc4360d4f7b1e0d
@scottleibrand my guesstimate is you're best placed to comment?
Riko L
@Ricco555
Mar 04 10:28
@boc-the-git Yes.. I managed to roll back to fd53d84, which works for me.
boc-the-git
@boc-the-git
Mar 04 10:32
Great!! So, showing my git ignorance, can you fill me in on what commands to run please @Ricco555 ?
Riko L
@Ricco555
Mar 04 10:39

Also being git noob I struggled to find the right commands to get the commit I want. so for you @boc-the-git this is what made me select the commit I want :

$ git checkout fd53d84
$ git reset --soft @{1}
$ git commit
$ npm run global-install

you have to be in src/oref0

boc-the-git
@boc-the-git
Mar 04 10:41
Thanks @Ricco555 ! I literally had just found the git reset command, and am currently in the global-install.. what I have done (not yet certain it works of course) is:
git reset --soft fd53d84
npm run global-install
OK, my option doesn't work, it makes me do a fast forward as part of oref0-runagain.. guessing it's due to the lack of git commit, so I'll try that next
Riko L
@Ricco555
Mar 04 10:56
before that above i made sure I am on latest dev (git checkout dev && git pull), then entered above
some expert may comment as I cannot say I understand git in full
Jan Schenk
@jansche
Mar 04 10:59
Not am expert but trying to reproduce what you just did @Ricco555. At of it is successful for me as well.
Jan Schenk
@jansche
Mar 04 11:04
Tells me "you're not currently in a branche"
boc-the-git
@boc-the-git
Mar 04 11:05
From ~/src/oref0 can you run git status? What is the output?
Jan Schenk
@jansche
Mar 04 11:05
Did a git checkout dev but without the pull after your bug fix commands to pull a different PR state
Currently it builds stuff through the setup script.
@boc-the-git your branch is up to date with origin/dev
And same again. Brakes at nightscout autoconfigure-device-crud
boc-the-git
@boc-the-git
Mar 04 11:08
OK, I would suggest now running the 4 commands posted by Riko (I haven't got mine working yet, so can't give my own advice)
Jan Schenk
@jansche
Mar 04 11:10
Ok. Had to also create a new branch by git checkout -b new-branch-name
I think that was the problem. Still building / installing.
Fails with "there's no tracking information for the current branch"
boc-the-git
@boc-the-git
Mar 04 11:16
I'm very much experimenting here.. I'll let you know if I get anywhere!
Jan Schenk
@jansche
Mar 04 11:16
Getting a step further with setting up tracking for the dev branch
git branch --set-upstream-to=origin/dev <branch-name>
Nope, still the same
boc-the-git
@boc-the-git
Mar 04 11:33
Yea, I've not yet managed to get anything where it won't do a fast forward in oref0-runagain - effectively taking me back to the buggy code
I'm guessing there's a git setting I need to change, because line 692 here is what will be killing me there: https://github.com/openaps/oref0/blob/dev/bin/oref0-setup.sh
boc-the-git
@boc-the-git
Mar 04 11:55
I tried using git config --add merge.ff false but it didn't do anything different for me.. so far I've not found a solution to it making me fast forward!!
Afraid I need to go to sleep - I'll try and have a look in the morning and see if I can make any progress. Do let me know if anyone has any solutions. Hope it works out @jansche
boc-the-git
@boc-the-git
Mar 04 12:21
So @jansche I didn't go to sleep.. think I've worked it out. My installation looks successful (though need to see a few loops to be certain)..
With your git branch command above, set origin/master rather than origin/dev
My hope is this has no knock on impact for Pi/HAT, assuming not
boc-the-git
@boc-the-git
Mar 04 12:30
FYI @TranceCake - sorry it's not neatly presented but the info above should help you!
Jan Schenk
@jansche
Mar 04 13:03
@boc-the-git I'll give it a try in a minute. Thanks for your help, and your sacrificed sleep!
Andy Sharrow
@dramageek
Mar 04 15:35
@JohnDoeAkira Normally it would, but not while the pump is suspended.
Scott Leibrand
@scottleibrand
Mar 04 15:36
@JohnDoeAkira OpenAPS won’t be able to set temps while the pump is suspended.
Hah, jinx.
Martin Haeberli
@mhaeberli
Mar 04 15:39

updating dev on an Edison rig this morning. Got this error during oref0-setup (interactive):

removed 154 packages and audited 362 packages in 25.436s
found 1 high severity vulnerability

just sayin'

also:
removed process://ns/nightscout/ns https://<redacted>-autotune.herokuapp.com <redacted>
Running nightscout autoconfigure-device-crud https://<redacted>
added process://ns/nightscout/ns NIGHTSCOUT_HOST API_SECRET
jq: error: Could not open file jq: No such file or directory
jq: error: Could not open file .extra.args |= sub(" API_SECRET " ; " <redacted> "): No such file or directory
Traceback (most recent call last):
  File "/usr/local/bin/openaps-import", line 89, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/bin/openaps-import", line 77, in run
    candidates = json.load(args.input)
  File "/usr/lib/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Could not run nightscout autoconfigure-device-crud
so I’ll try re-running oref0-setup but not optimistic
viq
@viq
Mar 04 15:48
@mhaeberli you didn't remove the second instance of your URL. You could try installing jq, it sounds like it's missing and I saw recently movement to replace calls to node json module with jq
Martin Haeberli
@mhaeberli
Mar 04 15:48
@viq - jq is not missing; just jq at command line gets help
thanks - i don’t understand ‘didn’t remove the second instance of’ my URL
viq
@viq
Mar 04 15:50
removed process://ns/nightscout/ns https://<redacted>-autotune.herokuapp.com <redacted>
Running nightscout autoconfigure-device-crud https:// [not redacted here]
Martin Haeberli
@mhaeberli
Mar 04 15:50
thx
thanks very much for the heads-up
viq
@viq
Mar 04 15:51
:+1:
Ah, then it sounds like something doesn't create the file that jq is expecting... But the above error message is not enough to figure that out, for me at least.
Martin Haeberli
@mhaeberli
Mar 04 15:54
it’s almost as if jq is trying to update an existing file; which one, unknown; the latest git pull I did this am updated autoconfigure-device-crud, I think. As an alternative, I’m trying to have it make a fresh myopenaps directory having backed up the old one… we’ll see how that turns out
wish list - I would like to be able to give a git branch hash to oref0-setup so I can easily go back a few releases, say, in the dev channel. Right now, the only trick I have figured out is to make my own fork in github (not so terribly hard to do, but still…), bring that FORK back to the version I want, and use that in my src/oref0 repository
same error
Martin Haeberli
@mhaeberli
Mar 04 15:58
to be clear, what I mean is that, the default oref0-setup.sh will always refresh the local git repository at src/oref0 . So if an update to dev breaks install, you have to do extra work to fall back to the previous known good release
Martin Haeberli
@mhaeberli
Mar 04 16:01
@viq - not clear that is the relevant segment - in that the ‘nogit’ stuff had to do with oref0 using git to store some loop state information ...
viq
@viq
Mar 04 16:01
ah, hm
Martin Haeberli
@mhaeberli
Mar 04 16:02
more like lines 689-696
viq
@viq
Mar 04 16:03
I'm not too familiar with OpenAPS setup, I use it only for autotune, or rather am working on using it for that.
Ah, indeed
Martin Haeberli
@mhaeberli
Mar 04 16:12
posted issue # 1219 re above
viq
@viq
Mar 04 16:13
And I'm close to having a patch that I think should fix that ;)
well, the wishlist thing
Martin Haeberli
@mhaeberli
Mar 04 16:14
very nice!
viq
@viq
Mar 04 16:15
Try it out, if it works for you I can create a merge request from it
Martin Haeberli
@mhaeberli
Mar 04 16:16
ok, thx; a variant would be to be able to specify a specific git checkout hash. But I like the new command line option!
can you remind me how to apply a patch file?
viq
@viq
Mar 04 16:17
patch -p0 -E < some.patch IIRC
Or, well, with git I guess it would be at least -p1
This is a "don't touch my git!" flag, so should let you have it also not complain about local changes.
Scott Leibrand
@scottleibrand
Mar 04 16:36
if you want you could also use git revert to revert individual commits (start with the most recent if you want to avoid conflicts), rather than checkout or reset.
once someone confirms which commit needs to be reverted to fix the problem, I'll do so on dev
Martin Haeberli
@mhaeberli
Mar 04 16:36
@scottleibrand thx; how does git revert interact with oref0-setup ?
Scott Leibrand
@scottleibrand
Mar 04 16:37
revert commits are new commits on top of dev, so you'll still be "up to date" (plus some)
Martin Haeberli
@mhaeberli
Mar 04 16:38
ok thx. btw, the ‘root cause’ of my need to run setup is a never-diagnosed ‘bluetooth rot’ where bt tethering fails and then running interactive setup is the only way to fix it; I -do- understand that the current recommended standard of care is to ‘just use wifi’ ...
(the only way -i- know) to fix it...
viq
@viq
Mar 04 16:38
Ah, you'll add to history, therefore "we're newer than upstream, so nothing to do here". On the other hand, getting back to being in sync with upstream will be annoying, won't it?
Scott Leibrand
@scottleibrand
Mar 04 16:39
@viq once we fix the issue, you'll be able to just git reset --hard dev to abandon all your new commits, including the reverts
viq
@viq
Mar 04 16:39
ah :+1:
viq @viq is still quite a n00b in git land
Martin Haeberli
@mhaeberli
Mar 04 16:41
:-) ‘I think even linus is quit a n00b in git land’ see also https://xkcd.com/1597/ and https://xkcd.com/1296/
viq
@viq
Mar 04 16:42
mmm, I heard people say that mercurial is easier to understand and makes more sense, and lamenting that git won with it
@mhaeberli I wonder if you could "just" extract the radio related commands from the setup script and run them, and see if that helps
TranceCake
@TranceCake
Mar 04 17:11
Plunge.PNG
had an interesting day :O
Today I learned that when Oaps has been trying to get me lower for over 3 hours I should not try to help it, not even a little..
Dana Lewis
@danamlewis
Mar 04 17:16
@TranceCake translate rage bolus behavior to rage temp target setting. Much safer
And you’re pushing a button so helps feel like you’re “doing something”
Sorry about the rough day!
TranceCake
@TranceCake
Mar 04 17:17
yeah I didn't view this as a rage bolus, I gave half the amount my bolus wizard suggested
ah np, had worse
viq
@viq
Mar 04 17:17
Yeah, I'm at time setting temp target of 99 to enable SMBs to let AAPS fight a high more aggresively
TranceCake
@TranceCake
Mar 04 17:18
you can see in the picture that my temps were maxed out for quite a while, should I do something about that?
I translate that as that it was not allowed to do enough to get me in range
Dana Lewis
@danamlewis
Mar 04 17:23
@TranceCake take a look at your logs and see what settings you bumped up against.
Scott Leibrand
@scottleibrand
Mar 04 17:26
and also look into whether you'd be comfortable starting to use SMBs
TranceCake
@TranceCake
Mar 04 17:34
I'm running for a week and a half, the docs state that that's too early ;) But I think I can handle SMB's. as for what Dana said, I'm pretty sure it's the current_basal_safety_multiplier that is limiting me here. My basal as per autotune was 0.780 . 0.780 x 4 = 3.12 u/hr and that was the limit it hit for ~2 hours
but smb's would not be limited by that since they use max_iob, which I did not hit by far
the loop did request a temp of 10u/hr at one point, that might be a bit harsh
With smb's enabled, does the loop usually manage to get you back in range quicker? (instead of the 3+ hours it took now)
Dana Lewis
@danamlewis
Mar 04 17:39
yes, once you've got your settings sorted, because it allows you to front shift the insulin activity
viq
@viq
Mar 04 17:39
@TranceCake more like "it can provide more downwards pressure from insulin earlier on", since getting a lot of IOB is risky due to the pretty long DIA
Jan Schenk
@jansche
Mar 04 17:41
@scottleibrand as @Ricco555 wrote, this fd53d84 is the last commit... with reverting to this in master it works for me.
TranceCake
@TranceCake
Mar 04 17:42
yeah, though I am a bit puzzled as to why it took so long for the loop to get aggressive. For the first 1.5 hours it kept me at .92u/hr which is less than it was allowed to give.
@jansche oh, then I'm going to try and see if it works for me 2!
Jan Schenk
@jansche
Mar 04 17:46
git checkout master
git checkout fd53d84
git checkout -b sht-fix
git reset --soft @{1}
git commit
npm run global-install
git branch --set-upstream-to=origin/master sht-fix
cd ~ && ./myopenaps/oref0-runagain.sh
this fixed it for me, though I'm on master now.
It's an Edison.
Dana Lewis
@danamlewis
Mar 04 17:49
@TranceCake no need to guess - go back and look at the logs or your OpenAPS pill in NS to see what it was calculating based on
TranceCake
@TranceCake
Mar 04 17:51
I just realized what it probably was: I had lunch just before that, so it was counting on that insulin to work
looking at the pill after dinner, brb :)
Scott Leibrand
@scottleibrand
Mar 04 18:04
@jansche so fd53d84 is the commit right before 2f742c6ec755cb66212c001d351365c059a83f32, which we reverted already in dev (via a2f37135dbc6492c750c0719ec0e6bae71648f07), but that didn't fix it. so we need to figure out which more-recent commit is the real problem. I think the way to do that would be to start with the most recent dev and revert individual commits until we find out which one fixes it
you could either keep adding on reverts until you fix the issue, and/or revert individual commits and then git reset --hard dev before reverting the next one
TranceCake
@TranceCake
Mar 04 18:06
@scottleibrand I started doing that the other day on dev but I had the issue that the install script pulls the latest commit regardless of what commit I checked out
I was wondering if there is a way around that?
Scott Leibrand
@scottleibrand
Mar 04 18:07
yeah, instead of checking out older commits, try reverting them
TranceCake
@TranceCake
Mar 04 18:07
oh, interesting
Scott Leibrand
@scottleibrand
Mar 04 18:07
revert commits are new commits on top of dev, so you'll still be "up to date" (plus some)
TranceCake
@TranceCake
Mar 04 18:07
let me check that out (no pun intended)
Scott Leibrand
@scottleibrand
Mar 04 18:08
heh
TranceCake
@TranceCake
Mar 04 18:09
@danamlewis yeah, it was the meal bolus just before that made all predictions think I would be in range. That's why it didn't go full right away. Smart loop :)
Dana Lewis
@danamlewis
Mar 04 18:10
@TranceCake also worth taking a look at your autotune since you're ~10 days in
TranceCake
@TranceCake
Mar 04 18:11
I'm a bit cautious with that still since I don't have it completely in my system yet to enter all carbs in the system, even when I don't need to bolus
although the suggestions it makes seem logical
Dana Lewis
@danamlewis
Mar 04 18:16
just keep in mind that's what OpenAPS is using for it's calculations
TranceCake
@TranceCake
Mar 04 18:17
yeah I know, I upload the data to nightscout regularly
Dana Lewis
@danamlewis
Mar 04 18:18
what I'm trying to say (in case you didn't know this): if you're using an OpenAPS rig, it is using the autotune profile as the base profile for all insulin dosing predictions and calculations
so if you're making manual predictions and thinking about a different set of settings than what autotune (and your OpenAPS rig) are, that may lead to some of the element of surprise re: why isn't it doing more/less/something else
TranceCake
@TranceCake
Mar 04 18:21
yeah I know, I meant by that that my nightscout is set to display my autotune profile and not the one in th pump, so I'm always basing it off nightscout
Dana Lewis
@danamlewis
Mar 04 18:22
k
viq
@viq
Mar 04 18:22
@TranceCake https://github.com/openaps/oref0/compare/dev...viq:patch-1 may help with "it wants to check out latest"
TranceCake
@TranceCake
Mar 04 18:22
thanks for thinking with me :)
ooh nice
viq
@viq
Mar 04 18:24
Also I have a WIP script for getting profile from nightscout in a format that OpenAPS understands
TranceCake
@TranceCake
Mar 04 18:25
I'm unsure how to check that one out, is it dev/viq/oref0?
but that won't help if I'm reverting things, does it?
TranceCake
@TranceCake
Mar 04 18:30
@scottleibrand if I checkout the latest dev, does that mean I am actually at 1213 (webpack) and I can go back by using git revert HEAD and git revert HEAD~1 after that?
or do I go back to 1216 if I do that?
viq
@viq
Mar 04 18:32
Well, it's a "don't touch my checkout" switch. I guess you may need to git checkout abcde && patch -p1 < notouchy.patch && ./bin/oref0-setup.sh each time
TranceCake
@TranceCake
Mar 04 18:33
how would I check out your branch?
isn't that a bit risky? that means it won't touch oref0-setup.sh even if it has changes in it which would mean I'm not really testing the commits as they are. I think I feel more comfortable testing with the revert option
viq
@viq
Mar 04 18:34
You could just download the patch to a file and apply that
TranceCake
@TranceCake
Mar 04 18:35
not sure what you mean by that :o
Dana Lewis
@danamlewis
Mar 04 18:37
@viq (not sure @TranceCake is a good tester for your profile branch re: autotune profiles since he's using an OpenAPS rig)
viq
@viq
Mar 04 18:37
It's just a diff, it can live independently of git, and can be applied independently of git
@danamlewis true, but on the other hand it does need some testing by people with OpenAPS to see whether it generates something close enough to real profile
Dana Lewis
@danamlewis
Mar 04 18:42
fair enough. (just might be confusing at this stage for debugging dev currently)
TranceCake
@TranceCake
Mar 04 18:43
yeah getting a little confused srry ':)
viq
@viq
Mar 04 18:43
Yeah, agreed
@danamlewis my inner chatbot got triggered by "I keep my NS profile in sync" ;)
Dana Lewis
@danamlewis
Mar 04 18:48
:)
I know. I have the luxury of sitting back and watching what each of ya'll are doing ;) and seeing that overlap start to happen with keyword matching ;) :)
TranceCake
@TranceCake
Mar 04 18:55
if only the pi0 would be fast :C
Dana Lewis
@danamlewis
Mar 04 19:00
for updating, or ?
if you plan to do dev, might be worth getting a Pi 3 or similar so you can load/do stuff on the sd card in that before popping it into the Pi0
TranceCake
@TranceCake
Mar 04 19:16
ooh, good idea
yeah I'm testing straight on the pi0
also, I'm doing a
git revert and then a
git reset <branch> and then
npm run global-install and after that the
oref0-setup.
is that enough or should I be deleting other stuff as well?
TranceCake
@TranceCake
Mar 04 19:38
I hope I'm doing this right, would be a shame if I missed something and can start over :P
Scott Leibrand
@scottleibrand
Mar 04 19:53
you don't want to git reset after git revert until you're ready to undo the revert and try something else
TranceCake
@TranceCake
Mar 04 19:55
yeah, that's what I'm doing now
srry I mixed them up, meaning I have been doing it right :)
Scott Leibrand
@scottleibrand
Mar 04 19:56
:+1:
TranceCake
@TranceCake
Mar 04 19:57
so you don't think it's necessary to do a rm -r /usr/local/bin/oref0 ?
Scott Leibrand
@scottleibrand
Mar 04 19:57
not sure. if you npm run global-install and it succeeds, definitely not. if you can't get that to work, you can try it.
TranceCake
@TranceCake
Mar 04 19:57
okay yeah that works every time
Jan Schenk
@jansche
Mar 04 20:49
Wanted to start a debugging session on the problematic commits, but my Pi setup still throws this at me:
npm ERR! cb() never called!
npm ERR! not ok code 0

npm ERR! oref0@0.7.0-dev global-install: `npm install && sudo npm link && sudo npm link oref0 && sudo npm install -g`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the oref0@0.7.0-dev global-install script.
npm ERR! This is most likely a problem with the oref0 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm install && sudo npm link && sudo npm link oref0 && sudo npm install -g
npm ERR! You can get their info via:
npm ERR!     npm owner ls oref0
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.14.98+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "run" "global-install"
npm ERR! cwd /root/src/oref0
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /root/src/oref0/npm-debug.log
npm ERR! not ok code 0
Anyone knows how to get rid of this problem, so I can start working on the other problem? ^^
TranceCake
@TranceCake
Mar 04 20:53
working my way back on the commits to try and pinpoint where it was introduced
I'm planning on enabling smb's tomorrow I think, anything i should watch out for (apart from reading the docs again) I was wondering if it might be good to set a higher target bg to start with maybe?
Dana Lewis
@danamlewis
Mar 04 20:57
@TranceCake +1 for a higher target to start, and follow the docs about usual behaviors with SMB enabled before you change any behaviors
Scott Leibrand
@scottleibrand
Mar 04 20:58
yeah, a higher target BG to start is a good approach. be aware that if you do a full bolus up front for meals, it may zero temp for awhile until it sees a rise. one of the behaviors you'll eventually want to change is to do a partial meal bolus and let it do SMBs for the rest as needed, unless you're eating something you know makes you spike high.
TranceCake
@TranceCake
Mar 04 20:58
yeah like timing the boluses and carb entering, gonna gibe them a good read
will do
Dana Lewis
@danamlewis
Mar 04 20:59
:heart_eyes: <-- me, every time someone says they'll read the docs :laughing:
Abigail Cember
@acember
Mar 04 21:04
If I understand correctly, a change to Bolus Wizard's carb ratio setting will be read by the rig each time it does a "pump profile refresh", right?
TranceCake
@TranceCake
Mar 04 21:04
I missed some stuff when I started and got a heartfelt message from cluckj 'please please pleaaaaase read the docs' x)
@acember yeah it should, I think, but I'm not sure if it won't be overwritten by autotune
Abigail Cember
@acember
Mar 04 21:07
@TranceCake Yeah, this is exactly what I was worried about. I think I'm just going to turn autotune off...
viq
@viq
Mar 04 21:08
Something that's been working well for me recently is "eating soon" about 30-45 minutes before eating, about a third of insulin I expect to be needing as I go to eat, so about 10-15 minutes before eating, and then using AAPS calculator to bolus for carbs as I eat
TranceCake
@TranceCake
Mar 04 21:08
is autotune giving the wrong numbers?
Abigail Cember
@acember
Mar 04 21:10
@TranceCake No, autotune is behaving reasonably-- but it only runs once every 24 hours and appears to be based on the logic that your carb ratio doesn't change drastically from time A to time B.
Dana Lewis
@danamlewis
Mar 04 21:10
@acember you can run autotune manually if you want it to run sooner than 4am
(also fine if you want to disable, just making sure you knew that ^)
TranceCake
@TranceCake
Mar 04 21:10
I think it's true that the loop uses one fixed carb ratio right?
Dana Lewis
@danamlewis
Mar 04 21:11
@TranceCake for OpenAPS predictions yes with atutoune it uses the one ratio it tunes. however, you can do manual meal boluses still with multiple carb ratios per your bolus wizard settings
Abigail Cember
@acember
Mar 04 21:13
@danamlewis Yeah, I was thinking about whether that would help. What I'm trying to do is figure out the minimal-work (i.e. existing code) way to effectively recalculate sensitivity, carb ratios, etc. on a more frequent basis than 24 hours. For example, if I want to run autotune with only a specific time window taken into account (i.e. the last four hours), can I do that?
Obviously that doesn't make sense for basal rates -- it's only for carb ratio and correction factor.
[read docs] Maybe it's really autosens, not autotune, that I need to be running manually...
But it looks to me like the current "autosens" code purposely doesn't take into account reactions to food
Dana Lewis
@danamlewis
Mar 04 21:17
yea, it can't separate what's carbs vs. just noise from everything else. you could run autotune on the last day and just look at basals for those hours? or you're saying you want to do carb ratio based on those 4 hours only?
we've not done multi-CR for autotune because we haven't had anyone with a deep enough understanding of that need AND willing to stick around and help test/work through it - sounds like you're serious enough about it?
TranceCake
@TranceCake
Mar 04 21:19
I'm going to bed soon, I have gotten to commit a85727c, which is 4 commits above the one I'm running on my main rig currently which did work back in february. So I expect to be able to pinpiont the commit tomorrow.
Dana Lewis
@danamlewis
Mar 04 21:19
@TranceCake thank you so much for working on helping run it down! much appreciated.
TranceCake
@TranceCake
Mar 04 21:20
yeah np, it's in my own interest as well so glad I can contribute :)
Abigail Cember
@acember
Mar 04 21:25
The short answer is yes :) But let me tell you more what I have in mind: I think when you say "multi-CR", you mean something like "At 9am my carb ratio is 1:10, at 12pm it's 1:15", etc. But what I'm ideally envisioning is dynamic (i.e. every two or three hours) recalculation of carbohydrate absorption sensitivity. (This could make use of a lot of user input about activity, too.) What I do "manually" is try to keep track of what fraction of glycogen stores I have or don't have, based on carb consumption during recovery from workouts. But the problem is that it's actually very difficult to get from knowing this to predicting how well I'll actually absorb the carbs. Doing the calculations in your head (i.e. "in the past two hours I've been able to absorb 100g of carbs with 2.0 units of insulin, but now my sensitivity is falling off, so now I probably need a 1:30 ratio", etc.) is almost impossible.
Dana Lewis
@danamlewis
Mar 04 21:26
huh interesting :) I'll ping @scottleibrand in at some point, because I can't remember if he had an issue already written with a 'how we might do multi CR', so in either case he can re-emphasize how that might match or not what your expectations are
Abigail Cember
@acember
Mar 04 21:27
What happened last night is a good example of why I'm weary of using autotune: autotune thinks my ratio is 1:11 -- which is perfectly reasonable if I'm already back at ~80-90% recovery. But I was probably only at about 60% when I went to sleep, and it gave me a bunch of SMBs that I didn't need and I ended up going low.
Dana Lewis
@danamlewis
Mar 04 21:27
i'd be curious to look at your autosenstivitiy & how it responds there, too
Abigail Cember
@acember
Mar 04 21:27
Whereas, what I'm thinking about doing is disabling autotune when I'm running a carb deficit, and just setting bolus wizard to something safer, like 1:25.
Dana Lewis
@danamlewis
Mar 04 21:27
the other thing we're looking at is doing a weighted average autosens (similar to the option AAPS has), instead of just 8 and 24 hour timeframes
I think the weighted average autosens may also help more in the scenario you're describing
Abigail Cember
@acember
Mar 04 21:28
Yeah, the really tricky thing is deciding what timeframe is relevant.
viq
@viq
Mar 04 21:29
@danamlewis you hit more of my keywords ;) I'd love to be able to run different autosens algorithms independently, "on the side" so to say, so I guess from nightscout data, and graph the output of them (for example by sending the number to InfluxDB)
Abigail Cember
@acember
Mar 04 21:29
Because for something like getting sick, 24 hours probably does make more sense. For exercise recovery, it could be anywhere from 4 to 36 hours, depending on what you did and what you ate.
Dana Lewis
@danamlewis
Mar 04 21:29
@viq :confetti_ball: this is a good place for the simple simulator too to test different configurations
viq
@viq
Mar 04 21:30
simulator?
Dana Lewis
@danamlewis
Mar 04 21:30
the most written up about it is in my ADA presentation from last year: https://diyps.org/2018/06/23/presentations-and-poster-content-from-danamlewis-at-2018ada (scroll down to the presentation part)
Abigail Cember
@acember
Mar 04 21:30
@danamlewis To answer your question, I think I screw up autosens because I eat so often :/
Dana Lewis
@danamlewis
Mar 04 21:33
would you be open to sharing some of your data to test in the simulator with some of the things we're talking about testing, and see if it predicts an improvement?
Abigail Cember
@acember
Mar 04 21:33
I am always open to sharing data!
viq
@viq
Mar 04 21:33
I'm also watching this discussion with interest, since I seem to have much higher ISF during night than during day
Abigail Cember
@acember
Mar 04 21:34
@viq Yeah, mine is drastically different. I don't know if you do any sports, but I attribute this to the fact that glycogen is restored at a higher rate while you're sleeping.
viq
@viq
Mar 04 21:36
@acember not as much as I'd want / "should", though I generally walk both ways the 2km to work, and try to go swimming at least once a week (usually do about 2.4km in an hour). So far I've been running with ISF of 55 mg/dL/U during day, and 100 during night
Though I still need to figure out why my BG is climbing later in the afternoon to plummet in the early evening
Abigail Cember
@acember
Mar 04 21:37
@viq Hm. My guess is that walking to work is not burning a lot of muscle glycogen...
viq
@viq
Mar 04 21:37
No, it's not.
But it's still helping.
Abigail Cember
@acember
Mar 04 21:38
@danamlewis The academic in me is looking at that poster and liking the idea of mapping autosens calculations to activity level and glycogen restoration post-exercise...
Dana Lewis
@danamlewis
Mar 04 21:39
@acember oh yea, would be interesting for you to do an n=1 (or at least figure out a good protocol) for what/how to map, then we can get a few others to do as well to coorelate better w/ exercise
that's one of the kinds of things I was hoping people would be inspired to do
Scott Leibrand
@scottleibrand
Mar 04 21:39
why do you think it's your ISF and not your basals that vary over the course of the day?
Abigail Cember
@acember
Mar 04 21:40
@danamlewis That would be awesome. I keep really close track of my mileage, carbohydrate intake, etc. (And my BGs are still a wreck :/ )
Scott Leibrand
@scottleibrand
Mar 04 21:40
or I guess I should say: wouldn't we represent the diurnal variation in sensitivity as a change in net basal insulin needs, in addition to (or possibly instead of) a change in ISF (correction factor)?
Abigail Cember
@acember
Mar 04 21:41
@scottleibrand Yeah, I agree. I don't think @viq and I were talking about "correction factor" so much as overall sensitivity to insulin, captured in whatever variable.
Scott Leibrand
@scottleibrand
Mar 04 21:42
k. given that we're using a net IOB model and not a gross IOB one, I think basal insulin needs is the place to start first.
if necessary you could also adjust ISF proportionally to basals, as we do with autosens, but I bet you could capture nearly all of the variation without even doing that.
viq
@viq
Mar 04 21:42
I do mean "correction factor" - 1u of insulin during night I think drops me much more than 1u during day. But, for now I just modified my profile to have single ISF and will see what happens.
Abigail Cember
@acember
Mar 04 21:42
@scottleibrand I personally always recalculate to "gross" (absolute) IOB, btw. Just noting.
Scott Leibrand
@scottleibrand
Mar 04 21:43
since most of the time you're not doing big correction boluses when closed looping, the rig's estimate of how close you are to "neutral" - zero net IOB, has a bigger impact than its estimate of your ISF
viq
@viq
Mar 04 21:43
And while I'm quite certain of my daytime ISF of around 55-57, autotune seeing my walks and my nights suggests something in the 80s
Scott Leibrand
@scottleibrand
Mar 04 21:44
autotune adjusts ISF mostly based on times when net IOB is more than 50% of gross IOB, which tend to be after correction boluses or after meals that have fully stopped absorbing with residual IOB
ISF is the hardest thing to accurately tune, by far, since that combination of conditions is so infrequent while looping
you can be far more confident in its estimate of CR and overnight basals
viq
@viq
Mar 04 21:46
But I am fully aware that this may be a case of PEBKAC, since I started tuning only a couple months back, and don't have that much experience or knowledge about it all
Scott Leibrand
@scottleibrand
Mar 04 21:47
@acember one thing you should try is setting a high temp target (with "exercise_mode": true) when you know you're running sensitive. that will override autosens and adjust your sensitivityRatio proportional to how high of a temp target you set
viq
@viq
Mar 04 21:48
Maxed out at 140, IIRC?
Scott Leibrand
@scottleibrand
Mar 04 21:49
and high targets will also be used by autosens to add in artificial negative deviations, so running a high target during or after exercise will help nudge autosens along to doing the right thing, even if you're eating and it doesn't have good clean data to re-estimate on its own
Abigail Cember
@acember
Mar 04 21:49
@scottleibrand Temp target will adjust sensitivity? That is very useful. I thought it was only the other way around, based on the variable name 'sensitivity_raises_target' ... does that have to be set to true in order for that to work, btw?
Scott Leibrand
@scottleibrand
Mar 04 21:50
no, they're independent, except that exercise_mode overrides when a high target is running
Abigail Cember
@acember
Mar 04 21:50
Oh, OK. So I'm going to leave that as 'false'. In terms of exercise_mode -- I thought that refers only to when you are actually exercising, no?
Scott Leibrand
@scottleibrand
Mar 04 21:51
@viq lib/profile/targets.js: target.min_bg = Math.min(200, target.min_bg);
I think that's the only limit on how high you can set temp targets
viq
@viq
Mar 04 21:51
Oh, huh, AAPS didn't let me set higher than 180 IIRC
Scott Leibrand
@scottleibrand
Mar 04 21:51
AAPS has its own UI limits
@acember you can and should use it during exercise that makes you more sensitive, but you can also use it afterward (with a not-so-high but longer target, probably) if autosens isn't picking up on sensitivity fast enough
lib/profile/index.js: , high_temptarget_raises_sensitivity: false // raise sensitivity for temptargets >= 101. synonym for exercise_mode
if it makes you feel better to call it high_temptarget_raises_sensitivity that also works. ;-)
viq
@viq
Mar 04 21:53
Ah, I just set it to 210 for a moment, nevermind
Scott Leibrand
@scottleibrand
Mar 04 21:53
oh, there is also a limit on sensitivityRatio: autosens_min and autosens_max
viq
@viq
Mar 04 21:54
OK, time to call it a night for me, I'll just tell you that you do amazing things that help a lot of people :)
Scott Leibrand
@scottleibrand
Mar 04 21:54
so setting a 200 probably does the same as setting a 140 in terms of setting sensitivityRatio, unless you widen those caps
(sets it to 0.7, aka 70% of normal basal)
Abigail Cember
@acember
Mar 04 21:55
@viq This chatroom can get addicting! Sweet dreams!
@scottleibrand I generally don't wear my Dexcom while running, but using an "exercise mode" temp target for several hours after my long run is a genius idea. The thing I like best about this is that I can raise it or lower it dynamically as I see myself recovering. I totally didn't realize that this was a dynamic sensitivity adjuster...
That way I can let autotune do its thing, but manually override it when I know that its currently value will be wrong.
Dana Lewis
@danamlewis
Mar 04 21:59
yes, it makes a huge difference!
Abigail Cember
@acember
Mar 04 22:00
Ok, so time for the technical question: if in preferences.json I have "exercise_mode": true, but "sensitivity_raises_target": false, does that work? Or do I need to have that second variable set to "true" also?
Scott Leibrand
@scottleibrand
Mar 04 22:01
those are also the converse of each other, so they're also independent
Dana Lewis
@danamlewis
Mar 04 22:01
once you get used to those settings - I can set a 110 instead of how i'd have to set a 150 before, so keep in mind you'll have to figure out what works well for you compared to before
Abigail Cember
@acember
Mar 04 22:01
Ok, cool. I'm on the fence about whether to turn on that second one, too.
Scott Leibrand
@scottleibrand
Mar 04 22:01
if autosens detects sensitivity, and no target is running, that preference will make it raise the target, say from 100 to 110, to give you some additional buffer when running sensitive
conveniently, having both on means that you always get the same SR for the same target
Abigail Cember
@acember
Mar 04 22:03
And what about the converse: if I set a Temp Target to 80 (lower than usual), will that raise my sensitivity ratio? (Like, is there an "opposite from exercise" mode?)
Scott Leibrand
@scottleibrand
Mar 04 22:03
yes, that's another independent preference
"low_temptarget_lowers_sensitivity": true,
and to round out the foursome: "resistance_lowers_target": true,
Abigail Cember
@acember
Mar 04 22:04
the latter two of which are basically equivalent, right?
Scott Leibrand
@scottleibrand
Mar 04 22:04
nope, they're converse
target -> sensitivity vs. sensitivity -> target
Abigail Cember
@acember
Mar 04 22:05
Oh oh, I see.
Resistance_lowers_target is for autosens data input effectively causing a temp target -- is that right?
Scott Leibrand
@scottleibrand
Mar 04 22:05
right, a target below 100
Abigail Cember
@acember
Mar 04 22:06
LOL, I'm going to type that variable into my preferences just so that I remember it exists.
Scott Leibrand
@scottleibrand
Mar 04 22:06
heh ya, good plan
Abigail Cember
@acember
Mar 04 22:08
Ok, I am excited to see how this works. Especially on top of my attempts to figure out the glycogen-loading/insulin sensitivity relationship (at which I actually don't think I'll succeed without the help of real computations).
Unfortunately, there are all these other stupid factors like cortisol, etc :[
@danamlewis I definitely want to help out with whatever I can, at least providing data of all sorts. Can you PM me when you get a chance and tell me a little more about these "dev" (in the conceptual sense) undertakings?
Scott Leibrand
@scottleibrand
Mar 04 22:14
FWIW, another reason we haven't gotten very far with CR (much less ISF) schedules is that most people who think they need them decide it's not worth the trouble once they figure out all the other knobs they can turn to accomplish what they want. ;-)
so I wouldn't be surprised if you end up in a similar place with regards to temp targets and sensitivityRatio being "good enough"
Abigail Cember
@acember
Mar 04 22:38
To be honest, I think "sensitivity ratio" is the only real parameter -- all this blabber about carb ratios, correction factors and basal rates are fictional structures that endocrinologists made up to have a conceptual framework for treating diabetic people with primitive technology. (That's my two cents of unsolicited philosophy for the day. )
Thank you guys for the help!
Scott Leibrand
@scottleibrand
Mar 04 22:40
lol, I largely agree with that philosophy. :-)