Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
529b317
Merge pull request #2 from openaps/dev
logichammer Dec 30, 2015
e500b82
Merge pull request #4 from openaps/dev
logichammer Jan 19, 2016
338fca3
Merge pull request #5 from openaps/dev
logichammer Jan 26, 2016
2973713
Revised BGI explanation, NS upload info added, pseudo code loop examp…
logichammer Jan 28, 2016
9876832
small edit to image tag
logichammer Jan 28, 2016
19af258
add caveat to BGI example
logichammer Jan 28, 2016
b53a64b
Merge Nightscout upload instructions
logichammer Feb 3, 2016
415e3a7
Update using.md
joannestevens Feb 20, 2016
baa07cb
Create wifi.md
jmatheson Feb 27, 2016
3b79426
Update wifi.md
jmatheson Feb 27, 2016
98f332c
Update wifi.md
jmatheson Feb 27, 2016
9f4b0dc
Added link to wifi troubleshooting
jmatheson Feb 27, 2016
c1bfbe1
Update wifi.md
jmatheson Feb 27, 2016
bb8f453
Update wifi.md
jmatheson Feb 27, 2016
cd05821
Merge pull request #2 from openaps/dev
jmatheson Feb 27, 2016
09b566f
Adjusted text
jmatheson Feb 28, 2016
389d391
Update vizualization.md
live4sw Feb 29, 2016
63d29c7
Update Using-oref0-tools.md
live4sw Mar 4, 2016
231f821
Update using.md
Mar 6, 2016
09b0b81
Update using.md
mikestebbins Mar 7, 2016
ccd3ed0
make inline link relative
bewest Mar 25, 2016
49e04da
tweak some copyright info
bewest Mar 25, 2016
46a4601
add logo
bewest Mar 25, 2016
1182d7e
don't forget file extension of .md for loops-in-progress
bewest Mar 25, 2016
d4633fb
fix broken reference target
bewest Mar 25, 2016
87e9a57
remove stale/unused content
bewest Mar 26, 2016
adb3960
try tweaking conf.py a bit more
bewest Mar 26, 2016
ac59437
Merge remote-tracking branch 'mikestebbins/dev' into wip-2016-spring
bewest Mar 26, 2016
91131b3
Merge remote-tracking branch 'ceben80/dev' into wip-2016-spring
bewest Mar 26, 2016
8c540bc
Merge remote-tracking branch 'live4sw/patch-2' into wip-2016-spring
bewest Mar 26, 2016
09dadbf
Merge remote-tracking branch 'live4sw/patch-1' into wip-2016-spring
bewest Mar 26, 2016
c89d465
Merge remote-tracking branch 'jmatheson/dev' into wip-2016-spring
bewest Mar 26, 2016
340052a
Merge remote-tracking branch 'joannestevens/patch-1' into wip-2016-sp…
bewest Mar 26, 2016
4c0676e
tweak wifi edits from @jmatheson
bewest Mar 26, 2016
62ccdf5
Merge remote-tracking branch 'logichammer/dev' into wip-2016-spring
bewest Mar 26, 2016
22a3e75
fix image links on readme
bewest Mar 26, 2016
e3d6ac2
fix another link
bewest Mar 26, 2016
ea31ed6
use https links to rtd
bewest Mar 26, 2016
1a6b5d7
Merge branch 'dana-dev' of github.com:openaps/docs into wip-2016-spring
bewest Mar 29, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Introduction

