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

3rd
Nov 2018
djnoor
@djnoor
Nov 03 2018 03:09
I have another problem. I'm able to loop but Autotune doesn't work. When I try to run it manually, it fails with the following error:
oref0-autotune --dir=~/myopenaps --ns-host=https://$HOSTNAME
Running oref0-autotune --dir=/root/myopenaps --ns-host=https://$HOSTNAME --start-date=2018-10-31 --end-date=2018-11-01 --categorize-uam-as-basal=false
Compressing old json and log files to save space...
Autotune disk usage:
80K     .
Overall disk used/avail:
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       1.4G  624M  692M  48% /
Grabbing NIGHTSCOUT treatments.json and entries/sgv.json for date range...
Query: https://$HOSTNAME find%5Bdate%5D%5B%24gte%5D=1540976400000&find%5Bdate%5D%5B%24lte%5D=1541062800000&count=1000
-rw-r--r-- 1 root root 85 Nov  2 22:11 ns-entries.2018-10-31.json
Query: https://$HOSTNAME/find%5Bcreated_at%5D%5B%24gte%5D=2018-10-30T06:00-0500&find%5Bcreated_at%5D%5B%24lte%5D=2018-11-01T18:00-0500
-rw-r--r-- 1 root root 85 Nov  2 22:11 ns-treatments.2018-10-31.json
oref0-autotune-prep ns-treatments.2018-10-31.json profile.json ns-entries.2018-10-31.json profile.pump.json  > autotune.2018-10-31.json

