Skip to content

Commit

Permalink
Master to dev after 0.6.0 (#1129)
Browse files Browse the repository at this point in the history
* Update nightscout-setup.md (#1110)

Added a bit of info about alkaline voltage to complement the lithium info.

* Update ifttt-integration.md (#1109)

Updating steps for IFTTT and Google Assistant to increase clarity / reduce confusion.

* Accessing your offline rig via SSH over Bluetooth... (#1018)

works similarly to an SSH connection over WiFi.

* Update pump.md

* Update loops-in-progress.md (#1115)

* Improving formatting for updating rigs

* Update update-your-rig.md

* avoid using the & symbol in API_SECRET per openaps/oref0#801

* Update autosens.md (#1116)

* Update autosens.md

This is something I experience at leat once a week following pizza, french fries our other restaurant food with work colleagues. I was not grapsping the algo order of trating things. this hopefully will help other also undertand and be prudent.

I'm not sure that this part is still valid, I do not have “autosens_adjust_targets” in my 5.5 preferences.json : Finally, if you do not want autosens to adjusted target that can be turned off by editing preferences.json (shortcut command edit-pref) and setting the “autosens_adjust_targets” to false.

* Clarify, and add additional info on 0.5.x-only caveats

* Update update-your-rig.md (#1117)

Two 'Alternateive Step 1'. I put 1a and 1b. Maybe 1 and 2 seems more logical to you?

* bluetoothctl power off/on to fix hci0; cron stop/start

* Update Loops in progress (#1120)

First Pull Request and starting looping

* Update loops-in-progress.md (#1122)

* Update OpenAPS-install.md (#1121)

Shortcut aliases updated and missing shortcuts added. Some basic classification of shortcuts added, too

* Update PC-flash.md (#1123)

Additional note added for the intel standalone windows driver no longer being available.

* Update OpenAPS-install.md (#1126)

Tiny typo fix to reflect correct file name.

* more description for max basal rate (#1124)

* more description for max basal rate

added bit more description to the example, but mainly added key search terms to the text to help numpties like me find the answer quicker.
Sorry - read the docs 101

* Clarify, and remove comment about 4.5 U/h default

I don't have any reason to believe 4.5 U/h is a pump default: unless you have reason to believe otherwise, I suspect that's just what your pump happened to be set to the last time it was used.

* Update autotune.md (#1128)

Simple typo

* 0.6.0 docs (#1104)

* first draft of adding documentation for exponential curves

* add the graphs

* fixing graph URLs

* add example exponential growth and decay graph

* add exponential examples, and added descriptions

* fix some spacing

* fix bolding

* change title wrapping

* fixed dimensions in last graph

* adjust x12 instructions to reflect automated steps (#1047)

* Removing safety pass phrases to match workflow of 0.6.0-dev (#1107)

Removing safety pass phrases - it's now just added by enabling in the preferences list.

* Updating purple lines for 0.6.0 (#1108)

* Updating killalls to oref0-pump-loop (#1111)

* Updating killalls to oref0-pump-loop

* Update usability-considerations.md

* Updating troubleshooting re: 0.6.0 and git (#1112)

plus other cleanup

* Updated preferences with 0.6.0-dev related preferences (#1114)

* Add offline hotspot network name and password

* Update glossary.md

Adding in a few terms and taking away bolussnooze for 0.6.0

* Clarify

* Update OpenAPS-install.md

Update docs to change autotune run time (4AM) and few non-substantive changes.

* clarify

* Typo and clarifications

* adding @JELCRAWFORD's glossary additions

* Update x12-users.md (#1127)

I think someone said there is an extra comma in the settings.json example? Is this correct now?
  • Loading branch information
danamlewis committed Nov 26, 2017
1 parent c0717d4 commit 3f3d9e7
Show file tree
Hide file tree
Showing 29 changed files with 307 additions and 191 deletions.
41 changes: 26 additions & 15 deletions docs/docs/Build Your Rig/OpenAPS-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The screenshot below shows an example of the questions you'll be prompted to rep
* email address for github commits
* directory name for your openaps - we recommend the default `myopenaps` (see note above)
* serial number of your pump
* whether or not you are using an Explorer board
* whether you are using an Explorer board
* if not an Explorer board, and not a Carelink stick, you'll need to enter the mmeowlink port for TI stick. See [here](https://github.com/oskarpearson/mmeowlink/wiki/Installing-MMeowlink) for directions on finding your port
* if you're using a Carelink, you will NOT be using mmeowlink
* CGM method: The options are `g4-upload`, `g4-local-only`, `g5`, `mdt`, and `xdrip`. Note: OpenAPS also attempts to get BG data from your Nightscout. OpenAPS will always use the most recent BG data regardless of the source. G4-upload will allow you to have raw data when the G4 receiver is plugged directly into the rig.
Expand Down Expand Up @@ -75,15 +75,15 @@ Well, hey that's actually a good message. It's saying "I don't hear any interru

As the pump loop continues:
```
Refreshed jq: settings/pumphistory-25h-zoned.json: No such file or directory
Refreshed jq: settings/pumphistory-24h-zoned.json: No such file or directory
```
That message will clear out once the pump history has successfully been read.

Or how about the fact that autotune hasn't run yet, but you enabled it during setup:
```
Old settings refresh Could not parse autotune_data
```
Autotune only runs at 12:05am every evening. So, unless you're building your rig at midnight, you'll probably have to wait overnight for that error message to clear out. Not a big deal. You can still loop while that message is showing. Additionally, you'll have to wait until Autotune runs before SMBs can be enacted (SMBs won't enact unless an Autotune directory exists).
Autotune only runs at 4:05am every morning. So if autotune has not yet run, you must wait for that error message to clear out, or run it manually. You can still loop while that message is showing. Additionally, you'll have to wait until autotune runs before SMBs can be enacted. (SMBs won't enact unless an Autotune directory exists.)

And then you may have an issue about the time on your pump not matching your rig's time:
```
Expand Down Expand Up @@ -147,26 +147,37 @@ Note: The pump-loop log is not the only log your rig generates. There are also

* Network log: `tail -F /var/log/openaps/network.log`

* Autotune log: `tail -F /var/log/openaps/autotune.log` (remember Autotune only runs at midnight, so there's not much action in that log)
* Autotune log: `tail -F /var/log/openaps/autotune.log` (remember Autotune only runs at midnight (or at 4AM starting from 0.6.0-rc1), so there's not much action in that log)

These logs and other files are things you may frequently access. There are shortcuts built in to help you more easily access key files on the go. The `l` you type for logs is an example of one of these shortcuts - it's actually a shortcut for the full command `tail -F /var/log/openaps/pump-loop.log`. Here are some other shortcuts:
These logs and other files are things you may frequently access. There are shortcuts built in to help you more easily access key files on the go. The `l` you type for logs is an example of one of these shortcuts - it's actually a shortcut for the full command `tail -F /var/log/openaps/pump-loop.log`. Here are other shortcuts:

```
--View live logs--
l => tail -F /var/log/openaps/pump-loop.log
autosens-loop => tail -n 100 -F /var/log/openaps/autosens-loop.log
autotune => tail -n 100 -F /var/log/openaps/autotune.log
ns-loop => tail -n 100 -F /var/log/openaps/ns-loop.log
pump-loop => tail -n 100 -F /var/log/openaps/pump-loop.log
autosens-looplog => tail -n 100 -F /var/log/openaps/autosens-loop.log
autotunelog => tail -n 100 -F /var/log/openaps/autotune.log
ns-looplog => tail -n 100 -F /var/log/openaps/ns-loop.log
pump-looplog => tail -n 100 -F /var/log/openaps/pump-loop.log
networklog => tail -n 100 -F /var/log/openaps/network.log
xdrip-looplog => tail -n 100 -F /var/log/openaps/xdrip-loop.log
cgm-looplog => tail -n 100 -F /var/log/openaps/cgm-loop.log
urchin-looplog => tail -n 100 -F /var/log/openaps/urchin-loop.log
* to quit watching, press Ctrl+C
--View settings/logs/info--
cat-pref => cd ~/myopenaps && cat preferences.json
edit-wifi => vi /etc/wpa_supplicant/wpa_supplicant.conf
cat-wifi => cat /etc/wpa_supplicant/wpa_supplicant.conf
edit-pref => cd ~/myopenaps && vi preferences.json
log-wifi => tail -n 100 -F /var/log/openaps/network.log
git-branch => cd ~/src/oref0 && git branch
cat-autotune => cd ~/myopenaps/autotune && cat autotune_recommendations.log
edit-runagain => cd ~/myopenaps && nano oref0-runagain.sh
cat-runagain => cd ~/myopenaps && cat oref0-runagain.sh
```
git-branch => cd ~/src/oref0 && git branch
edison-battery => cd ~/myopenaps/monitor && cat edison-battery.json
cat-reservoir => cd ~/myopenaps/monitor && cat reservoir.json
--Edit settings--
edit-wifi => vi /etc/wpa_supplicant/wpa_supplicant.conf
edit-pref => cd ~/myopenaps && vi preferences.json
edit-runagain => cd ~/myopenaps && nano oref0-runagain.sh
```
To use these shortcuts, just type in the phrase you see on the left - i.e. `edit-wifi` and hit enter.

## Finish your OpenAPS setup
Expand Down
85 changes: 30 additions & 55 deletions docs/docs/Build Your Rig/x12-users.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,56 @@
# 512 and 712 Pump users

If you have one of the x12 model pumps, you can still successfully use OpenAPS for basic looping (but not some advanced featuers like SMB). You'll need to complete some extra setup steps before your loop will be successful, however. There are TWO major steps; (1) creating the files and (2) adjusting aliases. x12 users will have to be aware that the files will need to be manually updated anytime the pump user wants to change basal rate schedules, ISFs, or other pump settings.
If you have one of the x12 model pumps, you can still successfully use OpenAPS for basic looping (but not some advanced featuers like SMB). You'll need to complete some extra setup tweaks before your loop will be successful, however.

## Add pump files manually
Note: If you have an old rig running oref0 0.5.3 or below, you'll need to follow historical instructions. The instructions below reflect the adjusted oref0-setup.sh in 0.6.0 and beyond, that does some of this work manually.

Certain commands like Read Settings, BG Targets and certain Read Basal Profile are not available for x12 pumps. Therefore, you will create new files (called static json files) for the missing information. Specifically, you'll be creating three files called settings.json, bg_targets_raw.json, and basal_profile.json. To do this:

* Create a new subdirectory to your myopenaps directory. We are going to name the subdirectory `raw-pump`. After we create the new sub-directory, we will be changing into that newly created directory. The following command will do all those things at once: `cd ~/myopenaps && mkdir raw-pump && cd raw-pump` You can confirm the successful completion of this step by looking at your terminal prompt and it should show `root:~/myopenaps/raw-pump#`
## Most important step - make sure you said yes (y) in oref0-setup.sh

* `nano settings.json` to create a new settings.json file by using the nano editor. This will open a text editor where you can add your pump settings. Use the sample files below to copy and paste into the editor. **WARNING**: Make sure you change the values within the sample files to match YOUR settings and what is on YOUR pump. The loop is going to use the content of these files, so this needs to be correct for safe looping. Some hints are provided within the sample files to help you notice which items will need your personalized settings.
During the interactive setup script, one early question is about whether you have an x12 pump. This means you, if you have a 512 or 712 pump you're setting up. Make sure to type Y or y and see the confirmation that you'll be using an x12 pump.

* To finish and save the new file, press `Ctl-X`, and when it asks if you want to save `Y` for yes, and `return` to keep the settings.json name.

* Repeat the steps above for also creating the following files (sample files for these are below, as well): bg_targets_raw.json and basal_profile.json.

Once complete, type `ls` and you should see the following files:
## Edit the three (3) necessary files: basal, settings, and targets

At the end of the oref0-setup.sh script, it will open the most important file for you to edit - your basal profile. Edit this file to match your preferred basal rates and timing.

```
settings.json bg_targets_raw.json basal_profile.json
Note: The "minutes" is "minutes from midnight". e.g., a basal starting at 5:00am
will have a minutes entry of 5 x 60 = 300 minutes and a basal starting at 7:30am
will have a minutes entry of 7.5 x 60 = 450 minutes.
If you have a basal rate less than 1.0 unit/hour,
make sure to include a zero before the decimal point such as `0.55`
```

* Finish our work with these files by copying them into the settings directory:
After you ctrl-x and hit "y" to save the file, you'll also see a reminder to further adjust other files with your settings in order to loop off of your information.

* If you need to edit your basal rate file in the future, simply type `nano ~/myopenaps/settings/basal_profile.json` from the command line.

To edit and set your maxBasal or your DIA:
* `nano ~/myopenaps/settings/settings.json`

`cd ~/myopenaps && cp ./raw-pump/bg_targets_raw.json ./settings/ && cp ./raw-pump/basal_profile.json ./settings/ && cp ./raw-pump/settings.json ./settings/`
Finally, to set your targets:
* `nano ~/myopenaps/settings/bg_targets_raw.json`


### Sample file for settings.json
### Examples of the three file types

To see examples of each of these three files, see below.

#### Sample file for settings.json

notes are added with `#` on the lines you want to adjust or pay attention to in particular

```
{
"low_reservoir_warn_point": 5, #adjust to your warning level of units remaining
"keypad_lock_status": 0,
"maxBasal": 1.5, #adjust to your preferred max temp basal rate
"temp_basal": {
"percent": 100, #leave as-is
"type": "Units/hour" #leave as-is
},
"low_reservoir_warn_type": 0,
"insulinConcentration": 100,
"audio_bolus_enable": false,
"variable_bolus_enable": true,
"alarm": {
"volume": -1,
"mode": 1
"percent": 100,
"type": "Units/hour"
},
"rf_enable": true, #you will want this set to true or else your pump will not tune properly
"auto_off_duration_hrs": 0,
"block_enable": false,
"timeformat": 1,
"insulin_action_curve": 3, #adjust to your selected duration of insulin action in whole hour increments
"audio_bolus_size": 0,
"selected_pattern": 0,
"patterns_enabled": true,
"maxBolus": 3.0, #adjust to your preferred max single bolus units
"paradigm_enabled": 1
"insulin_action_curve": 6 #adjust to your selected duration of insulin action in whole hour increments
}
```

### Sample file for bg-targets-raw.json
#### Sample file for bg-targets-raw.json

Note: the "offset" entry is the minutes since midnight for that particular target to start. The profile always starts with a midnight rate first, offset is 0. The next BG target, in this example, starts at 6 am and therefore has an offset of 360 minutes (6 hours from midnight at 60 minutes per hour). Target range can have the same bg value for high and low, if desired, but be careful not to have a high target set lower than the low target.

Expand Down Expand Up @@ -98,7 +89,7 @@ You can add or delete bg targets to the sample file below, but pay close attenti
}
```

### Sample file for selected-basal-profile.json
#### Sample file for selected-basal-profile.json

Note: The format for the basal rates is the "minutes" value refers to the "minutes from midnight" for whatever rate schedule you are setting. For example, the 6:00 am rate in the example file below is a rate of 1.15 units/hour and 6:00 am is 360 minutes since midnight passed (6 hours x 60 minutes per hour).

Expand Down Expand Up @@ -158,19 +149,3 @@ You can add or delete basal rates to the sample file below, but pay close attent
}
]
```

## Adapt the aliases

The last steps are to edit the standard openaps aliases so they don't call for non-existing pump files

* First, copy and paste each of these three lines individually to adjust the "get-settings" alias:

```
cd ~/myopenaps && killall -g openaps
openaps alias remove get-settings
openaps alias add get-settings "report invoke settings/model.json settings/bg_targets.json settings/insulin_sensitivities_raw.json settings/insulin_sensitivities.json settings/carb_ratios.json settings/profile.json"
```

## Updating your pump settings

If you need to make changes to the settings contained in your pump, specifically those covered by the three files you've created (basal rates, bg-targets, max temp basal rate, or insulin duration), then you will need to edit the files and update their contents in the settings directory. For example, if you change your basal schedule or rates in the pump...simply editing them in the pump manually will not be enough to let OpenAPS know the basal profile has been altered. You'll need to login to the rig, access the files and update the information manually in the files. You can make the adjustments to the file(s) you created in the raw-pump subdirectory by using `cd ~/myopenaps/raw-pump`, then the same nano command(s), and then using the same file copy command to push the edited files into the settings directory.
5 changes: 3 additions & 2 deletions docs/docs/Customize-Iterate/autosens.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ As you can see, there are several types of adjustments that have occurred during

* "Autosens" works by reviewing the last 24 hours of data (so it's a rolling calculation with a moving window of 24 hours) and assessing deviations to determine if you are more sensitive or resistant than expected. If a pattern of such deviations is detected, it will calculate the adjustment that would've been required to bring deviations back to normal.
* Autosens does NOT take into account meal/carb deviations; it only is able to assess the impact of insulin, and thus will adjust ISF, basals, and targets to help compensate for changes in sensitivity.
* Most users will notice the changed ISF numbers in their OpenAPS pill, along with changed targets. Note that a temp target will override the autosens-adjusted target. If you do not want autosens to adjust targets, that can be turned off by editing preferences.json (shortcut command `edit-pref`) and setting the "autosens_adjust_targets" to false.
* The reason for autosens automatically adjusting targets is because the other adjustments it makes can't be fully applied without creating a feedback loop, so automatically adjusting the target it thinks it's shooting for lets autosens get BG closer to your actual target most of the time. When autosens needs to adjust basal and ISF, it can very straightforwardly use that for adjusting the temp basal it's about to set, by assuming a higher or low neutral temp basal to start from, and by calculating a bigger or smaller expected impact of current IOB. What it can't do is calculate IOB in a way that reflects the adjusted basals and ISF, because doing so would change the autosens result, which would require recalculating IOB again, which would further change the result, in an unpredictable feedback loop. So instead, we simply acknowledge that the IOB calculation doesn't reflect sensitivity or resistance, and instead adjust the target to compensate.
* Most users will notice the changed ISF numbers in their OpenAPS pill, along with autosens-adjusted targets.
* Note that a Nightscout care portal or IFTTT temp target (for activity/exercise as an example) will override the autosens-adjusted target but IT WILL NOT override an advance target adjustment to high bring BG down. This is because in 0.5.x, the temp target is honored, but the advanced target adjustment is applied after the temp target. So, if current BG is high, the advanced target adjustment will be applied starting from the activity temp target, so if BG is high enough it will still reduce the active target to 80 mg/dL / 4,4 mmol/L. Consequently, be cautious of activity periods that follow a high BG; your IOB could be quite significant and cause you to go low quite fast as you start moving. If you do not want OpenAPS to apply advanced target adjustment that can be turned off by editing preferences.json (shortcut command edit-pref) and setting the “adv_target_adjustments” to false. Finally, if you do not want autosens to adjusted target that can be turned off by editing preferences.json (shortcut command edit-pref) and setting the “autosens_adjust_targets” to false. In oref0 0.6.0, adv_target_adjustments is set to false by default, as its functionality has been replaced by instead using the (safer) zero-temp BG predictions to decide when it's safe to dose additional insulin when high. The 0.6.0 exercise_mode feature also helps improve OpenAPS' response to high temp targets.
* The reason for autosens automatically adjusting targets in 0.5.x is because the other adjustments it makes can't be fully applied without creating a feedback loop, so automatically adjusting the target it thinks it's shooting for lets autosens get BG closer to your actual target most of the time. When autosens needs to adjust basal and ISF, it can very straightforwardly use that for adjusting the temp basal it's about to set, by assuming a higher or low neutral temp basal to start from, and by calculating a bigger or smaller expected impact of current IOB. What it can't do is calculate IOB in a way that reflects the adjusted basals and ISF, because doing so would change the autosens result, which would require recalculating IOB again, which would further change the result, in an unpredictable feedback loop. So instead, we simply acknowledge that the IOB calculation doesn't reflect sensitivity or resistance, and instead adjust the target to compensate. These limitations have been addressed in oref0 0.6.0.
* Autosens is limited by the safety multipliers in preferences.json. The defaults are:
```
"autosens_max": 1.2, <----multiplier for adjustments during insulin resistance
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/Customize-Iterate/autotune.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Other things to check:
* Did you pull too much data? Start with one day, and make sure it's a day where you had data in Nightscout. Work your way up to 1 week or 1 month of data. If you run into errors on a longer data pull, there may be something funky in Nightscout that's messing up the data format file and you'll want to exclude that date by picking a batch that does not include that particular date.
* Make sure when you sub in your Nightscout URL you do not include a "/" at the end of the URL
* Check your profile.json and make sure it really matches the example - chances are there's a stray character in there.
- "start" time stamps must have the format "HH:MM:SS". "HH:MM" (e.g. "00:00" instead of "00:00:00") gives erroneous calculations such as "-Infinity" or "Nan" for the ISF and CR avlues. This results in the ISF & Carb ratio values being unchanged.
    - "start" time stamps must have the format "HH:MM:SS". "HH:MM" (e.g. "00:00" instead of "00:00:00") gives erroneous calculations such as "-Infinity" or "Nan" for the ISF and CR values. This results in the ISF & Carb ratio values being unchanged.
Example output (console):
```oldCR: 9 fullNewCR: NaN newCR: NaN
p50deviation: -0.76 p50BGI 0 p50ratios: -Infinity Old ISF: 44 fullNewISF: -Infinity adjustedISF: 44 newISF: 44
Expand Down

0 comments on commit 3f3d9e7

Please sign in to comment.