### Read the Docs
* [Latest production docs](http://openaps.readthedocs.org/en/latest/index.html)
* [Dev docs](http://openaps.readthedocs.org/en/dev/index.html)
* [Dana's docs](http://openaps.readthedocs.org/en/dana-dev/index.html)
* [Latest production docs](https://openaps.readthedocs.org/en/latest/index.html)
* [Dev docs](https://openaps.readthedocs.org/en/dev/index.html)
* [Dana's docs](https://openaps.readthedocs.org/en/dana-dev/index.html)

## Welcome

Welcome to the [openaps](https://github.com/openaps/) documentation!

openaps is part of a set of tools to support a self-driven Do-It-Yourself (DIY) implementation of an artificial pancreas based on the [OpenAPS reference design](http://openaps.org/open-artificial-pancreas-system-openaps-reference-design/).

Here are two visuals to show you what the physical hardware components of an OpenAPS setup look like - ![version A](./docs/docs/IMG_1112.jpg) is without labels; ![version B](docs/Images/piSetup.jpg) contains labels to describe the parts.

By proceeding to use these tools or any piece within, you agree to the copyright (see LICENSE.txt for more information) and release any contributors from liability.

The tools may be categorized as: 1) **monitor** collecting data and
Expand Down
Binary file added docs/Images/basal_profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Images/nightscout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Images/ns_app_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Images/ns_version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Images/piSetup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Images/profile_editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/openaps-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 37 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@

# General information about the project.
project = u'OpenAPS'
copyright = u'2016, Ben West'
author = u'Ben West'
copyright = u'2016, Ben West, Dana Lewis, and openaps contributors'
author = u'Ben West, Dana Lewis, Scott Leibrand, openaps community'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -123,18 +123,43 @@
# a list of builtin themes.
html_theme = 'alabaster'


extra_nav_links = {
'docs': 'https://github.com/openaps/docs',
'openaps': 'https://github.com/openaps/openaps',
'dexcom_reader': 'https://github.com/openaps/dexcom_reader',
'decocare': 'https://github.com/bewest/decoding-carelink',
'openaps.org': 'https://openaps.org/',
}
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# alabaster
theme_github_user = 'openaps'
theme_github_repo = 'docs'
html_theme_options = {
'show_related': True,
'github_user': theme_github_user,
'github_repo': theme_github_repo,
'logo': 'openaps-logo.png',
# TODO: ???? doesn't work?
'extra_nav_links': extra_nav_links,
}

"""
html_theme = 'sphinx_rtd_theme'
html_theme_options = {
'display_github': True,
'github_user': 'openaps',
'github_repo': 'docs',
}
import sphinx_rtd_theme
html_theme_path = [sphinx_rtd_theme.get_html_theme_path( )]
"""

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
html_theme_path = [alabaster.get_path( )]
html_theme_path = []
html_theme_path = [alabaster.get_path( ),]

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand All @@ -146,6 +171,7 @@
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
html_logo = '_static/openaps-logo.png'

# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand All @@ -165,6 +191,7 @@
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
Expand All @@ -173,6 +200,7 @@
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# for alabaster
"""
html_sidbars = {
'**': [
'about.html',
Expand All @@ -182,6 +210,9 @@
'donate.html',
]
}
"""

html_sidbars = { }

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand Down Expand Up @@ -251,7 +282,7 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'OpenAPS.tex', u'OpenAPS Documentation',
u'Ben West', 'manual'),
author, 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
13 changes: 0 additions & 13 deletions docs/docs/Overview/index.rst

This file was deleted.

1 change: 1 addition & 0 deletions docs/docs/Resources/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Resources
my-first-pr
technical-resources
troubleshooting
wifi
history
other-projects
faq
Expand Down
4 changes: 3 additions & 1 deletion docs/docs/Resources/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Warning: do not run any openaps commands with sudo in front of it `sudo openaps

### Environment variables

If you are getting your BG from Nightscout or you want to upload loop status/resuts to Nightscout, among other things you'll need to set 2 environment variabled: `NIGHTSCOUT_HOST` and `API_SECRET`. If you do not set and export these variables you will receive errors while running `openaps report invoke monitor/ns-glucose.json` and while executing `ns-upload.sh` script which is most probably part of your `upload-recent-treatments` alias.Make sure your `API_SECRET` is in hashed format. Please see [this page](https://github.com/openaps/oref0#ns-upload-entries) for details. Additionally, your `NIGHTSCOUT_HOST` should be in a format like `http://yourname.herokuapp.com` (without trailing slash). For the complete visualization guide use [this page](https://github.com/openaps/docs/blob/master/docs/Automate-system/vizualization.md) from the OopenAPS documentation.
If you are getting your BG from Nightscout or you want to upload loop status/resuts to Nightscout, among other things you'll need to set 2 environment variabled: `NIGHTSCOUT_HOST` and `API_SECRET`. If you do not set and export these variables you will receive errors while running `openaps report invoke monitor/ns-glucose.json` and while executing `ns-upload.sh` script which is most probably part of your `upload-recent-treatments` alias.Make sure your `API_SECRET` is in hashed format. Please see [this page](https://github.com/openaps/oref0#ns-upload-entries) for details. Additionally, your `NIGHTSCOUT_HOST` should be in a format like `http://yourname.herokuapp.com` (without trailing slash). See also [Openaps complete visualization guide](../walkthrough/phase-1/visualization.md) for more details.

### Common error messages

Expand All @@ -74,5 +74,7 @@ json: error: input is not JSON: Unexpected '<' at line 1, column 1:

This error usually comes up when you have pulled a file down from Nightscount that was an invalid file. Typcially you might see this when trying to pull down treatments. Make sure that you have your HOST and API_KEY set correctly at the top of your cron, in your ~/.profile

### Wifi and hotspot issues
See [wifi troubleshooting page](wifi.md)


25 changes: 25 additions & 0 deletions docs/docs/Resources/wifi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Wifi Troubleshooting

## My wifi connection keeps dropping and/or I keep getting kicked out of ssh
There is a script that you can add to your root cron that will test your connection and reset it if it is down. Here is an example that runs every two minuntes (odd minutes). You could also do it every 5 minutes or less. Note, this does not have to be for an Edison, you can set this up for a Pi, etc as well.

```
cd ~/src
git clone https://github.com/TC2013/edison_wifi
cd edison_wifi
chmod 0755 /home/edison/src/edison_wifi/wifi.sh
```
Next, add the script to your root cron. Note this is a different cron that what your loops runs on, so when you open it don't expect to see your loop and other items you've added.
* Log in as root ```su root```
* Edit your root cron ```crontab -e```
* Add the following line ```1-59/2 * * * * /home/edison/src/edison_wifi/wifi.sh google.com 2>&1 | logger -t wifi-reset```

## I forget to switch back to home wifi and it runs up my data plan
You can add a line to your cron that will check to see if <YOURWIFINAME> is avaiable and automatically switch to it if you are on a different network.
* Log in as root ```su root```
* Edit your root cron ```crontab -e```
* Add the following line ```*/2 * * * * ( (wpa_cli status | grep <YOURWIFINAME> > /dev/null && echo already on <YOURWIFINAME>) || (wpa_cli scan > /dev/null && wpa_cli scan_results | egrep <YOURWIFINAME> > /dev/null && udo pa_cli select_network $(wpa_clilist_networks | grep jsqrd | cut -f 1) && echo switched to <YOURWIFINAME> && sleep 15 && (for i in $(wpa_cli list_networks | grep DISABLED | cut -f 1); do wpa_cli enable_network $i > /dev/null; done) && echo and re-enabled other networks) ) 2>&1 | logger -t wifi-select```

## I am having trouble consistently connecting to my wifi hotspot when I leave the house (iPhone)
1. When you turn on your hotspot it will only broadcast for 90 seconds and then stop (even if it is flipped on). So, when you leave your house you need to go into the hotspot setting screen (and flip on if needed). Leave this screen open until you see your rig has connected.
2. If your phone knows about wifi networks that your rig does not, your phone may connect to that wifi and in turn drop the hotspot. Make sure your phone does not connect to other wifi networks (coffee shops, a friends house, etc). You man need to forget the networks. This can also be tricky if your computer and iPhone share a network list.
2 changes: 1 addition & 1 deletion docs/docs/introduction/communication-support-channels.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Where to go for help with your implementation

There are several ways to communicate with other participants and contributors in the #OpenAPS project. See also the [Resources](../Resources/) section for additional assistance.
There are several ways to communicate with other participants and contributors in the #OpenAPS project. See also the [Resources](../Resources/index.rst) section for additional assistance.

**Note:** It's best practice not to share your pump's serial number, so make sure not to include it in pictures or pasted text output when seeking help on pump communication.

Expand Down
5 changes: 4 additions & 1 deletion docs/docs/walkthrough/phase-0/baseline-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ Go ahead and document your most recent A1c and keep it somewhere handy. This wil

## Get comfortable making a PR

You should be comfortable making a PR to this documentation. If you haven't ever done this, [click here](../../Resources/my-first-pr.html) and try it out.
You should be comfortable making a PR to this documentation. If you haven't
ever done this, take a look at
[my first pull request guide](../../Resources/my-first-pr.md)
and try it out.
4 changes: 3 additions & 1 deletion docs/docs/walkthrough/phase-1/visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ $ openaps alias add format-latest-nightscout-treatments '! bash -c "nightscout c
$ openaps alias add upload-recent-treatments '! bash -c "openaps format-latest-nightscout-treatments && test $(json -f upload/latest-treatments.json -a created_at eventType | wc -l ) -gt 0 && (ns-upload $NIGHTSCOUT_HOST $API_SECRET treatments.json upload/latest-treatments.json ) || echo \"No recent treatments to upload\""' || die "Can't add upload-recent-treatments"
```

Note that a pumphistory-zoned.json report is required, which can be generated from pumphistory.json using `tz`, following the approach described above for clock-zoned.json. After running your loop from command line, you may try executing `openaps upload-recent-treatments` manually from command line. Upon successful upload, the recent treatments will show up automatically on the Nightscount page.
Note that a pumphistory-zoned.json report is required, which can be generated from pumphistory.json using `tz`, following the approach described above for clock-zoned.json, including making sure to add it to your monitor-pump alias. In addition, if you haven't already created a settings/model.json report, you should create that report and invoke it since it is required for format-latest-nightscout-treatments.

After running your loop from command line, you may try executing `openaps upload-recent-treatments` manually from command line. Upon successful upload, the recent treatments will show up automatically on the Nightscount page.

Note: Currently extended boluses are not handled well and depending on the timing of the upload are either missed entirely or have incorrect information.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/walkthrough/phase-2/Using-oref0-tools.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Using oref0 Tools
# Using oref0 Tools

## Add the oref0 Virtual Devices
In Phase 1, you added two physical medical devices to openaps—your pump and your cgm. This was done using the command `$ openaps device add` and then specifying the device name, type, and parameters. OpenAPS tools to gather system profile parameters such as pump settings, calculate the current insulin on board (IOB), and determine if the pump temp basal should be updated or not, are contained in the OpenAPS reference system oref0. Since there is no physical oref0 device, you are essentially adding it to the openaps environment as a virtual device or plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ returns the current pump time stamp, such as "2016-01-09T10:47:56", if the syste
Collecting all the error checking, a `preflight` alias could be defined as follows:

```
$ openaps alias add preflight '! bash -c "rm -f monitor/clock.json && openaps report invoke monitor/clock.json 2>/dev/null && grep -q T monitor/clock.json && echo PREFLIGHT OK || (mm-stick warmup || (sudo oref0-reset-usb && echo PREFLIGHT SLEEP && sleep 120); echo PREFLIGHT FAIL; exit 1)"'
$ openaps alias add preflight '! bash -c "rm -f monitor/clock.json && openaps report invoke monitor/clock.json 2>/dev/null && grep -q T monitor/clock.json && echo PREFLIGHT OK || (mm-stick warmup || (sudo oref0-reset-usb; echo PREFLIGHT SLEEP; sleep 120); echo PREFLIGHT FAIL; exit 1)"'
```

In this `preflight` example, a wait period of 120 seconds is added using `sleep` bash command if the USB ports have been reset in an attempt to revive the MM CareLink stick. This `preflight` example also shows how bash commands can be chained together with the bash && ("and") or || ("or") operators to execute different subsequent commands depending on the output code of a previous command (interpreted as "true" or "false").
Expand Down
24 changes: 24 additions & 0 deletions docs/docs/walkthrough/phase-2/loop-and-retry-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,27 @@
To pull all of oref0 together, you could create a "loop" alias that looks something like `openaps alias add loop '! bash -c "openaps monitor-cgm 2>/dev/null && ( openaps preflight && openaps gather && openaps enact) || echo No CGM data."'`. If you want to also add some retry logic to try again if something failed, you could then do something like `openaps alias add retry-loop '! bash -c "openaps preflight && until( ! mm-stick warmup || openaps loop); do sleep 5; done"'`.

Once all that is working and tested, you will have a command that can be run manually or on a schedule to collect data from the pump and cgm, calculate IOB and a temp basal suggestion, and then enact that on the pump.

## A barebones loop

- Make sure all dirs that have new files generated are cleaned out
- Get CGM data
- Get pump data
- Get Basal Suggestions
- Check if you need to put suggestions in place and if you do, then run them

## A more advanced loop
**Pull pump settings once an hour**

**Log everything!**
- Make sure only one loop runs at a time
- Verify you can talk to the pump, you can't reset the USB carelink connection
- Make sure all dirs that have new files generated are cleaned out
- Get CGM data
- Get pump data
- Get Basal Suggestions
- Check if you need to put suggestions in place and if you do, then run them
- Pull pump settings again since you just modified the pump
- get latest ns treatment time
- format latest nightscout treatments
- upload recent treatments
11 changes: 11 additions & 0 deletions docs/docs/walkthrough/phase-2/using-openaps-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ Then, you can add your pump again with a different name or serial number.

### Check that you can communicate with your pump

Ensure that you have the CareLink USB stick plugged into the Pi using the USB extension

Now that you have added these devices, let's see if we can establish communication with them. First, the pump:

`$ openaps use <my_pump_name> model`
Expand Down Expand Up @@ -362,8 +364,17 @@ repository" box checked. Once created, you will be directed to a "Repository
setup" page. Under the "Command line" section, click on the "I have an existing
project" option and follow the instructions.

In order to eliminate being
prompted for your Bitbucket password every time you `$ git push`, change the
origin field provided by Bitbucket from `https://USERNAME@bitbucket.org...` to
`https://USERNAME:PASSWORD@bitbucket.org...`. PASSWORD is the same password
you use to log-in to your Bitbucket account.

Once you have completed this step, all of the files in your `<my_openaps>`
directory will be saved in your online Bitbucket repository. Whenever you would
like to update your backup, simply go into your `<my_openaps>` directory and `$
git push`. This process can be automated, but we'll save that for another day.

[Github mkimg tool](https://github.com/zymbit/rpi-mkimg) has the ability to create a full SD card image with the advantage to shrink it to its minimum size quite different from the windows Win32DiskImager which always creates an image which is as large as the card. Using Win32DiskImager it might not be possible to restore an image on a new card with the same size. Using Github mkimg tool instead
for example a 32 GB size card can be reduced to approximately 1.9 GB.

Binary file added docs/piSetup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/nightscout/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.. _nightscout-tools
.. _nightscout-tools:

Nightscout
==========
Expand Down
Loading