/home/.rootfs/usr/local/lib/node_modules/oref0/lib/autotune-prep/categorize.js:22
        var glucoseData = opts.glucose.map(function prepGlucose (obj) {
                                       ^
TypeError: Object #<Object> has no method 'map'
    at categorizeBGDatums (/home/.rootfs/usr/local/lib/node_modules/oref0/lib/autotune-prep/categorize.js:22:40)
    at generate (/home/.rootfs/usr/local/lib/node_modules/oref0/lib/autotune-prep/index.js:24:30)
    at Object.<anonymous> (/home/.rootfs/usr/local/lib/node_modules/oref0/bin/oref0-autotune-prep.js:110:27)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
Could not run oref0-autotune-prep ns-treatments.2018-10-31.json profile.json ns-entries.2018-10-31.json
Scott Leibrand
@scottleibrand
Nov 03 2018 03:51
Looks like your NS hostname is wrong or something. Those files are 85 bytes, which indicates an error retrieving the info.
djnoor
@djnoor
Nov 03 2018 12:48
That NS hostname is correct. However, it's an editable setup protected by an API secret. I also setup a different URL with a Nightscout token that enables read-only access to the site.
Does Autotune write data to Nightscout or only read it? Does it matter which URL that I use? How do I give Autotune an API_Secret?
djnoor
@djnoor
Nov 03 2018 12:55
Does Autotune not just use the API_Secret I gave the setup script. I know OpenAPS is able to write data to NS because when I enter carbs and insulin into my pump the rig gets the data through XdripAPS, uses it for looping, and sends it to NS.
djnoor
@djnoor
Nov 03 2018 14:34
@scottleibrand So why would Autotune not work on the same principle?
I followed the instructions here (https://openaps.readthedocs.io/en/latest/docs/Customize-Iterate/autotune.html) to set my hashed API_SECRET as an environment variable. Now when I try to autotune manually I'm getting a different error.
oref0-autotune --dir=~/myopenaps --ns-host=$HOSTNAME --start-date=2018-10-31
Running oref0-autotune --dir=/root/myopenaps --ns-host=$HOSTNAME  --start-date=2018-10-31 --end-date=2018-11-02 --categorize-uam-as-basal=false
Compressing old json and log files to save space...
Autotune disk usage:
132K    .
Overall disk used/avail:
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       1.4G  637M  679M  49% /
Grabbing NIGHTSCOUT treatments.json and entries/sgv.json for date range...
Query: $HOSTNAME  find%5Bdate%5D%5B%24gte%5D=1540976400000&find%5Bdate%5D%5B%24lte%5D=1541062800000&count=1000
-rw-r--r-- 1 root root 0 Nov  3 09:35 ns-entries.2018-10-31.json
Query: $HOSTNAME /find%5Bcreated_at%5D%5B%24gte%5D=2018-10-30T06:00-0500&find%5Bcreated_at%5D%5B%24lte%5D=2018-11-01T18:00-0500
-rw-r--r-- 1 root root 0 Nov  3 09:35 ns-treatments.2018-10-31.json
oref0-autotune-prep ns-treatments.2018-10-31.json profile.json ns-entries.2018-10-31.json profile.pump.json  > autotune.2018-10-31.json
Could not parse input data:  [SyntaxError: Unexpected end of input]
oref0-autotune-core autotune.2018-10-31.json profile.json profile.pump.json > newprofile.2018-10-31.json

/home/.rootfs/usr/local/lib/node_modules/oref0/lib/autotune/index.js:48
    CRData.forEach(function(CRDatum) {
           ^
TypeError: Cannot call method 'forEach' of undefined
    at tuneAllTheThings (/home/.rootfs/usr/local/lib/node_modules/oref0/lib/autotune/index.js:48:12)
    at Object.<anonymous> (/home/.rootfs/usr/local/lib/node_modules/oref0/bin/oref0-autotune-core.js:60:27)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
false
Could not run oref0-autotune-core autotune.2018-10-31.json profile.json profile.pump.json
Scott Leibrand
@scottleibrand
Nov 03 2018 14:53
Are you redacting that output? Or does it literally say $HOSTNAME ?
djnoor
@djnoor
Nov 03 2018 14:58
The only change I made to the output was replacing my real Nightscout hostname with $HOSTNAME
I saw other people do that for security
lottainkeri
@lottainkeri
Nov 03 2018 15:35
Hi all, I have started looping few days ago and was just wondering if remote bolusing is possible? We're using Medtronic 522 + edison
Dana Lewis
@danamlewis
Nov 03 2018 16:49
@lottainkeri no. Most people switch over to using SMB
Scott Leibrand
@scottleibrand
Nov 03 2018 17:01
@djnoor ok, gotcha. Is that NS hostname accessible from a browser without an API secret?
djnoor
@djnoor
Nov 03 2018 17:02
@scottleibrand No it's not.
I did setup a viewing token though
@scottleibrand Also, I just change the setting to make the site readable without a token and ran autotune manually and now it's working.
Scott Leibrand
@scottleibrand
Nov 03 2018 17:03
I don’t use tokenauth, so I can’t help with that. If you haven’t already I would set your NS to readable and confirm it works first before trying to add security.
Heh good
djnoor
@djnoor
Nov 03 2018 17:22
Based on reading the docs, it seems like there should be a way to make autotune use the api_secret or a token but I can't figure it out. Not a big deal. At least it's working now.
Does autotune actually adjust the pump's settings or just make recommendations?
Dana Lewis
@danamlewis
Nov 03 2018 18:01

@djnoor yes it could be done; someone just needs to do the work. :smile:

It makes a new profile, and in OpenAPS will use that for making the dosing decisions. If your rig fails though, you go back to pump basals.

djnoor
@djnoor
Nov 03 2018 18:06
@danamlewis Ok, thanks. Wow, what amazing software!
@danamlewis @scottleibrand Thanks so much for all your work on OpenAPS and your willingness to help newbies!
Martin Haeberli
@mhaeberli
Nov 03 2018 18:13
how do I keep pushovers for carbsreq but disable pushovers for microbolus reporting?
Scott Leibrand
@scottleibrand
Nov 03 2018 18:23
Upgrade to dev? ;-) Only carbsReq pushovers are enabled by default now.
Martin Haeberli
@mhaeberli
Nov 03 2018 18:23
:+1:
Dana Lewis
@danamlewis
Nov 03 2018 18:26
@djnoor 😊
lottainkeri
@lottainkeri
Nov 03 2018 18:29
@danamlewis So it means I need to update from oref0 to oref1. Thanks for the reply!
Dana Lewis
@danamlewis
Nov 03 2018 19:33
@lottainkeri :+1:
Martin Haeberli
@mhaeberli
Nov 03 2018 19:38
@scottleibrand upgraded to dev but still seem to be getting SMB pushovers. What am I missing?
alimhassam
@alimhassam
Nov 03 2018 19:58
@mhaeberli those are probably sent by NS I think
Martin Haeberli
@mhaeberli
Nov 03 2018 19:58
thx
Jon Cluck
@cluckj
Nov 03 2018 20:17
@djnoor what does ~/myopenaps/pump.ini say when you install dev?
I think I found your bug
I just did an install, and setup did not store the pump's serial number there (where it should have)
Martin Haeberli
@mhaeberli
Nov 03 2018 20:21
even though max-iob is set to 8, the largest temp basals we see are about 4 u / hr. Just doubled max-iob to 16. anything else we need to think about for higher temp basals when (very) high?
running w/smb on
Dana Lewis
@danamlewis
Nov 03 2018 20:31
@mhaeberli look at the logs to see why. Probably things like safety multipliers are also capping
djnoor
@djnoor
Nov 03 2018 20:33
@cluckj I no longer have Dev installed on my Edison Rig as I reflashed it and reinstalled Master. So I'd have to reflash Dev to test it and I don't have a spare rig at the moment.
Martin Haeberli
@mhaeberli
Nov 03 2018 20:33
@danamlewis thx
djnoor
@djnoor
Nov 03 2018 20:37
@cluckj I'm planning to order another rig soon, so I can test it in a couple weeks if it's not urgent, or sooner with my existing rig.
Jon Cluck
@cluckj
Nov 03 2018 20:43
it's not urgent at all :)
Nolan322
@Nolan322
Nov 03 2018 21:42
Could someone please help me? I've started switching from API Secret to token. I have only done this for one of two NS sites for my boys. How do I get Nightscout DUO watchface to work again now that I've changed to token based auth?
djnoor
@djnoor
Nov 03 2018 21:48
@cluckj Ok, ordered a 2nd rig and will test it out when it comes.
PieterGit
@PieterGit
Nov 03 2018 22:01
@Nolan322 I don't know of the nightscout DUO watchface, but I know not all watch faces support token based authentication. I changed to xdrip plus and AndroidAPS to use the xdripplus watch faces
Nolan322
@Nolan322
Nov 03 2018 22:07
@PieterGit the nightscout duo watchface is the only one available that show's two different bg's at the same time. I have two kids with t1, so I really need it. I think i'll try to just switch back to api secret instead of token based. thank you!
Dana Lewis
@danamlewis
Nov 03 2018 23:38

Reminder - Time change info (as far as we know)

There are two different ways to deal with a time change. Yay for choices!

Option A:
Do nothing. At 3am, the clock will shift back to 2am, and the rig will re-set the clock on your pump and any connected CGM receiver. You will not loop during the do-over hour. At the second 3am, you will resume looping. Tada! You’re good to go.

(Why won’t you loop during the do-over hour? Because there will be a record already on your pump of that hour, and you can’t delete that data from your pump, which is what the rig reads.)

Option B:
If you don’t want to have your non-looping do-over-hour overnight…you can change the time zone on your rig to one that doesn’t have daylight savings time (i.e. if you live on the west coast of the US, choose Arizona time). This means your clocks will not change automagically overnight, and you can wait and change the timezone on your rig at a later time. (Details here on how to manually change your timezone: https://openaps.readthedocs.io/en/latest/docs/Customize-Iterate/usability-considerations.html#what-do-you-do-with-your-loop-when-you-travel-across-timezones-how-do-you-update-devices-for-a-time-zone-change)

Summary:

  • Do nothing => option A – automagic (but you won’t loop for an hour overnight).
  • Want to control which hour you don’t loop? => Option B, setting your time zone to a non-DST time zone, and change it again at a later time of your choosing.