├── docs ├── _static │ ├── .gitkeep │ └── openaps-logo.png ├── _templates │ └── .gitkeep ├── reference │ ├── mm │ │ ├── mmblelink.md │ │ ├── mm-pretty-csv.md │ │ ├── index.rst │ │ ├── mmtune.py.md │ │ ├── mm-format-ns-glucose.md │ │ ├── mm-format-ns-treatments.md │ │ ├── mm-format-ns-pump-history.md │ │ ├── mm-stick.md │ │ ├── mm-decode-history-page.py.md │ │ ├── mm-format-ns-profile.md │ │ ├── mm-press-key.py.md │ │ ├── mm-set-suspend.py.md │ │ ├── mm-bolus.py.md │ │ ├── mm-temp-basals.py.md │ │ ├── mm-set-rtc.py.md │ │ ├── mmcli.md │ │ ├── mm-latest.py.md │ │ ├── mm-send-comm.py.md │ │ ├── mmeowlink-send.py.md │ │ └── mmblelink-send.py.md │ ├── oref0 │ │ ├── oref0-raw.md │ │ ├── oref0-determine-basal.md │ │ ├── oref0-fix-git-corruption.md │ │ ├── index.rst │ │ ├── oref0-reset-usb.md │ │ ├── oref0-normalize-temps.md │ │ ├── oref0-meal.md │ │ ├── oref0-reset-git.md │ │ ├── oref0-calculate-iob.md │ │ ├── oref0-find-insulin-uses.md │ │ ├── oref0-pebble.md │ │ ├── oref0-get-profile.md │ │ ├── oref0-mint-max-iob.md │ │ ├── oref0.md │ │ └── oref0-ifttt-notify.md │ ├── ns │ │ ├── ns-upload.md │ │ ├── ns-upload-entries.md │ │ ├── ns-status.md │ │ └── ns-dedupe-treatments.md │ ├── openaps │ │ ├── openaps-install-udev-rules.md │ │ ├── index.rst │ │ ├── openaps-dbus.md │ │ ├── openaps-alias.md │ │ ├── openaps-import.md │ │ ├── openaps-get.md │ │ ├── openaps-schedule.md │ │ ├── openaps-enact.md │ │ ├── openaps-vendor.md │ │ ├── openaps-trigger.md │ │ ├── openaps-report.md │ │ ├── openaps-use.md │ │ └── openaps.md │ ├── nightscout │ │ ├── index.rst │ │ └── nightscout.md │ └── index.rst ├── docs │ ├── openaps-guide │ │ ├── core │ │ │ ├── vendors.md │ │ │ ├── alias.md │ │ │ ├── devices.md │ │ │ └── medtronic.md │ │ ├── tutorial.md │ │ ├── index.rst │ │ ├── installing.md │ │ └── overview.md │ ├── IMG_1112.jpg │ ├── Images │ │ ├── Battery.jpg │ │ ├── SD_Card.jpg │ │ ├── Dexcom_G4.jpg │ │ ├── CareLink_USB.jpg │ │ ├── Enlite_Sensor.jpg │ │ ├── SDFormatter.png │ │ ├── Wifi_Adapter.jpg │ │ └── System_Overview.jpg │ ├── README.md │ ├── walkthrough │ │ ├── phase-3 │ │ │ ├── index.rst │ │ │ ├── considerations.md │ │ │ └── Understand-determine-basal.md │ │ ├── index.rst │ │ ├── phase-0 │ │ │ ├── index.rst │ │ │ ├── loops-in-progress.md │ │ │ ├── setup.md │ │ │ ├── baseline-data.md │ │ │ └── openaps.md │ │ ├── phase-5 │ │ │ ├── index.rst │ │ │ ├── considerations.md │ │ │ ├── tuning-targets.md │ │ │ └── beyond-low-glucose-suspend.md │ │ ├── phase-1 │ │ │ ├── index.rst │ │ │ ├── analyze-existing-data │ │ │ ├── log-clean-analyze.md │ │ │ └── visualization.md │ │ ├── phase-4 │ │ │ ├── index.rst │ │ │ ├── create-schedule.md │ │ │ ├── considerations.md │ │ │ ├── Observing-closed-loop.md │ │ │ └── troubleshooting-loop.md │ │ ├── phase-2 │ │ │ ├── index.rst │ │ │ ├── loop-and-retry-logic.md │ │ │ ├── considerations.md │ │ │ └── building-preflight-safety-checks.md │ │ └── phase-6 │ │ │ ├── index.rst │ │ │ ├── daytime-testing.md │ │ │ ├── considerations.md │ │ │ ├── keeping-up-to-date.md │ │ │ ├── advanced-features.md │ │ │ └── Configure-Automatic-Sensitivity-Mode.md │ ├── Resources │ │ ├── index.rst │ │ ├── glossary.md │ │ ├── faq.md │ │ ├── technical-resources.md │ │ ├── other-projects.md │ │ ├── my-first-pr.md │ │ ├── history.md │ │ └── troubleshooting.md │ └── introduction │ │ ├── index.rst │ │ ├── contribute.md │ │ ├── communication-support-channels.md │ │ └── understand-this-guide.md ├── api │ ├── openaps │ │ ├── modules.rst │ │ ├── openaps.uses.rst │ │ ├── openaps.glucose.rst │ │ ├── openaps.cli.rst │ │ ├── openaps.alias.rst │ │ ├── openaps.devices.rst │ │ ├── openaps.vendors.plugins.rst │ │ ├── openaps.vendors.rst │ │ ├── openaps.reports.reporters.rst │ │ ├── openaps.rst │ │ └── openaps.reports.rst │ └── index.rst └── index.rst ├── requirements.txt ├── .gitignore ├── scripts ├── quick-packages.sh └── quick-src.sh ├── make.bat └── Makefile /docs/_static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_templates/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/reference/mm/mmblelink.md: -------------------------------------------------------------------------------- 1 | # `mmblelink` 2 | 3 | ## Help 4 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-raw.md: -------------------------------------------------------------------------------- 1 | # `oref0-raw` 2 | 3 | ## Help 4 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-pretty-csv.md: -------------------------------------------------------------------------------- 1 | # `mm-pretty-csv` 2 | 3 | ## Help 4 | -------------------------------------------------------------------------------- /docs/docs/openaps-guide/core/vendors.md: -------------------------------------------------------------------------------- 1 | 2 | # Vendors - discovering uniformity 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-determine-basal.md: -------------------------------------------------------------------------------- 1 | # `oref0-determine-basal` 2 | 3 | ## Help 4 | -------------------------------------------------------------------------------- /docs/docs/IMG_1112.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/IMG_1112.jpg -------------------------------------------------------------------------------- /docs/reference/ns/ns-upload.md: -------------------------------------------------------------------------------- 1 | # `ns-upload` 2 | 3 | ## Help 4 | ns-upload: missing API_SECRET 5 | -------------------------------------------------------------------------------- /docs/_static/openaps-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/_static/openaps-logo.png -------------------------------------------------------------------------------- /docs/docs/Images/Battery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/Images/Battery.jpg -------------------------------------------------------------------------------- /docs/docs/Images/SD_Card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/Images/SD_Card.jpg -------------------------------------------------------------------------------- /docs/docs/openaps-guide/tutorial.md: -------------------------------------------------------------------------------- 1 | 2 | # Tutorial: putting it together 3 | 4 | ## Hello world device 5 | 6 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | recommonmark==0.4.0 2 | git+git://github.com/bewest/decoding-carelink.git@dev 3 | openaps 4 | -------------------------------------------------------------------------------- /docs/api/openaps/modules.rst: -------------------------------------------------------------------------------- 1 | openaps 2 | ======= 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | openaps 8 | -------------------------------------------------------------------------------- /docs/docs/Images/Dexcom_G4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/Images/Dexcom_G4.jpg -------------------------------------------------------------------------------- /docs/docs/Images/CareLink_USB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/Images/CareLink_USB.jpg -------------------------------------------------------------------------------- /docs/docs/Images/Enlite_Sensor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/Images/Enlite_Sensor.jpg -------------------------------------------------------------------------------- /docs/docs/Images/SDFormatter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/Images/SDFormatter.png -------------------------------------------------------------------------------- /docs/docs/Images/Wifi_Adapter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/Images/Wifi_Adapter.jpg -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-install-udev-rules.md: -------------------------------------------------------------------------------- 1 | # `openaps-install-udev-rules` 2 | 3 | ## Help 4 | run as root 5 | -------------------------------------------------------------------------------- /docs/docs/Images/System_Overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/docs-1/master/docs/docs/Images/System_Overview.jpg -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-fix-git-corruption.md: -------------------------------------------------------------------------------- 1 | # `oref0-fix-git-corruption` 2 | 3 | ## Help 4 | Git repo does not appear to be corrupt. 5 | -------------------------------------------------------------------------------- /docs/reference/mm/index.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | .. _mm-tools 4 | mm 5 | == 6 | .. toctree:: 7 | :glob: 8 | :titlesonly: 9 | 10 | * 11 | 12 | -------------------------------------------------------------------------------- /docs/docs/README.md: -------------------------------------------------------------------------------- 1 | #Docs / Docs 2 | 3 | This is not the main OpenAPS documentation directory. To switch to main Readme please click [here](../../README.md) 4 | -------------------------------------------------------------------------------- /docs/reference/oref0/index.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | .. _oref0-tools: 4 | oref0 5 | ===== 6 | .. toctree:: 7 | :glob: 8 | :titlesonly: 9 | 10 | * 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-reset-usb.md: -------------------------------------------------------------------------------- 1 | # `oref0-reset-usb` 2 | 3 | ## Help 4 | oref0-reset-usb 5 | oref0-reset-usb - Drop USB stack, rebind the usb kernel modules. 6 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-normalize-temps.md: -------------------------------------------------------------------------------- 1 | # `oref0-normalize-temps` 2 | 3 | ## Help 4 | usage: [ 'node', '/usr/local/bin/oref0-normalize-temps' ] 5 | -------------------------------------------------------------------------------- /docs/reference/openaps/index.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | .. _openaps-tools: 4 | 5 | openaps 6 | ======= 7 | .. toctree:: 8 | :glob: 9 | :titlesonly: 10 | 11 | * 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-meal.md: -------------------------------------------------------------------------------- 1 | # `oref0-meal` 2 | 3 | ## Help 4 | usage: [ 'node', '/usr/local/bin/oref0-meal' ] [carbhistory.json] 5 | -------------------------------------------------------------------------------- /docs/api/index.rst: -------------------------------------------------------------------------------- 1 | 2 | API Reference 3 | ============= 4 | openaps 5 | ------------------ 6 | .. toctree:: 7 | :glob: 8 | :maxdepth: 2 9 | 10 | 11 | openaps/* 12 | 13 | -------------------------------------------------------------------------------- /docs/reference/mm/mmtune.py.md: -------------------------------------------------------------------------------- 1 | # `mmtune.py` 2 | 3 | ## Help 4 | Usage: mmtune.py /dev/ttyMFD1 pumpserial [radio_locale] 5 | Radio locale defaults to 'US'. Set to 'WW' for other countries 6 | -------------------------------------------------------------------------------- /docs/reference/nightscout/index.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _nightscout-tools: 3 | 4 | Nightscout 5 | ========== 6 | .. toctree:: 7 | :glob: 8 | 9 | nightscout 10 | ../ns/* 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-reset-git.md: -------------------------------------------------------------------------------- 1 | # `oref0-reset-git` 2 | 3 | ## Help 4 | oref0-reset-git 5 | oref0-reset-git - Wipe out all history, forcibly re-initialzize openaps from scratch. 6 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-calculate-iob.md: -------------------------------------------------------------------------------- 1 | # `oref0-calculate-iob` 2 | 3 | ## Help 4 | usage: [ 'node', '/usr/local/bin/oref0-calculate-iob' ] 5 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-find-insulin-uses.md: -------------------------------------------------------------------------------- 1 | # `oref0-find-insulin-uses` 2 | 3 | ## Help 4 | usage: [ 'node', '/usr/local/bin/oref0-find-insulin-uses' ] 5 | -------------------------------------------------------------------------------- /docs/reference/ns/ns-upload-entries.md: -------------------------------------------------------------------------------- 1 | # `ns-upload-entries` 2 | 3 | ## Help 4 | ns-upload-entries 5 | ns-upload-entries - Upload entries (glucose data) to NS. 6 | -------------------------------------------------------------------------------- /docs/reference/ns/ns-status.md: -------------------------------------------------------------------------------- 1 | # `ns-status` 2 | 3 | ## Help 4 | usage: [ 'node', '/usr/local/bin/ns-status' ] [mmtune.json] 5 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-3/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Phase 3: Automation 3 | ------------------- 4 | 5 | .. toctree:: 6 | :maxdepth: 4 7 | 8 | 9 | considerations 10 | Understand-determine-basal 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-format-ns-glucose.md: -------------------------------------------------------------------------------- 1 | # `mm-format-ns-glucose` 2 | 3 | ## Help 4 | mm-format-ns-glucose [--oref0] 5 | mm-format-ns-glucose - Format Medtronic glucose data into something acceptable to Nightscout. 6 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-format-ns-treatments.md: -------------------------------------------------------------------------------- 1 | # `mm-format-ns-treatments` 2 | 3 | ## Help 4 | mm-format-ns-treatments 5 | mm-format-ns-treatments - Format medtronic history data into Nightscout treatments data. 6 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-pebble.md: -------------------------------------------------------------------------------- 1 | # `oref0-pebble` 2 | 3 | ## Help 4 | usage: [ 'node', '/usr/local/bin/oref0-pebble' ] [meal.json] 5 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-format-ns-pump-history.md: -------------------------------------------------------------------------------- 1 | # `mm-format-ns-pump-history` 2 | 3 | ## Help 4 | mm-format-ns-pump-history 5 | mm-format-ns-pump-history - Format Medtronic pump-history data into something acceptable to Nightscout. 6 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-get-profile.md: -------------------------------------------------------------------------------- 1 | # `oref0-get-profile` 2 | 3 | ## Help 4 | usage: [ 'node', '/usr/local/bin/oref0-get-profile' ] [] [] 5 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/index.rst: -------------------------------------------------------------------------------- 1 | Walkthrough 2 | ----------- 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | phase-0/index 8 | phase-1/index 9 | phase-2/index 10 | phase-3/index 11 | phase-4/index 12 | phase-5/index 13 | phase-6/index 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-0/index.rst: -------------------------------------------------------------------------------- 1 | Phase 0: General Setup 2 | ---------------------- 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | 8 | setup 9 | baseline-data 10 | hardware 11 | rpi 12 | openaps 13 | loops-in-progress 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/docs/Resources/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Resources 3 | --------- 4 | 5 | .. toctree:: 6 | :maxdepth: 4 7 | :glob: 8 | 9 | my-first-pr 10 | technical-resources 11 | troubleshooting 12 | history 13 | other-projects 14 | faq 15 | glossary 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-5/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Phase 5: Tuning the Closed Loop 3 | ------------------------------- 4 | 5 | .. toctree:: 6 | :maxdepth: 4 7 | 8 | 9 | considerations 10 | beyond-low-glucose-suspend 11 | tuning-targets 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/reference/nightscout/nightscout.md: -------------------------------------------------------------------------------- 1 | # `nightscout` 2 | 3 | ## Help 4 | Usage: 5 | nightscout 6 | 7 | * latest-openaps-treatment 8 | * cull-latest-openaps-treatments 9 | 10 | * ns-get 11 | * ns-upload 12 | * ns-dedupe-treatments 13 | * ns-status 14 | * ns-upload-entries 15 | 16 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-1/index.rst: -------------------------------------------------------------------------------- 1 | Phase 1: Logging, Cleaning, and Analyzing Your Data 2 | --------------------------------------------------- 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | 8 | log-clean-analyze 9 | analyze-existing-data 10 | visualization 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-4/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Phase 4: Iterate and Improve 3 | ---------------------------- 4 | 5 | .. toctree:: 6 | :maxdepth: 4 7 | 8 | 9 | 10 | considerations 11 | 12 | create-schedule 13 | Observing-closed-loop 14 | troubleshooting-loop 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-5/considerations.md: -------------------------------------------------------------------------------- 1 | # Phase 5: Tuning the Closed Loop 2 | 3 | At this point, you have a closed loop that can run overnight, but it's been in 'low glucose suspend mode'. At this stage, you'll advance to changing your settings and tuning your targets in incremental steps to find what the right settings are for you. 4 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-2/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Phase 2: Build a Manual System 3 | ------------------------------ 4 | 5 | .. toctree:: 6 | :maxdepth: 4 7 | 8 | 9 | considerations 10 | using-openaps-tools 11 | building-preflight-safety-checks 12 | Using-oref0-tools 13 | loop-and-retry-logic 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-3/considerations.md: -------------------------------------------------------------------------------- 1 | # Phase 3: Understanding Your Open Loop 2 | 3 | Phase 3 entails understanding what the open loop is recommmending, and why. You should run with an "open loop" for enough days to decde what your max basal setting should be, and also observe how often you disagree or decide to counteract what the loop is recommending. 4 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-dbus.md: -------------------------------------------------------------------------------- 1 | # `openaps-dbus` 2 | 3 | ## Help 4 | usage: openaps-dbus [-h] [--quit] [--name NAME] [--ini_home INI_HOME] 5 | [--create CREATE] 6 | 7 | optional arguments: 8 | -h, --help show this help message and exit 9 | --quit 10 | --name NAME 11 | --ini_home INI_HOME 12 | --create CREATE 13 | -------------------------------------------------------------------------------- /docs/reference/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Reference 3 | ========= 4 | Manuals 5 | ------- 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | :glob: 10 | :titlesonly: 11 | 12 | openaps/index 13 | oref0/index 14 | nightscout/index 15 | mm/index 16 | 17 | For command line tools. 18 | 19 | API 20 | --- 21 | 22 | .. toctree:: 23 | 24 | ../api/index 25 | 26 | -------------------------------------------------------------------------------- /docs/docs/openaps-guide/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Guide to understanding openaps 3 | ----------------------------- 4 | 5 | Welcome to openaps 6 | 7 | .. toctree:: 8 | :maxdepth: 4 9 | 10 | installing 11 | overview 12 | core/devices 13 | core/reports 14 | core/alias 15 | 16 | .. :: 17 | 18 | core/vendors 19 | tutorial 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/ns/ns-dedupe-treatments.md: -------------------------------------------------------------------------------- 1 | # `ns-dedupe-treatments` 2 | 3 | ## Help 4 | Usage: ns-dedupe-treatments --find - No-op version, find out what delete would do. 5 | ns-dedupe-treatments --list - list duplicate count per created_at 6 | ns-dedupe-treatments delete - Delete duplicate entries from 7 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-6/index.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | Phase 6: Iterate and Improve the Closed Loop 4 | -------------------------------------------- 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | 9 | 10 | considerations 11 | keeping-up-to-date 12 | daytime-testing 13 | advanced-features 14 | Configure-Automatic-Sensitivity-Mode 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-1/analyze-existing-data: -------------------------------------------------------------------------------- 1 | # Analyze your existing data 2 | 3 | At this point, it would be helpful to analyze your existing data. Use whichever tools you prefer, but it would be helpful to see if your basal rates are somewhere in the ballpark of being correct; same for ISF and DIA. Consider using Nightscout reports, Dexcom Studio/Clarity, or your tool of choice. 4 | -------------------------------------------------------------------------------- /docs/docs/introduction/index.rst: -------------------------------------------------------------------------------- 1 | Introduction 2 | ------------ 3 | 4 | 5 | Introduction section includes: 6 | 7 | * Understanding This Guide 8 | * Ways to Contribute 9 | * Where to Go For Help With Your Implementation 10 | 11 | .. toctree:: 12 | :maxdepth: 4 13 | 14 | understand-this-guide 15 | conventions 16 | contribute 17 | communication-support-channels 18 | 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Node rules: 2 | ## Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 3 | .grunt 4 | 5 | ## Dependency directory 6 | ## Commenting this out is preferred by some people, see 7 | ## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git 8 | node_modules 9 | 10 | # Book build output 11 | _book 12 | 13 | # eBook build output 14 | *.epub 15 | *.mobi 16 | *.pdf 17 | .*.sw[op] 18 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-mint-max-iob.md: -------------------------------------------------------------------------------- 1 | # `oref0-mint-max-iob` 2 | 3 | ## Help 4 | Usage: 5 | oref0-mint-max-iob max_iob [max_iob.json] 6 | 7 | oref0-mint-max-iob help - this message 8 | Print a perfect max_iob.json. 9 | 10 | 11 | Examples: 12 | $ oref0-mint-max-iob 2 13 | { 14 | "max_iob": 2 15 | } 16 | 17 | $ oref0-mint-max-iob 2 foo.json 18 | max_iob 2 saved in foo.json 19 | bewest@hither:~/src/openaps/oref0$ 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to OpenAPS's documentation! 2 | ============================================== 3 | 4 | .. toctree:: 5 | :maxdepth: 3 6 | :glob: 7 | 8 | docs/introduction/index 9 | docs/walkthrough/index 10 | docs/openaps-guide/index 11 | 12 | Resources 13 | reference/index 14 | 15 | 16 | 17 | 18 | 19 | Indices and tables 20 | ================== 21 | 22 | * :ref:`genindex` 23 | * :ref:`modindex` 24 | * :ref:`search` 25 | 26 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-alias.md: -------------------------------------------------------------------------------- 1 | # `openaps-alias` 2 | 3 | ## Help 4 | usage: openaps-alias [-h] {add,remove,show} ... 5 | 6 | openaps-alias - manage aliases 7 | 8 | optional arguments: 9 | -h, --help show this help message and exit 10 | 11 | ## Alias Menu: 12 | aliases - manage alias configurations 13 | 14 | {add,remove,show} Operation 15 | add add - add an alias 16 | remove remove - remove an alias 17 | show show - show all aliases 18 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-import.md: -------------------------------------------------------------------------------- 1 | # `openaps-import` 2 | 3 | ## Help 4 | usage: openaps-import [-h] [--list] [input] 5 | 6 | openaps-import - import openaps configuration 7 | Import configuration. 8 | 9 | positional arguments: 10 | input Read from stdin 11 | 12 | optional arguments: 13 | -h, --help show this help message and exit 14 | --list, -l Just list types 15 | 16 | Example workflow: 17 | 18 | openaps -C /path/to/another/openaps.ini device show --json ns-upload | openaps import - 19 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0.md: -------------------------------------------------------------------------------- 1 | # `oref0` 2 | 3 | ## Help 4 | Usage: 5 | oref0 6 | 7 | ______ ______ ______ ______ 0 8 | / | | \ | | | \ | | | | 9 | | | | | | |__| | | |---- | |---- 10 | \_|__|_/ |_| \_\ |_|____ |_| 11 | 12 | Valid commands: 13 | oref0 env - print information about environment. 14 | oref0 pebble 15 | oref0 ifttt-notify 16 | oref0 get-profile 17 | oref0 calculate-iob 18 | oref0 meal 19 | oref0 determine-basal 20 | oref0 help - this message 21 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-get.md: -------------------------------------------------------------------------------- 1 | # `openaps-get` 2 | 3 | ## Help 4 | usage: openaps-get [-h] [--version] 5 | [{glucose,basals,help,pump}] 6 | [{simulator,static-file,medtronic,dexcom}] ... 7 | 8 | 9 | 10 | positional arguments: 11 | {glucose,basals,help,pump} 12 | {simulator,static-file,medtronic,dexcom} 13 | args 14 | 15 | optional arguments: 16 | -h, --help show this help message and exit 17 | --version show program's version number and exit 18 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-schedule.md: -------------------------------------------------------------------------------- 1 | # `openaps-schedule` 2 | 3 | ## Help 4 | usage: openaps-schedule [-h] {add,show,remove} ... 5 | 6 | openaps-schedules - manage schedules 7 | 8 | optional arguments: 9 | -h, --help show this help message and exit 10 | 11 | ## Schedule management: 12 | schedules - manage schedules and triggers 13 | 14 | {add,show,remove} Operation 15 | add add - add a scheduled event 16 | show show - show all schedules 17 | remove remove - remove a schedule 18 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-4/create-schedule.md: -------------------------------------------------------------------------------- 1 | ## Using cron to create a schedule for your loop 2 | 3 | You should use [cron](http://bit.ly/1QpJFk1) to create a schedule for your loop. 4 | 5 | There is not more instructions around this at this time, due to the need for you to be very certain you want to automate your loop. That being said, there are some examples and many discussions around this step in the Gitter channel. Look in the web interface and use the search function to see some discussions on this topic, and ask additional questions as needed as you learn about this step. 6 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-1/log-clean-analyze.md: -------------------------------------------------------------------------------- 1 | 2 | # Phase 1: Logging, Cleaning, and Analyzing Your Data 3 | 4 | Phase 1 focuses on accessing, logging, cleaning up, and analyzing data from the pump and CGM. Data fidelity is extremely important, especially when dosing is being considered. Take the time to review what the openaps tools are outputting and carefully compare the logs against your own CareLink and CGM reports. 5 | 6 | By the end of this phase, you should have Nightscout set up; have alerts configured to know whether your system is looping or not; and be analyzing your existing pump or CGM data. 7 | 8 | -------------------------------------------------------------------------------- /scripts/quick-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo apt-get update && sudo apt-get -y upgrade 4 | sudo apt-get install -y git python python-dev python-software-properties python-numpy python-pip nodejs-legacy npm watchdog && \ 5 | ( curl -s https://bootstrap.pypa.io/ez_setup.py | sudo python ) && \ 6 | sudo easy_install -ZU setuptools && \ 7 | sudo easy_install -ZU openaps && \ 8 | sudo easy_install -ZU openaps-contrib && \ 9 | sudo openaps-install-udev-rules && \ 10 | sudo activate-global-python-argcomplete && \ 11 | sudo npm install -g json oref0 && \ 12 | echo openaps installed 13 | openaps --version 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-0/loops-in-progress.md: -------------------------------------------------------------------------------- 1 | # Loops In Progress 2 | 3 | To get you comfortable with submitting a "PR" (stands for pull request), test it out by submitting a PR to this page, adding your name to the list of people who have loops in progress. This way we know how many people are in the development phase, too. 4 | 5 | New to Github, and PRs? Check out how to submit your first PR. 6 | 7 | List of people who are working on closed loops: 8 | 9 | - Dana Lewis 10 | - Ben West 11 | - Chris Hannemann 12 | - Sarah Howard 13 | - Mike Stebbins 14 | - Aaron Michelson 15 | - Jayson EWER --Intel Edison w/ TI--cc1111 16 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.uses.rst: -------------------------------------------------------------------------------- 1 | openaps.uses package 2 | ==================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | openaps.uses.registry module 8 | ---------------------------- 9 | 10 | .. automodule:: openaps.uses.registry 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | openaps.uses.use module 16 | ----------------------- 17 | 18 | .. automodule:: openaps.uses.use 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | 24 | Module contents 25 | --------------- 26 | 27 | .. automodule:: openaps.uses 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-enact.md: -------------------------------------------------------------------------------- 1 | # `openaps-enact` 2 | 3 | ## Help 4 | usage: openaps-enact [-h] [--version] 5 | [{temp-basal,bolus,phone,sms,pipe}] 6 | [{simulator,static-file,medtronic,dexcom}] ... 7 | 8 | Send changes out into the world. 9 | 10 | positional arguments: 11 | {temp-basal,bolus,phone,sms,pipe} 12 | {simulator,static-file,medtronic,dexcom} 13 | args 14 | 15 | optional arguments: 16 | -h, --help show this help message and exit 17 | --version show program's version number and exit 18 | 19 | Make a phone call, send SMS/TEXT, send messages to devices and people. 20 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.glucose.rst: -------------------------------------------------------------------------------- 1 | openaps.glucose package 2 | ======================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | openaps.glucose.convert module 8 | ------------------------------ 9 | 10 | .. automodule:: openaps.glucose.convert 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | openaps.glucose.display module 16 | ------------------------------ 17 | 18 | .. automodule:: openaps.glucose.display 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | 24 | Module contents 25 | --------------- 26 | 27 | .. automodule:: openaps.glucose 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-vendor.md: -------------------------------------------------------------------------------- 1 | # `openaps-vendor` 2 | 3 | ## Help 4 | usage: openaps-vendor [-h] {add,remove,show} ... 5 | 6 | openaps-vendor - Manage vendor plugins. 7 | 8 | optional arguments: 9 | -h, --help show this help message and exit 10 | 11 | ## Vendors Menu: 12 | vendors - manage vendor plugin configurations 13 | 14 | {add,remove,show} Operation 15 | add Add a new vendor plugin to openaps-environment. 16 | remove Remove vendor plugin from openaps-environment 17 | show Show/list vendor plugins 18 | 19 | show - lists all known vendors 20 | add - add a new vendor 21 | remove - remove a vendor 22 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-4/considerations.md: -------------------------------------------------------------------------------- 1 | # Phase 4: Starting to Close the Loop 2 | 3 | Phase 4 focuses on creating a schedule to automate the manual system you developed. Again, at this stage testing is critical and output of the system should be tracked and validated over a series of time, and include thorough edge case testing as you move from communicating with the pump and CGM to closing the loop. Don't test overnight until you are supremely confident in the operation of your system - remembering that you hold responsibility for the setup and operation of your system. You may want to have someone nearby the first time you run the system overnight, in addition to setting alarms to test and watch the system. 4 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-trigger.md: -------------------------------------------------------------------------------- 1 | # `openaps-trigger` 2 | 3 | ## Help 4 | usage: openaps-trigger [-h] {add,show,remove,emit,until} ... 5 | 6 | openaps-triggers - manage triggers 7 | 8 | optional arguments: 9 | -h, --help show this help message and exit 10 | 11 | ## Trigger management: 12 | triggers - manage triggers and triggers 13 | 14 | {add,show,remove,emit,until} 15 | Operation 16 | add add - add a managed Trigger 17 | show show - show all trigger 18 | remove remove - remove a trigger 19 | emit emit - emit a trigger's events 20 | until until - wait until a trigger emits events 21 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-stick.md: -------------------------------------------------------------------------------- 1 | # `mm-stick` 2 | 3 | ## Help 4 | Usage: mm-stick [{scan,diagnose,help},...] 5 | 6 | scan - Print the local location of a plugged in stick. 7 | diagnose - Run python -m decocare.stick $(python -m decocare.scan) 8 | warmup - Runs scan and diagnose with no output. 9 | Exits 0 on success, non-zero exit code 10 | otherwise. 11 | insert - Insert usbserial kernel module. 12 | remove - Remove usbserial kernel module. 13 | udev-info - Print udev information about the stick. 14 | list-usb - List usb information about the stick. 15 | reset-usb - Reset entire usb stack. WARNING, be careful. 16 | fail - Always return a failing exit code. 17 | help - This message. 18 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-2/loop-and-retry-logic.md: -------------------------------------------------------------------------------- 1 | # Running an open loop with oref0 2 | 3 | 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"'`. 4 | 5 | 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. 6 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-6/daytime-testing.md: -------------------------------------------------------------------------------- 1 | # Testing during the day 2 | 3 | You probably started looping for nighttime; but some people also choose to loop during the day. Here are some things to think about: 4 | 5 | * Run the loop over 24 hours collectively in 3 days (doesn't have to be consecutive), and simply observe what the system does when you do meal boluses. You may want to go back to watching determine-basal to see understand what the loop is doing, and understanding `snoozeBG` and similar. 6 | 7 | * Continue to observe the net basal insulin delivery after one week of looping. See what times of day the system is consistently leaving you with neg negative amounts of IOB to counteract or prevent low BGs; again, you may still be overbolusing and/or have basal rates set too high as a baseline. 8 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-decode-history-page.py.md: -------------------------------------------------------------------------------- 1 | # `mm-decode-history-page.py` 2 | 3 | ## Help 4 | usage: mm-decode-history-page.py [-h] [--collate] [--data {glucose,pump}] 5 | [--model {740,751,522,754,554,715,530,551,730,540,722,723,508,523,511,512,515}] 6 | [--larger] [--no-larger] [--out OUT] 7 | infile [infile ...] 8 | 9 | positional arguments: 10 | infile Find dates in this file. 11 | 12 | optional arguments: 13 | -h, --help show this help message and exit 14 | --collate 15 | --data {glucose,pump} 16 | --model {740,751,522,754,554,715,530,551,730,540,722,723,508,523,511,512,515} 17 | --larger 18 | --no-larger 19 | --out OUT Write records here. 20 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-format-ns-profile.md: -------------------------------------------------------------------------------- 1 | # `mm-format-ns-profile` 2 | 3 | ## Help 4 | mm-format-ns-profile: Format known pump data into Nightscout "profile". 5 | 6 | Profile documents allow Nightscout to establish a common set of settings for 7 | therapy, including the type of units used, the timezone, carb-ratios, active 8 | basal profiles, insulin sensitivities, and BG targets. This compiles the 9 | separate pump reports into a single profile document for Nightscout. 10 | 11 | Usage: 12 | mm-format-ns-profile pump-settings carb-ratios active-basal-profile insulin-sensitivities bg-targets 13 | 14 | Examples: 15 | bewest@bewest-MacBookPro:~/Documents/openaps$ mm-format-ns-profile monitor/settings.json monitor/carb-ratios.json monitor/active-basal-profile.json monitor/insulin-sensitivities.json monitor/bg-targets.json 16 | 17 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.cli.rst: -------------------------------------------------------------------------------- 1 | openaps.cli package 2 | =================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | openaps.cli.commandmapapp module 8 | -------------------------------- 9 | 10 | .. automodule:: openaps.cli.commandmapapp 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | openaps.cli.helpers module 16 | -------------------------- 17 | 18 | .. automodule:: openaps.cli.helpers 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | openaps.cli.subcommand module 24 | ----------------------------- 25 | 26 | .. automodule:: openaps.cli.subcommand 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | 32 | Module contents 33 | --------------- 34 | 35 | .. automodule:: openaps.cli 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-6/considerations.md: -------------------------------------------------------------------------------- 1 | # Phase 6: Iterating on Your Closed Loop 2 | 3 | Now that you're looping, congrats! Make sure you follow these steps - you're not done yet. You'll want to let us know that you are looping, and continue testing. 4 | 5 | You in particular may want to test over a 24 hour period in the course of 3 days (doesn't have to be consecutive) to see what the system does when you do meal boluses with the system on, if you are interested in looping during the day. 6 | 7 | Watching the system over long periods of time will help you continue to tweak how you bolus for meals and adjust baseline basals. 8 | 9 | At this point, you can also investigate some of the in-development advanced features, like meal-assist and auto-sensitvitiy adjustment. You can also explore some of the hardware pieces in progress, as noted on the hardware page. 10 | 11 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-5/tuning-targets.md: -------------------------------------------------------------------------------- 1 | # Tuning your targets 2 | 3 | After you adjust your max iob and go beyond low glucose suspend mode, run the system overnight under close observation with the following considerations around targets: 4 | 5 | * You should start with high targets and a good safety margin. For example, you might start with your target at 150 to see how the system does. 6 | 7 | * Before adjusting your target, you should have at least one night with zero low alarms (in three days) before considering dropping the max target below 160. 8 | 9 | * Each time you adjust your target, it should be no more than 5-10 points at a time, again observing the outcomes over a few days. 10 | 11 | If you are going low overnight for three+ days, your "min" target may need to be raised. 12 | 13 | After you tune your targets, min can be set to be equivalent of max. However, when you first start, start with a range (i.e. 150-160). 14 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.alias.rst: -------------------------------------------------------------------------------- 1 | openaps.alias package 2 | ===================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | openaps.alias.add module 8 | ------------------------ 9 | 10 | .. automodule:: openaps.alias.add 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | openaps.alias.alias module 16 | -------------------------- 17 | 18 | .. automodule:: openaps.alias.alias 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | openaps.alias.remove module 24 | --------------------------- 25 | 26 | .. automodule:: openaps.alias.remove 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | openaps.alias.show module 32 | ------------------------- 33 | 34 | .. automodule:: openaps.alias.show 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | 40 | Module contents 41 | --------------- 42 | 43 | .. automodule:: openaps.alias 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.devices.rst: -------------------------------------------------------------------------------- 1 | openaps.devices package 2 | ======================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | openaps.devices.add module 8 | -------------------------- 9 | 10 | .. automodule:: openaps.devices.add 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | openaps.devices.device module 16 | ----------------------------- 17 | 18 | .. automodule:: openaps.devices.device 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | openaps.devices.remove module 24 | ----------------------------- 25 | 26 | .. automodule:: openaps.devices.remove 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | openaps.devices.show module 32 | --------------------------- 33 | 34 | .. automodule:: openaps.devices.show 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | 40 | Module contents 41 | --------------- 42 | 43 | .. automodule:: openaps.devices 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-4/Observing-closed-loop.md: -------------------------------------------------------------------------------- 1 | # Observing the closed loop 2 | 3 | After you have created a schedule with cron, your loop will automatically run. 4 | 5 | ## Starting with low glucose suspend mode 6 | 7 | You may notice that the loop is only going to temp you til your netIOB (this means the net amount of insulin compared to your normal basal rates; so if you temp to 0 and your basal is usually 1.3; you will end up with negative netIOB) returns to 0. This is an important safety feature to help you observe the loop for three days in this mode. 8 | 9 | At this stage, if you consistently see net negative insulin amounts at the same time every day (use Nightscout reports or similar to observe), then you may be over-bolusing for meals and/or your basal rates are too high the 1.5-2 hours before the low BGs are occurring. 10 | 11 | If you observe this, you'll need to tweak your basals or consider how you bolus for meals - your I:C ratio may be off. 12 | 13 | Make sure you check this out before moving to the next stage of tuning the loop. 14 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.vendors.plugins.rst: -------------------------------------------------------------------------------- 1 | openaps.vendors.plugins package 2 | =============================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | openaps.vendors.plugins.add module 8 | ---------------------------------- 9 | 10 | .. automodule:: openaps.vendors.plugins.add 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | openaps.vendors.plugins.remove module 16 | ------------------------------------- 17 | 18 | .. automodule:: openaps.vendors.plugins.remove 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | openaps.vendors.plugins.show module 24 | ----------------------------------- 25 | 26 | .. automodule:: openaps.vendors.plugins.show 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | openaps.vendors.plugins.vendor module 32 | ------------------------------------- 33 | 34 | .. automodule:: openaps.vendors.plugins.vendor 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | 40 | Module contents 41 | --------------- 42 | 43 | .. automodule:: openaps.vendors.plugins 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.vendors.rst: -------------------------------------------------------------------------------- 1 | openaps.vendors package 2 | ======================= 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | openaps.vendors.plugins 10 | 11 | Submodules 12 | ---------- 13 | 14 | openaps.vendors.dexcom module 15 | ----------------------------- 16 | 17 | .. automodule:: openaps.vendors.dexcom 18 | :members: 19 | :undoc-members: 20 | :show-inheritance: 21 | 22 | openaps.vendors.medtronic module 23 | -------------------------------- 24 | 25 | .. automodule:: openaps.vendors.medtronic 26 | :members: 27 | :undoc-members: 28 | :show-inheritance: 29 | 30 | openaps.vendors.process module 31 | ------------------------------ 32 | 33 | .. automodule:: openaps.vendors.process 34 | :members: 35 | :undoc-members: 36 | :show-inheritance: 37 | 38 | openaps.vendors.units module 39 | ---------------------------- 40 | 41 | .. automodule:: openaps.vendors.units 42 | :members: 43 | :undoc-members: 44 | :show-inheritance: 45 | 46 | 47 | Module contents 48 | --------------- 49 | 50 | .. automodule:: openaps.vendors 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.reports.reporters.rst: -------------------------------------------------------------------------------- 1 | openaps.reports.reporters package 2 | ================================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | openaps.reports.reporters.JSON module 8 | ------------------------------------- 9 | 10 | .. automodule:: openaps.reports.reporters.JSON 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | openaps.reports.reporters.base module 16 | ------------------------------------- 17 | 18 | .. automodule:: openaps.reports.reporters.base 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | openaps.reports.reporters.stdout module 24 | --------------------------------------- 25 | 26 | .. automodule:: openaps.reports.reporters.stdout 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | openaps.reports.reporters.text module 32 | ------------------------------------- 33 | 34 | .. automodule:: openaps.reports.reporters.text 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | 40 | Module contents 41 | --------------- 42 | 43 | .. automodule:: openaps.reports.reporters 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-5/beyond-low-glucose-suspend.md: -------------------------------------------------------------------------------- 1 | # Going beyond low glucose suspend mode 2 | 3 | You may have noticed that in the previous phase (4), in observing low glucose suspend mode, the loop did not temp you to get your netIOB above 0. 4 | 5 | Once you have spent several days observing the loop in the previous mode and made sure your basals and bolus strategies are in good shape, you may consider moving to the next step. 6 | 7 | This means adjusting your max iob amount. 8 | 9 | Keep in mind this is one of the key safety features of OpenAPS. You do NOT want this to be a super large amount. The point of this setting is to ensure that the loop can not excessively high temp you; if you need high temps consistently to get you to this amount, your baseline basals are off OR you missed a meal bolus OR you are sick OR there is some other extenuating circumstance; but in all of these cases, they should require manual intervention and you should not expect the loop to solve for this. 10 | 11 | A good rule of thumb is for max iob to be 3 times your highest basal rate. 12 | 13 | (This means it should be approximate to your other settings; not an absolute amount that you set without thinking about it.) 14 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.rst: -------------------------------------------------------------------------------- 1 | openaps package 2 | =============== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | openaps.alias 10 | openaps.cli 11 | openaps.controllers 12 | openaps.devices 13 | openaps.glucose 14 | openaps.monitors 15 | openaps.reports 16 | openaps.suggesters 17 | openaps.uses 18 | openaps.vendors 19 | 20 | Submodules 21 | ---------- 22 | 23 | openaps.builtins module 24 | ----------------------- 25 | 26 | .. automodule:: openaps.builtins 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | openaps.config module 32 | --------------------- 33 | 34 | .. automodule:: openaps.config 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | openaps.configurable module 40 | --------------------------- 41 | 42 | .. automodule:: openaps.configurable 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | openaps.init module 48 | ------------------- 49 | 50 | .. automodule:: openaps.init 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | 56 | Module contents 57 | --------------- 58 | 59 | .. automodule:: openaps 60 | :members: 61 | :undoc-members: 62 | :show-inheritance: 63 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-0/setup.md: -------------------------------------------------------------------------------- 1 | # General Setup and Project Prep 2 | 3 | The setup process is broken into four parts: acquiring the hardware you need; storing baseline data; [configuring the Raspberry Pi](rpi.md) and [installing the openaps tools and dependencies](openaps.md). After completing these steps, you will be able to use the openaps tools to communicate with your insulin pump and CGM. 4 | 5 | At this stage, you may want to begin documenting each step that you take. This will help in two ways. 6 | 7 | First, this enables you to better ask for assistance if you run into errors, bugs, etc. By explaining where you are in the documentation and what you're seeing (by copying and pasting your last command and the output), someone can better provide tips on what you should consider next. 8 | 9 | Second, this will enable you to help us improve our documentation. Did we skip a step, or not explain clearly? After you get through the setup instructions, you should consider forking a copy of these docs, editing with any changes you think should be made, and submitting a pull request (PR) back to the master. Others will be able to review & discuss any edits, make further changes, and pull this edits into the main file. This helps us all "pay it forward" as we go! 10 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-6/keeping-up-to-date.md: -------------------------------------------------------------------------------- 1 | # So you think you're looping? Now keep up to date! 2 | 3 | If you've gone "live" with your loop, congratulations! You'll probably want to keep a very close eye on the system and validate the outputs for a while. (For every person, this amount of time varies). 4 | 5 | One important final step, in addition to continuing to keep an eye on your system, is letting us know that you are looping. 6 | 7 | **This is important in case there are any major changes to the system that we need to notify you about**. One example where this was necessary is when we switched from 2015 to 2016: the dates were incorrectly reporting as 2000, resulting in incorrect IOB calculations. As a result, we needed to notify current loopers so they could make the necessary update/upgrade. 8 | 9 | ## After you have looped for three consecutive nights: 10 | 11 | So that we can notify you if necessary, [please fill out this form if you have been looping for 3+ days](http://bit.ly/nowlooping). Your information will not be shared in any way. You can indicate your preferred privacy levels in the form. As an alternative, if you do not want to input info, please email dana@openaps.org. Again, this is so you can be notified in the case of a major bug find/fix that needs to be deployed. 12 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-press-key.py.md: -------------------------------------------------------------------------------- 1 | # `mm-press-key.py` 2 | 3 | ## Help 4 | usage: mm-press-key.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] 6 | [-v] [--rf-minutes SESSION_LIFE] [--auto-init] [--init] 7 | {act,esc,up,down,easy} [{act,esc,up,down,easy} ...] 8 | 9 | mm-press-key.py - Simulate presses on the keypad. 10 | 11 | positional arguments: 12 | {act,esc,up,down,easy} 13 | buttons to press [default: None)] 14 | 15 | optional arguments: 16 | -h, --help show this help message and exit 17 | --serial SERIAL serial number of pump [default: ] 18 | --port PORT Path to device [default: scan] 19 | --no-op Dry run, don't do main function 20 | --skip-prelude Don't do the normal prelude. 21 | --no-rf-prelude Do the prelude, but don't query the pump. 22 | --skip-postlude Don't do the normal postlude. 23 | -v, --verbose Verbosity 24 | --rf-minutes SESSION_LIFE 25 | How long RF sessions should last 26 | --auto-init Send power ctrl to initialize RF session. 27 | --init Send power ctrl to initialize RF session. 28 | 29 | Press keys on the keypad. 30 | -------------------------------------------------------------------------------- /docs/api/openaps/openaps.reports.rst: -------------------------------------------------------------------------------- 1 | openaps.reports package 2 | ======================= 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | openaps.reports.reporters 10 | 11 | Submodules 12 | ---------- 13 | 14 | openaps.reports.add module 15 | -------------------------- 16 | 17 | .. automodule:: openaps.reports.add 18 | :members: 19 | :undoc-members: 20 | :show-inheritance: 21 | 22 | openaps.reports.invoke module 23 | ----------------------------- 24 | 25 | .. automodule:: openaps.reports.invoke 26 | :members: 27 | :undoc-members: 28 | :show-inheritance: 29 | 30 | openaps.reports.remove module 31 | ----------------------------- 32 | 33 | .. automodule:: openaps.reports.remove 34 | :members: 35 | :undoc-members: 36 | :show-inheritance: 37 | 38 | openaps.reports.report module 39 | ----------------------------- 40 | 41 | .. automodule:: openaps.reports.report 42 | :members: 43 | :undoc-members: 44 | :show-inheritance: 45 | 46 | openaps.reports.show module 47 | --------------------------- 48 | 49 | .. automodule:: openaps.reports.show 50 | :members: 51 | :undoc-members: 52 | :show-inheritance: 53 | 54 | 55 | Module contents 56 | --------------- 57 | 58 | .. automodule:: openaps.reports 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-set-suspend.py.md: -------------------------------------------------------------------------------- 1 | # `mm-set-suspend.py` 2 | 3 | ## Help 4 | usage: mm-set-suspend.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] 6 | [-v] [--rf-minutes SESSION_LIFE] [--auto-init] 7 | [--init] 8 | {query,suspend,resume} [{query,suspend,resume} ...] 9 | 10 | mm-set-suspend.py - query or set suspend/resume status 11 | 12 | positional arguments: 13 | {query,suspend,resume} 14 | Set or query pump status [default: query)] 15 | 16 | optional arguments: 17 | -h, --help show this help message and exit 18 | --serial SERIAL serial number of pump [default: ] 19 | --port PORT Path to device [default: scan] 20 | --no-op Dry run, don't do main function 21 | --skip-prelude Don't do the normal prelude. 22 | --no-rf-prelude Do the prelude, but don't query the pump. 23 | --skip-postlude Don't do the normal postlude. 24 | -v, --verbose Verbosity 25 | --rf-minutes SESSION_LIFE 26 | How long RF sessions should last 27 | --auto-init Send power ctrl to initialize RF session. 28 | --init Send power ctrl to initialize RF session. 29 | 30 | Pause or resume pump. 31 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-bolus.py.md: -------------------------------------------------------------------------------- 1 | # `mm-bolus.py` 2 | 3 | ## Help 4 | usage: mm-bolus.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] [-v] 6 | [--rf-minutes SESSION_LIFE] [--auto-init] [--init] 7 | (--515 | --554 | --strokes STROKES_PER_UNIT) 8 | units 9 | 10 | mm-bolus.py - Send bolus command to a pump. 11 | 12 | positional arguments: 13 | units Amount of insulin to bolus. 14 | 15 | optional arguments: 16 | -h, --help show this help message and exit 17 | --serial SERIAL serial number of pump [default: ] 18 | --port PORT Path to device [default: scan] 19 | --no-op Dry run, don't do main function 20 | --skip-prelude Don't do the normal prelude. 21 | --no-rf-prelude Do the prelude, but don't query the pump. 22 | --skip-postlude Don't do the normal postlude. 23 | -v, --verbose Verbosity 24 | --rf-minutes SESSION_LIFE 25 | How long RF sessions should last 26 | --auto-init Send power ctrl to initialize RF session. 27 | --init Send power ctrl to initialize RF session. 28 | --515 29 | --554 30 | --strokes STROKES_PER_UNIT 31 | 32 | XXX: Be careful please! Units might be wrong. Keep disconnected from pump 33 | until you trust it by observing the right amount first. 34 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-6/advanced-features.md: -------------------------------------------------------------------------------- 1 | # Advanced features 2 | 3 | Once you have several days or weeks of looping during the day and night, you may then want to consider some of the in-development additional features. See below for a high-level overview; and then see subsequent pages for details about setting these up. These are NOT turned on by default, and require manual configuration and additional work to use them. 4 | 5 | ## Meal-assist 6 | 7 | If you choose to enable the optional meal-assist feature, then after you give yourself a meal bolus, the system can high-temp more quickly after a meal bolus IF you enter carbs reliably. So before considering meal-assist, you must be willing to enter carbs reliably, either through the pump's bolus wizard, or through the Nightscout Care Portal. If you don't want to do that, this feature won't be usable. 8 | 9 | Like all features and steps, you'll want to carefully enable, test, and observe the outcomes of this feature. 10 | 11 | ## Auto-sensitivity mode 12 | 13 | Wouldn't it be great if the system knew when you were running sensitive or resistant? That's what we thought, so we created "auto-sensitivity mode". If you explicitly configure this additional feature, it will allow the system to analyze historical data on the go and make adjustments if it recognizes that you are reacting more sensitivite (or conversely, more resistant) to insulin than usual. It will then make micro adjustments to your basals. 14 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-2/considerations.md: -------------------------------------------------------------------------------- 1 | # Phase 2: Creating an Open Loop 2 | 3 | Phase 2 focuses on deploying tools to utilize a suitable algorithm to recommend necessary changes to basal rates. This is essentially an open-loop system, with you completing the loop by manually calculating what you would do in that scenario. This can be performed in real time or by using historical data and making retroactive suggestions. Pay special attention to situations where CGM readings are not smooth (after calibration, with a new sensor, or with errors such as ???) or when there are issues with data connectivity or fidelity. Assume there will be issues with connectivity. 4 | 5 | Note: oref0—short for "OpenAPS Reference Design 0"—is our first (zero-th) implementation of the OpenAPS Reference Design. It consists of a number of "Lego block" tools that, when combined with the core openaps toolset, create a full closed loop artificial pancreas system—an OpenAPS implementation. 6 | 7 | By this stage, you should have already set up your pump and cgm as openaps devices. You will now add the oref0 tools as virtual devices, create openaps reports for commonly used queries and calculations, and add openaps aliases that bring together those reports into higher-level activities. Finally, you can combine those into a single command (or small set of them) that can do everything required to collect data, make a treatment recommendation, and enact it on the pump. You'll also build "preflight" and safety checks into the loop. 8 | -------------------------------------------------------------------------------- /scripts/quick-src.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo apt-get update 4 | sudo apt-get install -y git python python-dev python-software-properties python-numpy python-pip nodejs-legacy npm watchdog && \ 5 | ( curl -s https://bootstrap.pypa.io/ez_setup.py | sudo python ) && \ 6 | sudo npm install -g json && \ 7 | sudo easy_install -ZU setuptools && \ 8 | mkdir ~/src 9 | cd ~/src && \ 10 | ( 11 | git clone -b dev git://github.com/bewest/decoding-carelink.git || \ 12 | (cd decoding-carelink && git pull) 13 | (cd decoding-carelink && \ 14 | sudo python setup.py develop 15 | ) 16 | git clone git://github.com/openaps/dexcom_reader.git || \ 17 | (cd dexcom_reader && git pull) 18 | (cd dexcom_reader && \ 19 | sudo python setup.py develop 20 | ) 21 | git clone -b dev git://github.com/openaps/openaps.git || \ 22 | (cd openaps && git pull) 23 | (cd openaps && \ 24 | sudo python setup.py develop 25 | ) 26 | git clone -b dev git://github.com/openaps/openaps-contrib.git || \ 27 | (cd openaps-contrib && git pull) 28 | (cd openaps-contrib && \ 29 | sudo python setup.py develop 30 | ) 31 | git clone -b dev git://github.com/openaps/oref0.git || \ 32 | (cd openaps-contrib && git pull) 33 | ) 34 | test -d oref0 && \ 35 | cd oref0 && \ 36 | npm install && \ 37 | sudo npm install -g && \ 38 | sudo npm link && \ 39 | sudo npm link oref0 40 | 41 | sudo openaps-install-udev-rules && \ 42 | sudo activate-global-python-argcomplete && \ 43 | openaps --version 44 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-temp-basals.py.md: -------------------------------------------------------------------------------- 1 | # `mm-temp-basals.py` 2 | 3 | ## Help 4 | usage: mm-temp-basals.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] 6 | [-v] [--rf-minutes SESSION_LIFE] [--auto-init] 7 | [--init] [--duration DURATION] [--rate RATE] 8 | [--out OUT] 9 | {query,set,percent} 10 | 11 | mm-temp-basals.py - query or set temp basals 12 | 13 | positional arguments: 14 | {query,set,percent} Set or query pump status [default: query)] 15 | 16 | optional arguments: 17 | -h, --help show this help message and exit 18 | --serial SERIAL serial number of pump [default: ] 19 | --port PORT Path to device [default: scan] 20 | --no-op Dry run, don't do main function 21 | --skip-prelude Don't do the normal prelude. 22 | --no-rf-prelude Do the prelude, but don't query the pump. 23 | --skip-postlude Don't do the normal postlude. 24 | -v, --verbose Verbosity 25 | --rf-minutes SESSION_LIFE 26 | How long RF sessions should last 27 | --auto-init Send power ctrl to initialize RF session. 28 | --init Send power ctrl to initialize RF session. 29 | --duration DURATION Duration of temp rate [default: 0)] 30 | --rate RATE Rate of temp basal [default: 0)] 31 | --out OUT Put basal in this file 32 | 33 | Set or query temp basals. 34 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-set-rtc.py.md: -------------------------------------------------------------------------------- 1 | # `mm-set-rtc.py` 2 | 3 | ## Help 4 | usage: mm-set-rtc.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] [-v] 6 | [--rf-minutes SESSION_LIFE] [--auto-init] [--init] 7 | [--rtc-out RTC_ARCHIVE] [--timezone TIMEZONE] --set SET 8 | [--out OUT] 9 | {query,set} 10 | 11 | mm-set-rtc.py - query or set RTC 12 | 13 | positional arguments: 14 | {query,set} Set or query pump status [default: query)] 15 | 16 | optional arguments: 17 | -h, --help show this help message and exit 18 | --serial SERIAL serial number of pump [default: ] 19 | --port PORT Path to device [default: scan] 20 | --no-op Dry run, don't do main function 21 | --skip-prelude Don't do the normal prelude. 22 | --no-rf-prelude Do the prelude, but don't query the pump. 23 | --skip-postlude Don't do the normal postlude. 24 | -v, --verbose Verbosity 25 | --rf-minutes SESSION_LIFE 26 | How long RF sessions should last 27 | --auto-init Send power ctrl to initialize RF session. 28 | --init Send power ctrl to initialize RF session. 29 | --rtc-out RTC_ARCHIVE 30 | Put clock json in this file 31 | --timezone TIMEZONE Timezone to use 32 | --set SET Set clock to new value (iso8601) 33 | --out OUT Put basal in this file 34 | 35 | Set or query RTC. 36 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-0/baseline-data.md: -------------------------------------------------------------------------------- 1 | # Baseline data 2 | 3 | There is no requirement to share your data to use the openaps toolset or participate in the OpenAPS project. Individuals within the project who share their data do so at will and you should do the same only if you feel comfortable. That being said, it is always a good idea to record your data before embarking on a new set of experiments. This will be helpful to understand the effects of the system as well as gain a better understanding of your response to different control strategies. 4 | 5 | ## CGM Data 6 | 7 | Before getting started, we ask that you store at least 30 days of CGM data. For now, the easiest way to do that is to upload your Dexcom receiver to Dexcom Studio or, if you use a Medtronic CGM, upload your CGM data to CareLink. We suggest you get in the habit of doing this regularly so that you have ongoing data to show trends in your overall estimated average glucose (eAG, a good indicator in trends in A1c) and variations in your "time in range." 8 | 9 | ## Recent A1c 10 | 11 | Go ahead and document your most recent A1c and keep it somewhere handy. This will allow you to compare your before/after results as well as be able to share it (if you choose) once there is a request from OpenAPS researchers, who may aggregate anonymous data to show what happens when people use OpenAPS. 12 | 13 | ## Get comfortable making a PR 14 | 15 | You should be comfortable making a PR to this documentation. If you haven't 16 | ever done this, take a look at 17 | [my first pull request guide](../../Resources/my-first-pr.md) 18 | and try it out. 19 | -------------------------------------------------------------------------------- /docs/docs/openaps-guide/installing.md: -------------------------------------------------------------------------------- 1 | 2 | # Installing openaps 3 | 4 | The recommended way to install openaps is to use python's package management system. 5 | The [openaps] project is distributed on [pypi][openaps on pypi]. 6 | The following apt-get dependencies are required (they can be installed through 7 | variety of means, in debian/ubuntu and apt based systems the following packages 8 | are required: 9 | 10 | sudo apt-get install python python-dev python-pip python-software-properties python-numpy 11 | sudo pip install setuptools 12 | 13 | [openaps]: https://github.com/openaps/openaps 14 | [openaps on pypi]: https://pypi.python.org/pypi/openaps 15 | 16 | #### From pypi 17 | 18 | To [install from pypi](https://pypi.python.org/pypi/openaps): 19 | 20 | sudo easy_install -Z openaps 21 | 22 | This installs `openaps` system wide. 23 | 24 | ##### Updating 25 | To update `openaps`, append the `-U` option: 26 | 27 | sudo easy_install -ZU openaps 28 | 29 | 30 | #### From source 31 | Sometimes, it's useful to use a development version to help test or debug 32 | features. Here's how to install the project from source. 33 | 34 | git clone git://github.com/openaps/openaps.git 35 | cd openaps 36 | # checkout desired branch (dev)? 37 | git checkout dev 38 | sudo python setup.py develop 39 | 40 | Do not use `openaps` commands in the the openaps repo. Only use the 41 | `openaps` directory for hacking on the core library, or for managing 42 | upgrades through git. Running `openaps` inside of the openaps 43 | source directory will error in the best case, and mess up your 44 | `openaps` install in the worst case. 45 | 46 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-report.md: -------------------------------------------------------------------------------- 1 | # `openaps-report` 2 | 3 | ## Help 4 | usage: openaps-report [-h] [--version] {add,remove,show,invoke} ... 5 | 6 | openaps-report - configure reports 7 | 8 | optional arguments: 9 | -h, --help show this help message and exit 10 | --version show program's version number and exit 11 | 12 | ## Reports Menu: 13 | reports - manage report configurations 14 | 15 | {add,remove,show,invoke} 16 | Operation 17 | add add - add a new report configuration 18 | remove remove - remove a device configuration 19 | show show - show all reports 20 | invoke invoke - generate a report 21 | 22 | Manage which devices produce which reports. 23 | 24 | Example workflow: 25 | 26 | Use the add, remove, show to manage which reports openaps knows about. 27 | 28 | The add command adds a new report to the system. 29 | The syntax is: add 30 | 31 | openaps report add my-results.json json pump basals 32 | 33 | This example registers a json output, using the pump basals command, and 34 | stores the result in my-results.json. 35 | 36 | The show command will list or give more details about the reports registered with openaps. 37 | The syntax is: show [name]. The default name is '*' which should list all available reports. 38 | 39 | openaps report show 40 | 41 | The remove command removes the previously configured report from openaps. 42 | The syntax is: remove 43 | 44 | openaps report remove my-results.json 45 | This example removes the report "my-results.json" from the openaps 46 | environment. 47 | 48 | openaps report invoke basals 49 | 50 | -------------------------------------------------------------------------------- /docs/reference/mm/mmcli.md: -------------------------------------------------------------------------------- 1 | # `mmcli` 2 | 3 | ## Help 4 | Usage: 5 | mmcli [OPTION...] - Control and monitor the ModemManager 6 | 7 | Help Options: 8 | -h, --help Show help options 9 | --help-all Show all help options 10 | --help-manager Show manager options 11 | --help-common Show common options 12 | --help-modem Show modem options 13 | --help-3gpp Show 3GPP related options 14 | --help-cdma Show CDMA related options 15 | --help-simple Show Simple options 16 | --help-location Show Location options 17 | --help-messaging Show Messaging options 18 | --help-time Show Time options 19 | --help-firmware Show Firmware options 20 | --help-sim Show SIM options 21 | --help-bearer Show bearer options 22 | --help-sms Show SMS options 23 | 24 | Application Options: 25 | -v, --verbose Run action with verbose logs 26 | -V, --version Print version 27 | -a, --async Use asynchronous methods 28 | --timeout=[SECONDS] Timeout for the operation 29 | 30 | -------------------------------------------------------------------------------- /docs/reference/oref0/oref0-ifttt-notify.md: -------------------------------------------------------------------------------- 1 | # `oref0-ifttt-notify` 2 | 3 | ## Help 4 | Usage: 5 | oref0-ifttt-notify 6 | 7 | ## Setup IFTTT Account 8 | 9 | You need to create an account and connect to the Maker channel and the 10 | notification channel of your choice. I use pushover as I already had the app 11 | and it allows me more control over the notification on my phone. 12 | 13 | ## Create an IF recipe 14 | The trigger is the maker channel. You can customize the notification message 15 | if you wish. 16 | 17 | ## Get the event trigger 18 | On the Maker channel there is a "how to trigger" link. Copy and paste the url 19 | for the example curl command, be sure to change the event name field. 20 | The URL, something like: 21 | 22 | https://maker.ifttt.com/trigger/{event}/with/key/MyKey 23 | 24 | You can pass the IFTTT_TRIGGER, which is the trigger URL as the first 25 | argument, or define it as an environment variable in your crontab. 26 | 27 | Command line: 28 | 29 | oref0-ifttt-notify https://maker.ifttt.com/trigger/{event}/with/key/MyKey 30 | 31 | 32 | Crontab: 33 | IFTTT_TRIGGER=https://maker.ifttt.com/trigger/{event}/with/key/MyKey 34 | 35 | By default oref0-ifttt-notify will check that the stick works, and notify the IFTTT_TRIGGER 36 | endpoint only if the the stick fails to check out. If the stick diagnostics 37 | indicate the carelink stick is working, oref0-ifttt-notify will run: 38 | 39 | openaps use pump model 40 | 41 | You can specify which openaps use command to use in the second argument, or by 42 | setting the IFTTT_NOTIFY_USAGE environment variable in crontab: 43 | 44 | Command line, note the quotes, the second term must be passed as single word. 45 | 46 | oref0-ifttt-notify https://maker.ifttt.com/trigger/{event}/with/key/MyKey 'pump model' 47 | 48 | Crontab: 49 | 50 | IFTTT_NOTIFY_USAGE='pump model' 51 | 52 | Author: @audiefile 53 | -------------------------------------------------------------------------------- /docs/docs/Resources/glossary.md: -------------------------------------------------------------------------------- 1 | # Glossary 2 | 3 | APS - artificial pancreas system. Sometimes also referred to as "AP" 4 | 5 | CGM - continuous glucose monitor, a temporary glucose sensor that is injected into your skin (the needle is removed) for 3-7 days and, with twice a day calibrations, provides BG readings approximately every 5 minutes. 6 | 7 | \#OpenAPS - stands for Open A(rtificial) P(ancreas) S(ystem). It is an open-source movement to develop an artificial pancreas using commercial medical devices, a few pieces of inexpensive hardware, and freely-available software. A full description of the #OpenAPS project can be found at openaps.org. \#OpenAPS (with the hashtag) generally refers to the broad project and open source movement. 8 | 9 | OpenAPS - refers to an example build of the system when used without a hashtag (\#) 10 | 11 | openaps - the core suite of software tools under development by this community for use in an OpenAPS implementation 12 | 13 | Bolus - extra insulin given by a pump, usually to correct for a high BG or for carbohydrates 14 | 15 | Basal - baseline insulin level that is pre-programmed into your pump and mimics the insulin your pancreas would give throughout the day and night 16 | 17 | IOB - Insulin On Board, or insulin active in your body. Note that most commercially available pumps calculate IOB based on bolus activity only. An OpenAPS implementation calculates and refers most often to net IOB, which takes into account any adjusted (higher or lower) basal rates as well as bolus activity. 18 | 19 | DIA - duration of insulin action, or how long the insulin is active in your body. (Ranges 3-6 hours typically) 20 | 21 | CR - carb ratio, or carbohydrate ratio - the amount of carbohydrates for one unit of insulin. Example: 1 u of insulin for 10 carbs 22 | 23 | ISF - insulin sensitivity factor - the amount of insulin that drops your BG by a certain amount mg/dl. Example: 1 u of insulin for 40 mg/dl 24 | 25 | NS, or Nightscout - a cloud-based visualization and remote-monitoring tool. 26 | -------------------------------------------------------------------------------- /docs/docs/introduction/contribute.md: -------------------------------------------------------------------------------- 1 | # Ways to Contribute 2 | 3 | OpenAPS doesn't require you to be a formally trained engineer/developer/anything to get started or use these tools. The main requirement is interest and willingness to safely DIY new technology that may help improve your life as well as others. 4 | 5 | If you're not sure where to get started, here are some ways to get involved: 6 | 7 | * Do a fresh install using this guide and see where you get stuck; if you have to do something off-script, there is a reasonable chance the script is either wrong or your case is "special" and should be accounted for here. [Make edits and submit a pull request](../Resources/my-first-pr.md) to change the document and assist others. 8 | * Additionally, this guide needs more work, always. If there is something that is not documented, do one of two things: a) submit a pull request (see above). or b) log an "issue" ([go here to see the open issues](https://github.com/openaps/docs/issues)) about the section or thing that needs more documentation. 9 | * Ask questions on [gitter]( https://gitter.im/nightscout/intend-to-bolus); if your question wasn't answered in this doc and gets answered there, chances are it should be included here—go ahead and add it to the appropriate section. 10 | * Test the openaps tools for different use cases and report back with your findings. Log files and, if you're comfortable, associated device data (CareLink CSV files, for example) are extremely helpful for debugging. 11 | * Submit issues on GitHub and work with other contributors to get them resolved. 12 | * Develop a plugin to enhance the functionality or ease-of-use of openaps. 13 | * Spread the word about #OpenAPS and get others involved; the more, the merrier. (You can direct them to [OpenAPS.org](http://OpenAPS.org) for more information.) 14 | * Consider calling your device manufacturer and ask about communication protocols in order to understand how your device operates. 15 | 16 | If you would like to work on the core openaps code, take a look at the openaps [contributing guidelines](https://github.com/openaps/openaps/blob/master/CONTRIBUTING.md) before getting started. 17 | -------------------------------------------------------------------------------- /docs/docs/Resources/faq.md: -------------------------------------------------------------------------------- 1 | # Frequently Asked Questions 2 | 3 | ## What is a Closed Loop? 4 | 5 | In general, a "closed loop" system for treatment of diabetes is considered to 6 | be one in which insulin dosing "and in some cases glucagon dosing" is 7 | partially or completely automated. This is in contrast to an "open loop" 8 | system, where the user evaluates the inputs and manually instructs the insulin 9 | pump to dose a specific amount. In both cases, the goal is to maintain blood 10 | glucose within the desired range through adjusting hormone doses. 11 | 12 | There are numerous different types of closed loop systems, ranging from simple 13 | basal suspend systems designed to mitigate extreme hypoglycemia to dual 14 | hormone, fully automated systems. The JDRF [Artificial Pancreas Project 15 | Plan](http://jdrf.org/research/treat/artificial-pancreas-project/) page 16 | provides an overview of the current commercial and academic generation-based 17 | approach. Several commercial systems are currently in development; see 18 | [Commercial APS Efforts](other-projects.md#commercial-aps-efforts) for more 19 | information. 20 | 21 | 22 | \#OpenAPS is focused on a single-hormone hybrid closed-loop system. This is a 23 | system that uses only insulin (no glucagon) and still requires user input for 24 | mealtime insulin. For background on #OpenAPS, review the [\#OpenAPS Reference 25 | Design](http://openaps.org/open-artificial-pancreas-system-openaps-reference-design/) 26 | page. 27 | 28 | ## What does an OpenAPS closed loop look like? 29 | 30 | While there are numerous variations, this particular setup shows the key components—namely, a continuous glucose monitor, an insulin pump, a method for communicating with the pump (here, a CareLink USB stick), and a controller (here, a Raspberry Pi). Also shown is a Pebble watch, which can be used for monitoring the status of the OpenAPS. Not shown is the power supply (off-screen) and a way to interact with and program the Raspberry Pi, typically a computer or smartphone. 31 | 32 | ![Example OpenAPS Setup](../IMG_1112.jpg) 33 | 34 | For more details on the exact hardware required to build an OpenAPS, see the 35 | [Hardware](../walkthrough/phase-0/hardware.md) section. 36 | 37 | -------------------------------------------------------------------------------- /docs/docs/Resources/technical-resources.md: -------------------------------------------------------------------------------- 1 | # Technical Resources 2 | 3 | These represent a small selection of guides, tutorials, and quick references for some of the tools used to develop and document OpenAPS. 4 | 5 | ## Raspberry Pi 6 | [Raspberry Pi Documentation](https://www.raspberrypi.org/documentation/) 7 | 8 | [Pi Filler, Pi Finder, and Pi Copier](http://ivanx.com/raspberrypi/) 9 | 10 | ## Git and GitHub 11 | 12 | [Official Git Documentation](https://git-scm.com/doc) 13 | 14 | [Atlassian (BitBucket) Git Tutorials](https://www.atlassian.com/git/) 15 | 16 | [Code School Interactive Git Introduction](https://try.github.io/) 17 | 18 | [Codecademy Git Course](https://www.codecademy.com/en/courses/learn-git) 19 | 20 | ## Linux Shell / Terminal 21 | 22 | [Learn UNIX in 10 Minutes](http://freeengineer.org/learnUNIXin10minutes.html) 23 | 24 | [Codecademy Command Line Course](https://www.codecademy.com/en/courses/learn-the-command-line) 25 | 26 | [Cron How To Guide](https://help.ubuntu.com/community/CronHowto) 27 | 28 | ## Python 29 | 30 | [Official Python Documentation](https://docs.python.org/2/) 31 | 32 | [Learn Python the Hard Way](http://learnpythonthehardway.org/book/index.html) 33 | 34 | [Automate the Boring Stuff with Python](https://automatetheboringstuff.com/) 35 | 36 | [Codecademy Python Course](https://www.codecademy.com/tracks/python) 37 | 38 | [Python 2.7 Quick Reference](http://rgruet.free.fr/PQR27/PQR2.7.html) 39 | 40 | [NumPy for MATLAB Users](http://mathesaurus.sourceforge.net/matlab-numpy.html) 41 | 42 | ## Useful Apps 43 | 44 | [Fing](http://www.overlooksoft.com/download) (Android and Apple): Identify IP address of devices on a network. Useful for finding the IP address of RPi on new networks. 45 | 46 | [Hotspot Manager](https://play.google.com/store/apps/details?id=com.etustudio.android.hotspotmanager&hl=en) (Android): Itentify IP address of devices on a hotspot. Useful for finding the IP address of RPi on hotspots. 47 | 48 | [JuiceSSH](https://play.google.com/store/apps/details?id=com.sonelli.juicessh&hl=en) (Android): SSH client for Android devices 49 | 50 | ## Markdown syntax 51 | [Daring Fireball (John Gruber) Markdown Introduction](http://daringfireball.net/projects/markdown/) 52 | 53 | [Macdown](http://macdown.uranusjr.com/): Open-source Markdown editor for OS X 54 | 55 | [StackEdit](https://stackedit.io/): Online Markdown editor 56 | 57 | -------------------------------------------------------------------------------- /docs/docs/introduction/communication-support-channels.md: -------------------------------------------------------------------------------- 1 | # Where to go for help with your implementation 2 | 3 | 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. 4 | 5 | **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. 6 | 7 | ### Gitter 8 | [Gitter](https://gitter.im/) is a messaging/chat service similar to IRC. It provides integration with GitHub and several other services. 9 | 10 | * The [nightscout/intend-to-bolus]( https://gitter.im/nightscout/intend-to-bolus) channel is where you will find active #OpenAPS discussions ranging from technical issues with openaps tools to control theory to general information. It is a great place to introduce yourself and get some help from those who are a few steps further down the road. 11 | * For TI stick communication, use the [oskarpearson/mmeowlink channel](https://giter.im/oskarpearson/mmeowlink) 12 | * For RileyLink conversations, use the [ps2/rileylink channel](https://gitter.im/ps2/rileylink) 13 | * For LoopKit conversations, use the [loudnate/LoopKit channel](https://gitter.im/loudnate/loopkit) 14 | 15 | ### Google Groups 16 | A private google group focused on #OpenAPS development work can be found [here](https://groups.google.com/d/forum/openaps-dev). Request access to participate and see some of the archived discussions. If you're new, make sure to introduce yourself! 17 | 18 | ### Issues on openaps GitHub 19 | For reporting issues on the openaps tools formally, the openaps [issues page](https://github.com/openaps/openaps/issues) on GitHub is the proper forum. Feel free to try and get through the issues by working with others on the Gitter channel first if you think it may be something unrelated to the codebase. 20 | 21 | ### Other online forums 22 | Those in the #OpenAPS community are frequently found in other forums, such as on Twitter (using [the #OpenAPS hashtag](https://twitter.com/search?f=tweets&vertical=default&q=%23OpenAPS&src=typd), as well as [#WeAreNotWaiting](https://twitter.com/search?f=tweets&vertical=default&q=%23WeAreNotWaiting&src=typd)) and on Facebook in the ["CGM In The Cloud"](https://www.facebook.com/groups/cgminthecloud/) group. 23 | 24 | There is also a [Slack channel](https://omniapsslack.azurewebsites.net/) to discuss communication around other pumps that are being explored for being used for other DIY closed loops. 25 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-0/openaps.md: -------------------------------------------------------------------------------- 1 | # Setting Up openaps and Dependencies 2 | 3 | This section provides information on installing the base openaps toolkit and its dependencies. 4 | 5 | ## Easy install of openaps and dependencies 6 | 7 | ### Using the package manager 8 | 9 | This is the recommended way to install: 10 | 11 | `curl -s https://raw.githubusercontent.com/openaps/docs/master/scripts/quick-packages.sh | bash -` 12 | 13 | This uses [this script](https://raw.githubusercontent.com/openaps/docs/master/scripts/quick-packages.sh) to install all the dependencies in one step. 14 | 15 | If the install was successful, the last line will say something like:
16 | 17 | openaps 0.0.9 (although the version number may have been incremented) 18 | 19 | If you do not see this or see error messages, try running the script multiple times. 20 | 21 | ### Installing from source 22 | 23 | It's possible to use the package manager to install development branches. If you are hacking on the code, you'll need a way to develop using versions you control. Here's a quick way to do that: 24 | 25 | `curl -s https://raw.githubusercontent.com/openaps/docs/master/scripts/quick-src.sh | bash -` 26 | 27 | If successful, the last line will say something like:
28 | 29 | openaps 0.0.10-dev (although the version number may have been incremented) 30 | 31 | 32 | 33 | ## Manual install [optional] 34 | ### Install Python and Node.js Packages System-Wide [optional] 35 | 36 | Run 37 | 38 | `sudo apt-get install python python-dev python-setuptools python-software-properties python-numpy python-pip nodejs-legacy npm` 39 | 40 | This installs a number of packages required by openaps. 41 | 42 |
43 | ### Install openaps [optional] 44 | 45 | Run 46 | 47 | `sudo easy_install -ZU setuptools` 48 | 49 | `sudo easy_install -ZU openaps` 50 | 51 | Running this command will also update openaps on your system if a newer version is available. 52 | 53 |
54 | ### Install udev-rules [optional] 55 | 56 | Run 57 | 58 | `sudo openaps-install-udev-rules` 59 | 60 | 61 |
62 | ### Enable Tab Completion [optional] 63 | 64 | Run 65 | 66 | `sudo activate-global-python-argcomplete` 67 | 68 |
69 | ## Set up Git 70 | 71 | Run 72 | 73 | `sudo apt-get install git` 74 | 75 | In order to set your git account's default identity, you will need to run the following two commands: 76 | 77 | `git config --global user.email "you@example.com"` 78 | 79 | `git config --global user.name "Your Name"` 80 | 81 | replace `you@example.com` and `Your Name` with your own information, but keep the quotes. 82 | 83 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-latest.py.md: -------------------------------------------------------------------------------- 1 | # `mm-latest.py` 2 | 3 | ## Help 4 | usage: mm-latest.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] [-v] 6 | [--rf-minutes SESSION_LIFE] [--auto-init] [--init] 7 | [--no-clock] [--no-basal] [--no-temp] [--no-reservoir] 8 | [--no-status] [--parser-out PARSED_DATA] 9 | [--rtc-out RTC_ARCHIVE] 10 | [--reservoir-out RESERVOIR_ARCHIVE] 11 | [--settings-out SETTINGS] 12 | [--temp-basal-status-out TEMPBASAL] [--basals-out BASALS] 13 | [--status-out STATUS] [--timezone TIMEZONE] 14 | [minutes] 15 | 16 | mm-latest.py - Grab latest activity 17 | 18 | positional arguments: 19 | minutes [default: 30)] 20 | 21 | optional arguments: 22 | -h, --help show this help message and exit 23 | --serial SERIAL serial number of pump [default: ] 24 | --port PORT Path to device [default: scan] 25 | --no-op Dry run, don't do main function 26 | --skip-prelude Don't do the normal prelude. 27 | --no-rf-prelude Do the prelude, but don't query the pump. 28 | --skip-postlude Don't do the normal postlude. 29 | -v, --verbose Verbosity 30 | --rf-minutes SESSION_LIFE 31 | How long RF sessions should last 32 | --auto-init Send power ctrl to initialize RF session. 33 | --init Send power ctrl to initialize RF session. 34 | --no-clock Also report current time on pump. 35 | --no-basal Also report basal rates. 36 | --no-temp Also report temp basal rates. 37 | --no-reservoir Also report remaining insulin in reservoir. 38 | --no-status Also report current suspend/bolus status. 39 | --parser-out PARSED_DATA 40 | Put history json in this file 41 | --rtc-out RTC_ARCHIVE 42 | Put clock json in this file 43 | --reservoir-out RESERVOIR_ARCHIVE 44 | Put reservoir json in this file 45 | --settings-out SETTINGS 46 | Put settings json in this file 47 | --temp-basal-status-out TEMPBASAL 48 | Put temp basal status json in this file 49 | --basals-out BASALS Put basal schedules json in this file 50 | --status-out STATUS Put status json in this file 51 | --timezone TIMEZONE Timezone to use 52 | 53 | Query pump for latest activity. 54 | -------------------------------------------------------------------------------- /docs/docs/openaps-guide/core/alias.md: -------------------------------------------------------------------------------- 1 | 2 | # Alias - shortcut for any command 3 | 4 | An **alias** allows us to assign a nickname to any command or group of 5 | commands. It's very similar to [git alias], let's take a look at the `openaps 6 | alias --help` output: 7 | 8 | 9 | 10 | ``` 11 | usage: openaps-alias [-h] {add,remove,show} ... 12 | 13 | openaps-alias - manage aliases 14 | 15 | optional arguments: 16 | -h, --help show this help message and exit 17 | 18 | ## Alias Menu: 19 | aliases - manage alias configurations 20 | 21 | {add,remove,show} Operation 22 | add add - add an alias 23 | remove remove - remove an alias 24 | show show - show all aliases 25 | ``` 26 | 27 | 28 | Let's try a very trivial example with hello world again, `echo hello world` as an alias: 29 | 30 | Adding an alias takes a name, and an alias definition (the commands to run). 31 | The commands to run may be any command inside `openaps` toolkit, or if it 32 | starts with a bang (`!`), it can run any arbitrary tool available on the 33 | system. 34 | 35 | ## Hello world example 36 | ``` 37 | $ openaps alias add echo "! bash -c \"echo hello \$1\" --" 38 | added echo ! bash -c "echo hello $1" -- 39 | $ openaps echo HUMAN 40 | hello HUMAN 41 | ``` 42 | ## Openaps example 43 | We can "rename" commands this way, for example we can alias `openaps invoke` to `openaps report invoke`: 44 | 45 | ``` 46 | $ openaps alias add invoke "report invoke" 47 | added invoke report invoke 48 | $ openaps invoke fake-cgm-data.txt fake-oref0-data.txt 49 | fake-cgm://JSON/shell/fake-cgm-data.txt 50 | reporting fake-cgm-data.txt 51 | fake-oref0://JSON/shell/fake-oref0-data.txt 52 | reporting fake-oref0-data.txt 53 | ``` 54 | 55 | ## Grouping commands logically 56 | We can also group large groups of command invocations into one simple alias: 57 | ```bash 58 | $ openaps alias add gather-all-fake \ 59 | "report invoke howdy.txt fake-pump-data.txt fake-cgm-data.txt fake-oref0-data.txt" 60 | added gather-all-fake report invoke howdy.txt fake-pump-data.txt fake-cgm-data.txt fake-oref0-data.txt 61 | ``` 62 | ```bash 63 | $ openaps gather-all-fake 64 | howdy://text/shell/howdy.txt 65 | reporting howdy.txt 66 | fake-pump://JSON/shell/fake-pump-data.txt 67 | reporting fake-pump-data.txt 68 | fake-cgm://JSON/shell/fake-cgm-data.txt 69 | reporting fake-cgm-data.txt 70 | fake-oref0://JSON/shell/fake-oref0-data.txt 71 | reporting fake-oref0-data.txt 72 | ``` 73 | 74 | An alias runs all the commands associated with it's definition. 75 | It's the same as running the commands themselves. 76 | 77 | [git alias]: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases 78 | 79 | -------------------------------------------------------------------------------- /docs/docs/introduction/understand-this-guide.md: -------------------------------------------------------------------------------- 1 | 2 | # Understanding this guide 3 | 4 | Some conventions used in this guide: 5 | 6 | * Wherever you see text that is formatted `like this`, it is a code snippet. You should copy and paste instead of attempting to type this out; this will save you debugging time for finding your typos. 7 | * You will see a $ at the beginning of many of the lines of code. This 8 | indicates that it is to be entered and executed at the terminal prompt. Do not type in the dollar sign $. 9 | * Wherever there are `` in the the code, these are meant for you to insert your own information. Most of the time, it doesn't matter what you choose **as long as you stay consistent throughout this guide**. That means if you choose `Barney` as your ``, you must use `Barney` every time you see ``. Choose carefully. Do not include the `< >` brackets in your name. 10 | 11 | ### Before you get started 12 | 13 | Some familiarity with using the terminal will go a long way, so if you aren't comfortable with what `cd` and `ls` do, take a look at some of the Linux Shell / Terminal commands on the [Troubleshooting](../Resources/troubleshooting.md) page and the reference links on the [Technical Resources](../Resources/technical-resources.md) page. 14 | 15 | One helpful thing to do before starting any software work is to log your terminal session. This will allow you to go back and see what you did at a later date. This will also be immensely helpful if you request help from other OpenAPS contributors as you will be able to provide an entire history of the commands you used. To enable this, just run `$ script ` at the beginning of your session. It will inform you that `Script started, file is `. When you are done, simply `$ exit` and it will announce `Script done, file is `. At that point, you can review the file as necessary. 16 | 17 | ### What you won't see in this guide 18 | 19 | You won't see a full loop where you can just download the code, press a button, and have a live loop. There are many places where there are examples, and instructions, but you must do the work to understand how to communicate between devices and transfer data between reports and files. This is key for helping you understand what you are building and how it will work. 20 | 21 | In some cases, the documentation needs to be built out further, with easier to understand language and more examples. However, there are a few things (like a full `cron` example) that are not included in this guide, and intentionally so in order to ensure that you have full intent and autonomy in building your system for yourself. 22 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps-use.md: -------------------------------------------------------------------------------- 1 | # `openaps-use` 2 | 3 | ## Help 4 | usage: openaps-use [-h] [--format {text,json,base,stdout}] [--output OUTPUT] 5 | [--version] 6 | device ... 7 | 8 | openaps-use - use a registered device 9 | 10 | optional arguments: 11 | -h, --help show this help message and exit 12 | --format {text,json,base,stdout} 13 | --output OUTPUT 14 | --version show program's version number and exit 15 | 16 | Known Devices Menu: 17 | These are the devices openaps knows about: 18 | 19 | device Name and description: 20 | black Medtronic - openaps driver for Medtronic 21 | blue Medtronic - openaps driver for Medtronic 22 | calculate-iob process - a fake vendor to run arbitrary commands 23 | cat process - a fake vendor to run arbitrary commands 24 | cgm Dexcom - openaps driver for dexcom 25 | curl process - a fake vendor to run arbitrary commands 26 | determine-basal process - a fake vendor to run arbitrary commands 27 | dx-format-oref0-glucose 28 | process - a fake vendor to run arbitrary commands 29 | format-latest-nightscout-treatments 30 | process - a fake vendor to run arbitrary commands 31 | get-profile process - a fake vendor to run arbitrary commands 32 | howdy process - a fake vendor to run arbitrary commands 33 | iob process - a fake vendor to run arbitrary commands 34 | latest-treatments process - a fake vendor to run arbitrary commands 35 | mine process - a fake vendor to run arbitrary commands 36 | munge mmhistorytools - tools for cleaning, condensing, and 37 | reformatting history data 38 | my-agp AGP - calculate agp values given some glucose text 39 | newone process - a fake vendor to run arbitrary commands 40 | ns-glucose process - a fake vendor to run arbitrary commands 41 | ns-upload process - a fake vendor to run arbitrary commands 42 | oref0 process - a fake vendor to run arbitrary commands 43 | plugins Plugins - Community maintained plugins to openaps 44 | predict predict - tools for predicting glucose trends 45 | pump mmeowlink - openaps driver for cc1111/cc1110 devices 46 | share openxshareble - pure python driver to communicate with 47 | Dexcom G4+Share over ble. Allows openaps to use ble to 48 | talk to Dexcom G4+Share. 49 | tz Timezones - manage timezones in diabetes data with 50 | ease. 51 | units Units - units tool for openaps 52 | 53 | Once a device is registered in openaps.ini, it can be used. 54 | -------------------------------------------------------------------------------- /docs/docs/Resources/other-projects.md: -------------------------------------------------------------------------------- 1 | # Other People, Projects & Tools 2 | 3 | ## People 4 | 5 | These people have publicly identified as either supporting or running OpenAPS implementations and are sharing their experiences publicly. See below links. 6 | 7 | Dana Lewis - blogs about personal experience at [DIYPS.org](http://DIYPS.org) and shares on Twitter as [@DanaMLewis](http://twitter.com/danamlewis). 8 | 9 | Scott Leibrand - contributes to Dana's instance of OpenAPS, and is on Twitter as [@ScottLeibrand](http://twitter.com/scottleibrand). (Scott and Dana collectively maintain [OpenAPS.org](http://openaps.org).) 10 | 11 | Ali Mazaheri - shares on Twitter as [@AliMazaheri](http://twitter.com/alimazaheri) 12 | 13 | Chris Hannemann - shares on Twitter as [@hannemannemann](http://twitter.com/hannemannemann) 14 | 15 | Nate Racklyeft - shares on Twitter as [@LoudNate](http://twitter.com/loudnate) 16 | 17 | Ben West - author of decoding-carelink and much of the openaps toolkit - on Twitter as [@bewestisdoing](http://twitter.com/bewestisdoing) 18 | 19 | 20 | The following provide links to other related projects as well as commercial artificial pancreas work underway. 21 | 22 | ## APS & Diabetes Data Tools 23 | 24 | * **\#DIYPS** (http://diyps.org/) - the project and personal experience that inspired #OpenAPS 25 | 26 | * **simPancreas** (http://bustavo.com/category/simpancreas/) - another DIY closed loop, although not #OpenAPS related 27 | 28 | * **NightScout** (http://www.nightscout.info/) - a visualization and remote monitoring tool for people with diabetes using CGM 29 | 30 | * **xDrip** (http://stephenblackwasalreadytaken.github.io/xDrip/) - a DIY combination of a device and a software application which receives data sent out by a Dexcom G4 CGM transmitter/sensor and displays the glucose readings on an Android phone 31 | 32 | * **RileyLink** (https://github.com/ps2/rileylink)
33 | A custom designed Bluetooth Smart (BLE) to 916MHz module. It can be used to bridge any BLE capable smartphone to the world of 916Mhz based devices. This project is focused on talking to Medtronic insulin pumps and sensors. There is also a Gitter channel dedicated to discussion on the RileyLink [here](https://gitter.im/ps2/rileylink). 34 | 35 | * **Tidepool** (http://tidepool.org/ and https://github.com/tidepool-org)
36 | Notably, work on Boston University iLet UI (https://github.com/tidepool-org/bionicpancreas) and open-source tools for visualization. 37 | 38 | * **Perceptus** (http://perceptus.org) - more data visualization tools 39 | 40 | 41 | # Commercial APS Efforts 42 | 43 | There are currently several commercial closed-loop products in development by old and new companies in the diabetes treatment space. These include: 44 | 45 | * [Medtronic MiniMed 640G](https://www.medtronic-diabetes.com.au/insulin-pumps/640g) 46 | * [Medtronic MiniMed 670G](http://diatribe.org/drugdevice-name/medtronic-minimed-670g) 47 | * [TypeZero Technologies](http://www.typezero.com/) 48 | * [Bigfoot Biomedical](http://www.bigfootbiomedical.com/) 49 | * [Boston University's iLet, formerly known as the "Bionic Pancreas"](http://sites.bu.edu/bionicpancreas/) 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/Resources/my-first-pr.md: -------------------------------------------------------------------------------- 1 | ### Making your first PR (pull request) 2 | 3 | At some point it will be suggested to you that you make a PR. PR is short for pull request. 4 | It's actually not too hard to do one and it is a great way to contribute. This documentation is here because people like you made PRs. 5 | 6 | * The general idea is to make edits and improvements to code or document by making a copy of the repository you'd like to change. 7 | * Double checking that they your edits look good to you on your copy. 8 | * Make a few notes for what you did so people can understand why you made the change. 9 | * Then do a pull request, which is to ask the administrataors of the repository to pull your changes 10 | back into the dev branch of the main repository. 11 | * At which time they will do a quick review and merge your changes in. 12 | 13 | OK, let's get started. For our example we are going to make an edit to the openaps docs repository. 14 | 15 | 1. Go to https://github.com/openaps/docs and hit Fork in the upper right to make your own copy of the repository. 16 | 2. Github will automatically take you to your copy (notice in the address bar you are now in your own personal github directory) 17 | 3. In the branch drop down on the upper left of the page we are going to select the dev branch, since that is the one we want to edit. 18 | 4. Now we need to find the file we want to edit. Click through the directory structure until you find and are looking at the content of the file you want to change. 19 | 5. Next, press the pencil icon in the upper right next to the trash can icon. 20 | 6. Make edits to the file as necessary. 21 | 7. Next we want to commit our changes. But first we should note what we changed and why. Be sure to put a one liner explaining the why of making the changes you did. 22 | 8. Commit the changes. 23 | 9. Now look and make sure everyting you changed looks like you meant it to (no typos, etc). If any problems, go back and edit again and save again. 24 | 25 | We now have an improved file that we want to be pulled back into the dev repository at https://github.com/openaps/docs 26 | 27 | 1. Go to https://github.com/openaps/docs 28 | 2. Select dev from the branch drop down on the upper left (since that's where we'd like the changes to go to) 29 | 3. Press the pull request button 30 | 4. Set up the the branches you are targeting. The easiest way of thinking about the branch range is this: the base branch is where you think changes should be applied, the head branch is what you would like to be applied. 31 | 5. So choose so the base fork as openaps/docs and then the base as dev. The head fork is going to be /docs and the base as dev. 32 | 6. It should show the list of changes you made. If not, you did something wrong so stop here and ask for help. If the list looks like your changes then put a note in there to what the overarching reason for the changes are (in your case you only made one, but you could have made a bunch). Create the PR. 33 | 34 | It will now be in a list of PR's that the team will review and potentially give feedback on before committing to the main documentation for openaps! 35 | 36 | Congrats, you made your first contribution! 37 | 38 | PS, your fork will still be sitting on your own personal github account. You can delete it if you are done with it. In the future, be sure to pull a fresh copy from github.com/openaps/docs before making new edits. 39 | -------------------------------------------------------------------------------- /docs/docs/Resources/history.md: -------------------------------------------------------------------------------- 1 | ## OpenAPS Overview and Project History 2 | 3 | In order to relieve the incredible burden of T1D, many research teams and manufacturers have developed and are testing Artificial Pancreas Systems (APSs) that connect CGMs to insulin pumps and use various algorithms to automatically adjust insulin dosing (and sometimes dose glucagon, a counter-regulatory hormone) to attempt to mimic some of the functions of a healthy pancreas, and keep blood sugar levels in a safe range. While quite successful in clinical trials so far, current APS systems have been in development for many years, and are still likely at least 3 years away from FDA approval. It is also unclear whether first-generation APS technology will be suitable for, or available to, all patients, even in rich countries. 4 | 5 | To address some of the challenges of daily life with diabetes, and because #WeAreNotWaiting, several people worked to figure out how to connect up existing FDA-approved medical devices such as the Dexcom G4 CGM and the Medtronic Minimed insulin pump, using commodity computer / mobile phone hardware and open-source software, to create a complete closed loop Artificial Pancreas System (APS). The first public example of this was the [#DIYPS closed loop system](http://diyps.org), created in their spare time by [@DanaMLewis](http://twitter.com/danamlewis) and [@ScottLeibrand](http://twitter.com/scottleibrand) in the fall of 2013 based on their earlier work to build the #DIYPS remote monitoring and decision assist system. #DIYPS used the [Nightscout project’s](http://nightscout.info) uploader to get Dexcom CGM data off the device. #DIYPS was able to become a closed loop with the help of open-source [decoding-carelink project](http://www.github.com/bewest/decoding-carelink) created by [@Ben West](http://twitter.com/bewestisdoing) to communicate with Medtronic insulin pumps, retrieve data and issue insulin-dosing commands to pumps that support it. #DIYPS was the base system that led to #OpenAPS. 6 | 7 | In light of the success of #DIYPS closed loop and other simple APS systems built by individuals, Dana and Scott decided to further apply the #WeAreNotWaiting ethos to APS research, believing safe and effective APS technology can be made available more quickly and to more people, rather than just waiting for current APS efforts to complete clinical trials and be FDA-approved and commercialized through traditional processes. 8 | 9 | \#OpenAPS is an open reference design for, and will be a reference implementation of, an overnight closed loop APS system that uses the CGM sensors’ estimate of blood glucose (BG) to automatically adjust basal insulin levels, in order to keep BG levels inside a safe range overnight and between meals. 10 | 11 | \#OpenAPS is not intended to be a “set and forget” APS system. To maximize safety, a system designed from OpenAPS only doses basal insulin. Users still need to bolus for meals as they do today. However, OpenAPS can identify deviations from predicted blood sugar changes and change basal rates to prevent dangerous drops or rises that deviate from expected behavior. 12 | 13 | After launching in early 2015, there are at least 44 known instances of OpenAPS that are live and running (as of March 23, 2016), with several others in development and testing phases. For anecdotal experiences from those running OpenAPS, watch the [#OpenAPS hashtag on Twitter](https://twitter.com/search?f=tweets&vertical=default&q=%23OpenAPS&src=typd) and also check out the [Resources](../Resources/resources.md) section for a list of those sharing their experiences publicly. 14 | 15 | In early 2016, progress continues to be made with the iteration of several hardware options, in addition to multiple new software features. 16 | -------------------------------------------------------------------------------- /docs/reference/openaps/openaps.md: -------------------------------------------------------------------------------- 1 | # `openaps` 2 | 3 | ## Help 4 | usage: openaps [-h] [-c C C] [-C CONFIG] [--version] [command] ... 5 | 6 | openaps - openaps: a toolkit for DIY artificial pancreas system 7 | 8 | positional arguments: 9 | command 10 | args 11 | 12 | optional arguments: 13 | -h, --help show this help message and exit 14 | -c C C 15 | -C CONFIG, --config CONFIG 16 | --version show program's version number and exit 17 | 18 | Utilities for developing an artificial pancreas system. 19 | openaps helps you manage and structure reports for various devices. 20 | 21 | .-. .,-. .-. .--. .-. .,-. .--. 22 | ( )| )(.-' | |( ) | )`--. 23 | `-' |`-' `--'' `-`-'`-|`-' `--' 24 | | | 25 | ' ' 26 | Common workflows: 27 | 28 | Getting started: 29 | 30 | openaps init - create a new instance of openaps 31 | openaps init myopenaps - this creates an instance of openaps in a new 32 | directory, called myopenaps 33 | 34 | cd myopenaps - change directory to root of new repo 35 | 36 | A valid instance of openaps is a git repo with a file called 37 | openaps.ini present. 38 | 39 | openaps will track configuration and some status information inside of 40 | openaps.ini. If you already have a git repo which you would like to 41 | become a valid openaps environent, in the root of your repo, run: 42 | 43 | touch openaps.ini 44 | git add openaps.ini 45 | git commit -avm 'init openaps' 46 | 47 | Now, wth a valid openaps environment, you can register devices for 48 | use. A device is implemented by a vendor. openaps [will] provide a 49 | modular, language and process independent environment for creating 50 | vendors and devices, but for now the only two are dexcom and 51 | medtronic. 52 | 53 | To register devices for use, see: 54 | openaps device -h 55 | openaps device add [opts...] 56 | eg: 57 | # register a medtronic device named pump 58 | openaps device add pump medtronic 665455 59 | # register a dexcom device named cgm 60 | openaps device add cgm dexcom 61 | 62 | Now that devices are known, and we have a variety of commands 63 | available. We can explore how to produce reports by using devices 64 | with the openaps use command: 65 | 66 | openaps use [opts] 67 | 68 | openaps use commands can only be used after devices have been added to 69 | the openaps.ini config using openaps device add. 70 | Eg: 71 | openaps use pump -h - show available commands for the 72 | device known as "pump" 73 | openaps use pump iter_pump - get last 100 pump history records 74 | from the device called pump 75 | openaps use cgm -h - show available commands for the 76 | device known as "cgm" 77 | openaps use cgm glucose 78 | 79 | After experimenting with openaps use commands, users can save reports 80 | using the openaps report commands. 81 | openaps report commands map openaps use commands to filenames: 82 | 83 | openaps report add [opts] 84 | 85 | # add a report, saved in a file called pump-history.json, which is 86 | # JSON format, from device pump using use iter_pump. 87 | openaps report add pump-history.json JSON pump iter_pump 88 | 89 | # add a report, saved in a file called glucose.json, which is 90 | # JSON format, from device cgm using use glucose. 91 | openaps report add glucose.json JSON cgm glucose 92 | 93 | # invoke the report to create glucose.json 94 | openaps report invoke glucose.json 95 | 96 | # invoke the report to create pump-history.json 97 | openaps report invoke pump-history.json 98 | 99 | All commands support tab completion, and -h help options to help 100 | explore the live help system. 101 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-2/building-preflight-safety-checks.md: -------------------------------------------------------------------------------- 1 | # Building preflight and other safety checks 2 | 3 | Before moving on to consolidating all of these capabilities into a single alias, it is a good idea to add some error checking. 4 | 5 | * There are several potential issues that may adveresely affect operation of the system. For example, RF communication with the pump may be compromised. It has also been observed that the CareLink USB stick may become unresponsive or "dead", requiring a reset of the USB ports. Furthermore, in general, the system should not act on stale data. Let's look at some approaches you may consider to address these issues. 6 | 7 | Ensuring that your openaps implementation can't act on stale data could be done by deleting all of the report files in the `monitor` directory before the reports are refreshed. YOu may simply use `rm -f` bash command, which removes file(s), while ignoring cases when the file(s) do not exist. If a refresh fails, the data required for subsequent commands will be missing, and they will fail to run. For example, here is an alias that runs the required bash commands: 8 | 9 | ``` 10 | openaps alias add gather '! bash -c "rm -f monitor/*; openaps gather-profile && openaps monitor-cgm && openaps monitor-pump && openaps report invoke monitor/iob.json"' 11 | ``` 12 | 13 | This example also shows how an alias can be constructed using bash commands. First, all files in `monitor` directory are deleted. Then, aliases are executed to generate the required reports. A similar approach can be used to remove any old `suggested.json` output before generating a new one, and to check and make sure oref0 is recommending a temp basal before trying to set one on the pump. You may want to make sure that your `enact` alias includes these provisions. 14 | 15 | It's also worthwhile to do a "preflight" check that verifies a pump is in communication range and that the pump stick is functional before trying anything else. The oref0 `mm-stick` command can be used to check the status of the MM CareLink stick. In particular, `mm-stick warmup` scans the USB port and exits with a zero code on success, and non-zero otherwise. Therefore, 16 | 17 | ``` 18 | $ mm-stick warmup || echo FAIL 19 | ``` 20 | 21 | will output "FAIL" if the stick is unresponsive or disconnected. You may simply disconnect the stick and give this a try. If the stick is connected but dead, `oref0-reset-usb` command can be used to reset the USB ports 22 | 23 | ``` 24 | $ sudo oref0-reset-usb 25 | ``` 26 | 27 | Beware, this command power cycles all USB ports, so you will temporarily loose connection to a WiFi stick and any other connected USB device. 28 | 29 | Checking for RF connectivity with the pump can be performed by attempting a simple pump command or report and by examining the output. For example, 30 | 31 | ``` 32 | $ openaps report invoke monitor/clock.json 33 | ``` 34 | 35 | returns the current pump time stamp, such as "2016-01-09T10:47:56", if the system is able to communicate with the pump, or errors otherwise. Removing previously generated clock.json and checking for presence of "T" in the newly created clock.json could be used to verify connectivity with the pump. 36 | 37 | Collecting all the error checking, a `preflight` alias could be defined as follows: 38 | 39 | ``` 40 | $ 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)"' 41 | ``` 42 | 43 | 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"). 44 | 45 | You may experiment using `$ openaps preflight` under different conditions, e.g. with the CareLink stick connected or not, or with the pump close enough or too far away from the stick. 46 | 47 | At this point you are in position to put all the required reports and actions into a single alias. 48 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-3/Understand-determine-basal.md: -------------------------------------------------------------------------------- 1 | # Understanding the output of oref0-determine-basal 2 | 3 | The key logic behind any oref0 implementation of OpenAPS lies in the oref0-determine-basal.js code, which is what takes all of the inputs you've collected and makes a temp basal recommendation you can then enact if appropriate. As such, it is important to understand how determine-basal makes its decisions, and how to interpret its output, so you can decide for yourself whether the recommendations it is making are appropriate for your situation, or if further adjustments are required before closing the loop or letting it run unattended. 4 | 5 | The recommendation is to run for several days in "open loop" mode, watching the output, in order to decide what your "max basal" setting should be. Based on how often you disagreed or counteracted what the loop was recommending, this might influence how you set your max basal. 6 | 7 | ## Summary of inputs 8 | 9 | The determine-basal algorithm requires a number of inputs, which are passed in JSON files such as iob.json, currenttemp.json, glucose.json, profile.json, and optionally meal.json. When running oref0-determine-basal.js with the appropriate inputs, the first thing you'll see is a summary of all the provided inputs, which might look something like this: 10 | 11 | ``` 12 | {"carbs":0,"boluses":0} 13 | {"delta":-2,"glucose":110,"avgdelta":-2.5} 14 | {"duration":0,"rate":0,"temp":"absolute"} 15 | {"iob":0,"activity":0,"bolussnooze":0,"basaliob":0} 16 | {"carbs_hr":28,"max_iob":1,"dia":3,"type":"current","current_basal":1.1,"max_daily_basal":1.3,"max_basal":3,"max_bg":120,"min_bg":115,"carbratio":10,"sens":40} 17 | ``` 18 | 19 | * The first line is meal.json, which, if provided, allows determine-basal to decide when it is appropriate to enable Meal Assist. 20 | * The second line is from glucose.json, and represents the most recent BG, the change from the previous BG (usually 5 minutes earlier), and the average change since 3 data points earlier (usually 15 minutes earlier). 21 | * The third line is the currently running temporary basal. A duration of 0 indicates none is running. 22 | * Fourth is the IOB and insulin activity summary. Insulin activity is used (when multiplied by ISF) to calculate BGI, which represents how much BG should be rising or falling every 5 minutes based solely on insulin activity. Basal IOB excludes the IOB effect of boluses, and Bolus Snooze is used in determining how long to avoid low-temping after a bolus while waiting for any carbs to kick in. 23 | * Fifth is the contents of profile.json, which contains all of the user's relevant pump settings, as well as their configured maximum (basal) IOB. 24 | 25 | ## Output 26 | 27 | After displaying the summary of all input data, oref0-determine-basal outputs a recommended temp basal JSON, which includes an explanation of why it's recommending that. It might look something like this: 28 | 29 | ``` 30 | {"temp":"absolute","bg":110,"tick":-2,"eventualBG":95,"snoozeBG":95,"mealAssist":"Off: Carbs: 0 Boluses: 0 Target: 117.5 Deviation: -15 BGI: 0","reason":"Eventual BG 95<115, setting -1.15U/hr","duration":30,"rate":0} 31 | ``` 32 | 33 | In this case, BG is 110, and falling slowly. With zero IOB, you would expect BG to be flat, so the falling BG generates a "deviation" from what's expected. In this case, because avgdelta is -2.5 mg/dL, vs. BGI of 0, that avgdelta is extrapolated out for the next 30 minutes, resulting in a deviation of -30 mg/dL. That is then applied to the current BG to get an eventualBG of 80. There is no bolussnooze IOB, so snoozeBG is also 80, and because (among other things) avgdelta is negative, mealAssist remains off. To correct from 80 up to 115 would require a -2.65U/hr temp for 30m, and since that is impossibly low, determine-basal recommends setting a temp basal to zero and stopping all insulin delivery for now. 34 | 35 | ## Exploring further 36 | 37 | For each different situation, the determine-basal output will be slightly different, but it should always provide a reasonable recommendation and list any temp basal that would be needed to start bringing BG back to target. If you are unclear on why it is making a particular recommendation, you can explore further by searching lib/determine-basal/determine-basal.js (the library with the core decision tree logic) for the keywords in the reason field (for example, "setting" in this case would find a line (`rT.reason += ", setting " + rate + "U/hr";`) matching the output above, and from there you could read up and see what `if` clauses resulted in making that decision. In this case, it was because (working backwards) `if (snoozeBG > profile.min_bg)` was false (so we took the `else`), but `if (eventualBG < profile.min_bg)` was true (with the explanatory comment to tell you that means "if eventual BG is below target"). 38 | 39 | If after reading through the code you are still unclear as to why determine-basal made a given decision (or think it may be the wrong decision for the situation), please join the #intend-to-bolus channel on Gitter, paste your output and any other context, and we'll be happy to discuss with you what it was doing and why, and whether that's the best thing to do in that and similar situations. 40 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-4/troubleshooting-loop.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting the closed loop 2 | 3 | If you haven't read this enough already: the DIY part of this is really important. If you've been copying and pasting, and not understanding what you're doing up to this point - please stop. That's dangerous. You should be testing and validating your work, and asking questions as you go if anything is unclear. (And, if this documentation annoys you enough, put in a PR as you go through each part to update/improve the documentation to help the next person! We've all been there.) :) 4 | 5 | That being said, at this stage, you have both a manual loop and a schedule (using cron) to create an automated loop. At this point, you're in the "test and watch" phase. In particular, you should make sure the loop is recommending and enacting the types of temporary basal rates that you might do manually; and that the communication is working between the devices. 6 | 7 | Additionally, most loopers, after automating their system with cron jobs, begin to think through some of the following things and run the following tests, including unit tests: 8 | 9 | ## How often should the cron run? 10 | 11 | Think about how often you get new BG data and may want to act on it. Or, time how long it takes your loop to run, and add another minute to that. You probably want to add preflight checks to make sure a loop is not already running before your next one starts. 12 | 13 | ## What should BG target range be? 14 | 15 | In the early testing, the OpenAPS settings may cause your BG to go both high and low. 16 | 17 | It's tempting to set your targets to "perfect" on day one, and start your looping with those values. The problem with this is that if the algorithm incorrectly gives you too much insulin you don't have very much room to handle emergencies. 18 | 19 | To start off, you should set your glucose target range "high and wide". Once you can reproducibly get your sugars in a wider and higher band without going low, you can then *slowly* reduce the target range to your ideal range. 20 | 21 | You should work toward a long-term goal here, rather than trying to do everything on day one. 22 | 23 | Additionally, as you think about the lower end of your target range, remember the timing of your insulin activity and the fact that negative insulin corrections take about the same amount of time to go into effect; thus, you wouldn't want your low end of the target range set below 90, for example - otherwise the system will not be able to prevent lows by reducing the insulin. 24 | 25 | ## What should pump settings be? 26 | 27 | You should set your maximum temporary basal limit on your pump to a reasonable value, to try and make sure that you don't go low by accident. 28 | 29 | To start off, you should think about taking the largest basal rate in your profile and multiply it by a 1.3. Set that as your maximum temporary basal on the pump. 30 | 31 | Once you're happy things are functioning correctly, you can increase this value to about 2x your basal. 32 | 33 | Note that for children especially this can vary a lot based on age, weight, and activity. Err on the side of caution. 34 | 35 | ## What happens if the system gets out of range or gets bad data? 36 | 37 | Test the range of the system. What happens if you walk out of range of the Carelink stick? What happens to the temporary basal rate? What happens with your cron job? What do you need to be aware of? Apply the same set of questions and thinking for other scenarios, including if you go out of range of your CGM and/or get ??? or another CGM error message. 38 | 39 | Make sure you understand the limits of the transmitter and these other errors, especially in an overnight situation , and what the system can and can't do when you are out of effective range. 40 | 41 | As your tests extends from minutes to hours, you'll want to check at least these scenarios: data corruption, lack of data, lack of connectivity, and other non-ideal operating conditions. 42 | 43 | ## Unit testing 44 | 45 | Additionally, you may want to consider some unit testing. There is a basic unit testing framework in oref0 that you can use, and add to. 46 | 47 | ### To help with unit test cases: 48 | 49 | If you'd like to help out with defining all the desired behaviors in the form of unit test cases: 50 | 51 | 1) Please clone / checkout [oref0] (https://github.com/openaps/oref0) 52 | 53 | 2) Type `sudo npm install -g mocha` and `sudo npm install -g should` 54 | 55 | 3) You should then be able to run `make` (or something like `mocha -c tests/determine-basal.test.js 2>&1 | less -r`) from the openaps-js directory to run all of the existing unit tests 56 | 57 | 4) As you add additional unit tests, you'll want to run `make` again after each one. 58 | 59 | ### How to add more test cases: 60 | 61 | We'll want to cover every section of the code, so if you see a "rT.reason" in bin/oref0-determine-basal.js that doesn't have a corresponding "output.reason.should.match" line in an appropriate test in tests/determine-basal.test.js, then you should figure out what glucose, temp basal, IOB, and profile inputs would get you into that section of the code (preferably representing what you're likely to see in a real-world situation), and create a test case to capture those inputs and the desired outputs. Then run the tests and see if your test passes, and the output looks reasonable. If not, then modify your test case accordingly, or if you think you've found a bug in determine-basal.js, ask on Gitter. 62 | -------------------------------------------------------------------------------- /docs/docs/Resources/troubleshooting.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | Even those who follow this documentation precisely are bound to end up stuck at some point. This could be due to something unique to your system, a mistyped command, actions performed out of order, or even a typo in this guide. This section provides some tools to help diagnose the issue as well as some common errors that have been experienced and resolved before. If you get stuck, try re-reading the documentation again and after that, share what you've been working on, attempted steps to resolve, and other pertinent details in [#intend-to-bolus in Gitter](https://gitter.im/nightscout/intend-to-bolus) when asking for help troubleshooting. 4 | 5 | ### Generally useful linux commands 6 | 7 | More comprehensive command line references can be found [here](http://www.computerworld.com/article/2598082/linux/linux-linux-command-line-cheat-sheet.html) and [here](http://www.pixelbeat.org/cmdline.html). For the below, since these are basic linux things, also try using a basic search engine (i.e. Google) to learn more about them and their intended use. 8 | 9 | `$ ls -alt` (List all of the files in the current directory with additional details.) 10 | 11 | `$ cd` (Change directory) 12 | 13 | `$ pwd` (Show the present working directory (your current location within the filesystem).) 14 | 15 | `$ sudo ` 16 | 17 | `$ tail -f /var/log/syslog` 18 | 19 | `$ df -h` 20 | 21 | `$ ifconfig` 22 | 23 | `$ cat ` (Display the contents of the file.) 24 | 25 | `$ nano ` (Open and edit the file in the nano text editor.) 26 | 27 | `$ stat ` 28 | 29 | `$ pip freeze` 30 | 31 | `$ sudo reboot` 32 | 33 | `$ sudo shutdown -h now` (The correct way to shut down the Raspberry Pi from the command line. Wait for the green light to stop blinking before removing the power supply.) 34 | 35 | `$ dmesg` (Displays all the kernel output since boot. It’s pretty difficult to read, but sometimes you see things in there about the wifi getting disconnected and so forth.) 36 | 37 | `uptime` 38 | 39 | [add something for decocare raw logging] 40 | 41 | ### Dealing with the CareLink USB Stick 42 | 43 | The `model` command is a quick way to verify whether you can communicate with the pump. Test this with `$ openaps use model`. 44 | 45 | If you can't get a response, it may be a range issue. The range of the CareLink radio is not particularly good, and orientation matters; see [range testing report](https://gist.github.com/channemann/0ff376e350d94ccc9f00) for more information. 46 | 47 | If you still can't get a response, trying unplugging and replugging the CareLink stick. 48 | 49 | Once you're setting up your loop, you may also want to oref0-reset-usb (`oref0-reset-usb.sh`) if mm-stick warmup fails, to reset the USB connection. It can help in some cases of CareLink stick not responding. Just note that during USB reset you will loose your Wi-Fi connection as well. 50 | 51 | ### Dealing with a corrupted git repository 52 | 53 | OpenAPS uses git as the logging mechanism, so it commits report changes on each report invoke. Sometimes, due to "unexpected" power-offs (battery dying, unplugging, etc.),the git repository gets broken. When it happens you will receive exceptions when running any report from openaps. As git logging is a safety/security measure, there is no way of disabling these commits. 54 | 55 | To fix a corrupted git repository you can run `oref0-fix-git-corruption.sh`, it will try to fix the repository, and in case when repository is definitly broken it copies the remainings in a safe place (`tmp`) and initializes a new git repo. 56 | 57 | Warning: do not run any openaps commands with sudo in front of it `sudo openaps`. If you do, your .git permissions will get messed up. Sudo should only be used when a command needs root permissions, and openaps does not need that. 58 | 59 | ### Environment variables 60 | 61 | 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. 62 | 63 | ### Common error messages 64 | 65 | #### Don't have permission, permission not allowed, etc 66 | 67 | The command you are running likely needs to be run with root permissions, try the same command again with ```sudo ``` in front of it 68 | 69 | #### json: error: input is not JSON 70 | ``` 71 | json: error: input is not JSON: Unexpected '<' at line 1, column 1: 72 | Document Moved 73 | ``` 74 | 75 | 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 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /docs/docs/openaps-guide/core/devices.md: -------------------------------------------------------------------------------- 1 | 2 | # Devices - aka **using** openaps 3 | 4 | There are several **vendors** that built into the core of openaps. 5 | There are two tools we can use to examine which **vendors** are available for 6 | **use** by a **device**. 7 | 8 | ## What can we use? 9 | 10 | The `openaps use` command allows us to interact with devices. Let's ask it for help: 11 | 12 | openaps use -h 13 | 14 | ```bash 15 | usage: openaps-use [-h] [--format {text,json,base,stdout}] [--output OUTPUT] 16 | [--version] 17 | device ... 18 | [... edited for brevity ...] 19 | Known Devices Menu: 20 | These are the devices openaps knows about: 21 | 22 | device Name and description: 23 | 24 | Once a device is registered in openaps.ini, it can be used. 25 | ``` 26 | 27 | Notice the `Known Devices Menu:` is empty, this means `openaps` doesn't know 28 | about anything yet. 29 | Let's try the `openaps device` command instead: 30 | 31 | ``` 32 | usage: openaps-device [-h] {add,remove,show} ... 33 | 34 | openaps-device - Manage device configurations. 35 | 36 | positional arguments: 37 | {add,remove,show} Operation 38 | add add - add a new device configuration 39 | remove remove - remove a device configuration 40 | show show - show all devices 41 | 42 | optional arguments: 43 | -h, --help show this help message and exit 44 | 45 | show - lists all known devices 46 | add - add a new device 47 | remove - remove a device 48 | ``` 49 | 50 | Lots of options there: the `devices` command allows us to teach openaps about our devices. 51 | The **use** command above had an empty devices menu what does `device show` say? 52 | ``` 53 | ``` 54 | Nothing yet! Both `openaps use` and `openaps device show` indicate nothing for us 55 | to interact with yet. Let's look at the `--help` output for `device add`: 56 | 57 | ``` 58 | usage: openaps-device add [-h] [--extra EXTRA] 59 | name {dexcom,medtronic,process,units} ... 60 | 61 | add - add a new device configuration 62 | 63 | positional arguments: 64 | name 65 | 66 | optional arguments: 67 | -h, --help show this help message and exit 68 | --extra EXTRA, -e EXTRA 69 | Name of extra ini file to use. 70 | 71 | ## VendorConfigurations: 72 | {dexcom,medtronic,process,units} 73 | Operation 74 | dexcom Dexcom - openaps driver for dexcom 75 | medtronic Medtronic - openaps driver for Medtronic 76 | process process - a fake vendor to run arbitrary commands 77 | units Units - units tool for openaps 78 | ``` 79 | 80 | Notice `VendorConfigurations`. These are the default **vendors** that ship 81 | with `openaps`. However, `openaps` doesn't know we want to **use** 82 | them yet. `openaps device add` allows us to name our device. The 83 | name we *add* to openaps will be the name we **use** later. 84 | 85 | ## **Devices** configure **use** 86 | 87 | ### A trivial device 88 | 89 | Let's use `echo` to create a trivial device that just says "hello 90 | world." 91 | `echo` is a unix **process**, the **VendorConfigurations** above include a 92 | `process` vendor we can use to illustrate the relationship between **uses** 93 | and **devices**. 94 | Let's warm up with some examples: 95 | 96 | ```bash 97 | echo 'hello world!' 98 | ``` 99 | That should print hello world on the screen. We can run this over and 100 | over again just for fun, but let's discover how to teach `openaps` how 101 | to do this. 102 | 103 | ```bash 104 | openaps device add howdy process echo 'hello world!' 105 | added process://howdy/echo/hello world! 106 | ``` 107 | 108 | What did this do? Let's check `git show`: 109 | 110 | ```diff 111 | commit 8e198ad8556ea6df4d4f6459d212eee316b89a0e 112 | Author: Ben West 113 | Date: Sun Mar 27 15:45:16 2016 -0700 114 | 115 | openaps-device add howdy process echo hello world! 116 | 117 | TODO: better change descriptions 118 | /usr/local/bin/openaps-device add howdy process echo hello world! 119 | 120 | diff --git a/openaps.ini b/openaps.ini 121 | index e69de29..d4a23d0 100644 122 | --- a/openaps.ini 123 | +++ b/openaps.ini 124 | @@ -0,0 +1,4 @@ 125 | +[device "howdy"] 126 | +vendor = openaps.vendors.process 127 | +extra = howdy.ini 128 | + 129 | ``` 130 | 131 | The `openaps * add` commands all change some of the INI configurations. 132 | 133 | Did the **use** menu change at all? `openap use -h` 134 | 135 | ``` 136 | [...] 137 | Known Devices Menu: 138 | These are the devices openaps knows about: 139 | 140 | device Name and description: 141 | howdy process - a fake vendor to run arbitrary commands 142 | 143 | ``` 144 | 145 | Now there's a **howdy** device in the **use** menu. The **use** menu adapts 146 | to our custom devices. Now we can **use** the device interactively: `openaps 147 | use howdy -h`, remember, we can always add `-h` to get more help/hints. 148 | Take note of that `--format text` option... our trivial `howdy` tool just 149 | prints a line of text. Most tools actually use a format called json (and it's 150 | the default), but for this example, we'll stick with `--format text`. 151 | 152 | ``` 153 | usage: openaps-use howdy [-h] USAGE ... 154 | 155 | optional arguments: 156 | -h, --help show this help message and exit 157 | 158 | ## Device howdy: 159 | vendor openaps.vendors.process 160 | 161 | process - a fake vendor to run arbitrary commands 162 | 163 | 164 | 165 | USAGE Usage Details 166 | shell run a process in a subshell 167 | ``` 168 | 169 | Hmm, because this a *unix process*, the **use** for this one is called 170 | **shell**. What happens if we just add that word to the end? `openaps use 171 | --format text howdy shell` 172 | 173 | ``` 174 | $ openaps use --format text howdy shell 175 | hello world! 176 | ``` 177 | 178 | Now it prints `hello world!` because we are interactively **using** the 179 | **device**. The **device** was configured through the `add` command, and 180 | saved in the INI as the `process` **vendor**. The `process` **vendor** only 181 | exposes a single **use**: the `shell` use allows us to run any unix process. 182 | The **device** commands configure the **uses**. The **use** menu adapts to 183 | the registered **devices**. We can interact with a device by using it. 184 | 185 | 186 | ## Summary 187 | 188 | Hopefully this illustrates the relationship between the openaps **device** and 189 | **use** tools. The `device` command allows bringing devices into your 190 | instance, and **use** allows interacting with them. Let's take a deeper look 191 | at this relationship looking at the other vendors that might share a closer 192 | relationship to diabetes. 193 | 194 | * [medtronic builtin] 195 | 196 | 197 | [medtronic builtin]: medtronic.md 198 | [dexcom builtin]: dexcom.md 199 | [overview]: ../overview.md 200 | 201 | -------------------------------------------------------------------------------- /docs/docs/openaps-guide/core/medtronic.md: -------------------------------------------------------------------------------- 1 | 2 | ## Medtronic vendor 3 | 4 | The medtronic vendor is backed by [decocare]. **Decocare** supports all 5 | paradigm series pumps. 6 | 7 | Different pumps in the paradigm series have different features, decocare is 8 | aware of many of these differences but not all. 9 | 10 | Adding a medtronic device to openaps also requires the **SERIAL** number of 11 | the pump. This is a six digit number, it's printed on the back of the pump. 12 | On the bottom right, there is a bar code, and right above that is the text: 13 | `SN PAR123456U`. In this case, the serial number is `123456`. 14 | It's also on the escape/status screen, scroll down, below the date, it will 15 | say: `S/N# 123456`, again the serial number would be `123456`. 16 | 17 | For example purposes, we'll use the serial number `123456` here, you should 18 | use your pump's serial number. Also, for the purposes of this guide, we will 19 | not be issuing any commands that cause changes. For most of this tutorial, 20 | you do not need access to a medtronic pump, or even the carelink stick, this 21 | tutorial focuses on understanding how **devices** are related to **uses**. 22 | 23 | ## Configuring medtronic device 24 | 25 | Let's add a `medtronic` **device** *named* `pump`. 26 | Remember that adding a device enables us to **use** it, and there's a 27 | `medtronic` vendor. `openaps device add pump medtronic -h` 28 | This one works a little different, it wants the serial number after: 29 | 30 | ``` 31 | usage: openaps-device add name medtronic [-h] serial 32 | 33 | Medtronic - openaps driver for Medtronic 34 | 35 | positional arguments: 36 | serial 37 | 38 | optional arguments: 39 | -h, --help show this help message and exit 40 | ``` 41 | 42 | So adding the serial to the end: 43 | ``` 44 | $ openaps device add pump medtronic 123456 45 | added medtronic://pump 46 | ``` 47 | 48 | ## openaps use pump 49 | Based on our prior experience knowing that `device` enables **use**, let's 50 | check out our own `openap use -h` to see how it's changed. 51 | ``` 52 | [...] 53 | Known Devices Menu: 54 | These are the devices openaps knows about: 55 | 56 | device Name and description: 57 | howdy process - a fake vendor to run arbitrary commands 58 | pump Medtronic - openaps driver for Medtronic 59 | 60 | Once a device is registered in openaps.ini, it can be used. 61 | ``` 62 | 63 | Now there's a **pump** device in the **use** menu! What can it do `openaps use pump -h` 64 | 65 | ``` 66 | usage: openaps-use pump [-h] USAGE ... 67 | 68 | optional arguments: 69 | -h, --help show this help message and exit 70 | 71 | ## Device pump: 72 | vendor openaps.vendors.medtronic 73 | 74 | Medtronic - openaps driver for Medtronic 75 | 76 | 77 | 78 | USAGE Usage Details 79 | Session session for pump 80 | bolus Send bolus command. [#warning!!!] 81 | filter_glucose_date 82 | Search for glucose pages including begin and end dates 83 | (iso 8601). 84 | filter_isig_date Search for isig pages including begin and end dates 85 | (iso 8601). 86 | iter_glucose Read latest 100 glucose records 87 | iter_glucose_hours Read latest n hours of glucose data 88 | iter_pump Read latest 100 pump records 89 | iter_pump_hours Read latest n hours of pump records 90 | model Get model number [#oref0] [#recommended] [#safe] 91 | mytest Testing read_settings 92 | read_basal_profile_A 93 | Read basal profile A. 94 | read_basal_profile_B 95 | Read basal profile B. 96 | read_basal_profile_std 97 | Read default basal profile. 98 | read_battery_status 99 | Check battery status. [#oref0] 100 | read_bg_targets Read bg targets. [#oref0] 101 | read_carb_ratios Read carb_ratios. [#oref0] 102 | read_clock Read date/time of pump [#oref0] 103 | read_current_glucose_pages 104 | Read current glucose pages. 105 | read_current_history_pages 106 | Read current history pages. 107 | read_glucose_data Read pump glucose page 108 | read_history_data Read pump history page 109 | read_insulin_sensitivies 110 | XXX: Deprecated. Don't use. Use 111 | read_insulin_sensitivities instead. 112 | read_insulin_sensitivities 113 | Read insulin sensitivities. [#oref0] 114 | read_selected_basal_profile 115 | Fetch the currently selected basal profile. [#oref0] 116 | read_settings Read settings. [#oref0] 117 | read_status Get pump status 118 | read_temp_basal Read temporary basal rates. [#oref0] 119 | reservoir Get pump remaining insulin 120 | resume_pump resume pumping. 121 | scan scan for usb stick 122 | set_clock Set clock. 123 | set_temp_basal Set temporary basal rates. [#oref0] 124 | settings Get pump settings 125 | status Get pump status (alias for read_status) 126 | suspend_pump Suspend pumping. 127 | ``` 128 | 129 | This is a list of all things the `medtronic` **vendor** knows how to do. 130 | These things have all been exposed in `openaps` as a single `use` in a 131 | **uniform** and **reproducible** way. Even though our `howdy` example device 132 | was completely different, the way we **use** it is identical to the `pump` 133 | device. 134 | 135 | Get some of the help for how to use a pump: 136 | * `openaps use pump model -h` 137 | * `openaps use pump reservoir -h` 138 | * `openaps use pump read_clock -h` 139 | * `openaps use pump iter_pump_hours -h` 140 | 141 | 142 | ## Understanding how to talk to medtronic 143 | 144 | 145 | This portion is the first portion of the tutorial where we will actually talk 146 | to the pump using the carelink usb stick. 147 | Everything prior to this has been configuration. 148 | Most of the time, Medtronic's wireless interface is off. 149 | There's a special command that enables wireless communication for several 150 | minutes, this is configurable in using the `minutes` parameter in the 151 | `pump.ini` **extra** ini. 152 | The medtronic vendor here tracks whether or not the session is expired, and 153 | renews it before continuing, this RF initialization could take an extra 30 154 | seconds. 155 | 156 | So, how fast does `openaps use pump model` take the first time? How long does 157 | it take if you repeat it several times? 158 | 159 | Try the following commands, these are all safe, read-only commands: 160 | * `openaps use pump model` 161 | * `openaps use pump reservoir` 162 | * `openaps use pump read_clock` 163 | * `openaps use pump iter_pump_hours 2` 164 | * If you are using Medtronic for CGM, try `openaps use pump iter_glucose_hours 2` 165 | 166 | If you are going to build tools to improve diabetes therapy, which pieces of data might 167 | you need to gather? You can interactively **use** each of these features to 168 | view and inspect the data. 169 | 170 | [decocare]: https://github.com/bewest/decoding-carelink 171 | -------------------------------------------------------------------------------- /docs/docs/openaps-guide/overview.md: -------------------------------------------------------------------------------- 1 | 2 | # About openaps 3 | 4 | `openaps` is a toolkit to make developing an artificial pancreas easy 5 | for humans. What is an artificial pancreas? What are the 6 | requirements of this toolkit and how does it work? 7 | 8 | While most people learning about this project may be interested in 9 | assembling their own "AP" as soon as possible, it may be helpful to 10 | pause and get a high level overview of openaps. 11 | 12 | 13 | ## What is an artificial pancreas? 14 | 15 | The term artificial pancreas can be misleading, as it can include or 16 | exclude different ideas or projects. For our purposes, an artificial 17 | pancreas does the following things: 18 | 19 | 1. **Monitor** therapeutic data (especially from pumps and CGM) in real time to 20 | provide relevant decision making data points. In order to do this, 21 | we must be able to manage data from disparate systems in a 22 | **uniform** manner. 23 | 24 | 1. **Predict** what is likely to happen. 25 | For example, when administering insulin, we naturally expect 26 | glucose to fall along a given curve. 27 | High fidelity therapy means communicating expectations like this, 28 | learning when it is wrong, and responding accordingly. 29 | Since clinical therapy is an application of science, this process 30 | must be **reproducible**, so that we can properly assess what 31 | works, and what does not. 32 | 33 | 1. **Enact** shared plans like a good teammate. 34 | When humans get distracted, or sick, or are asleep, the tools can 35 | and should provide assistance to improve **safety** and increase 36 | **control** over dangerous conditions. 37 | 38 | ## Bring your own device 39 | 40 | Circa 2016-03-27, we have access to a variety of insulin pumps and 41 | glucose monitors. openaps provides a modular framework to manipulate 42 | a variety of insulin pumps, and glucose monitors, as well as 43 | **devices** by different **vendors**. openaps exposes the **uses** of 44 | a **device** from a particular **vendor** for you to explore your own 45 | menagerie of devices in a **uniform** and interoperable manner. 46 | `openaps` also provides `reports` to track data as it flows through 47 | each phase, and an **alias** feature to logically group commands and 48 | workflows. 49 | 50 | When the community discovers how to communicate with a device, we can 51 | create an openaps **vendor** module for the new device. 52 | 53 | ## What is a toolkit? 54 | `openaps` is not an artificial pancreas by itself. So far in 55 | discussing some of the philosophy and overview of openaps, we've seen 56 | that it needs to interact with a lot of different devices in a lot of 57 | different circumstances. The solution to solving this problem was to 58 | provide a suite of tools that allows us to interact with the 59 | properties of the system, easily see what is going on inside and 60 | inspect the data. Because we often intend for the system to operate 61 | while we're asleep, the tools also provide several facilities for 62 | easily changing and saving configuration. 63 | 64 | This means we'll be using the command line a lot, because it's very 65 | easy to teach, reproduce, and automate. Any series of commands you 66 | type in the command line can be put in a file and made into a script. 67 | 68 | Because most people intend to use this as a medical device, we also 69 | wanted to track the data as it moves through the system. openaps 70 | checkpoints all the data so that it can be inspected and verified at 71 | anytime. 72 | 73 | The toolkit provides many tools to realize the values enumerated by 74 | our design philosophy. Here are a few, but don't panic, we'll go 75 | through how to use each one methodically: 76 | 77 | openaps 78 | openaps-device 79 | openaps-report 80 | openaps-vendor 81 | openaps-use 82 | openaps-alias 83 | 84 | Now that `openaps` is installed, we can ask any of these tools for 85 | help to explain themselves: 86 | 87 | `openaps --help` 88 | 89 | Many of the tools depend on some configuration though, how do we 90 | provide the configuration it needs? If it needs configuration, the 91 | tool might refuse to run, like this: 92 | 93 | bewest@bewest-MacBookPro:~/Documents$ openaps use -h 94 | Not an openaps environment, run: openaps init 95 | 96 | Don't worry, it's time to create our first workspace! 97 | 98 | ## My first workspace 99 | 100 | This guide aims to help users become comfortable navigating the 101 | openaps commands. Most of the commands read saved configuration. 102 | `openaps` needs a location to store all the data and configuration 103 | generated as we explore. We'll often refer to this location as your 104 | **openaps instance**. The toolkit helps you create an **instance** of 105 | openaps on your computer. We can think about this location as a 106 | workspace for openaps. 107 | 108 | Get familiar with `ls`, `cat`, `echo`, `cd`, `pwd` commands. 109 | To create our first openaps instance, we use `openaps init` with the 110 | location we'd like to use: 111 | 112 | cd ~/Documents 113 | openaps init tutorial-hello 114 | cd tutorial-hello 115 | pwd 116 | 117 | This creates a new openaps **instance** in 118 | `~/Documents/tutorial-hello`. Take a look at what is in your 119 | workspace, using `ls` and `cat`. A valid instance must have an 120 | `openaps.ini` file. It can be empty, which simply means it doesn't 121 | (yet) know about your devices or vendors or anything. 122 | 123 | ``` eval_rst 124 | .. note:: 125 | 126 | For the rest of this tutorial, all of our work will be done in the 127 | `~/Documents/tutorial-hello` directory. 128 | ``` 129 | 130 | ## Inspecting the log 131 | We mentioned earlier that the requirements for `openaps` demand that 132 | we track data as it flows through the system. Is there a log of all 133 | the transactions that have occurred? If so, it should include the 134 | fact that we just created an instance of openaps. A valid instance of 135 | openaps has two requirements: it must be a `git` repository containing 136 | an `openaps.ini` file at it's root. 137 | 138 | This means many operations are tracked using `git`, try `git log` or `git 139 | show`; there should an event in the log showing the time and date (and who!) 140 | created this instance. 141 | 142 | ```bash 143 | bewest@bewest-MacBookPro:~/Documents/tutorial-hello$ ls 144 | openaps.ini 145 | bewest@bewest-MacBookPro:~/Documents/tutorial-hello$ cat openaps.ini 146 | bewest@bewest-MacBookPro:~/Documents/tutorial-hello$ wc -l openaps.ini 147 | 0 openaps.ini 148 | bewest@bewest-MacBookPro:~/Documents/tutorial-hello$ git show 149 | ``` 150 | ```diff 151 | commit 04715a67099c19ae220220d474aa67e470d07e0e 152 | Author: Ben West 153 | Date: Sun Mar 27 14:37:56 2016 -0700 154 | 155 | initializing openaps 0.1.0-dev 156 | 157 | diff --git a/openaps.ini b/openaps.ini 158 | new file mode 100644 159 | index 0000000..e69de29 160 | bewest@bewest-MacBookPro:~/Documents/tutorial-hello$ 161 | ``` 162 | 163 | Knowledge of `git` is not usually needed or expected in order to use 164 | `openaps`, however, `openaps` does use it to store and track all data. 165 | This has several side-effects including easy mesh/backup. Many events 166 | in the log will also include a comment on the commands used to create 167 | the transaction. This allows us to share, find and debug problems 168 | quickly and easily. 169 | 170 | Many software programs attempt to hide the inner workings. However 171 | because `openaps` has to meet exacting requirements, the design 172 | enables openaps to easily examine and adjust how it works using 173 | standard tools. 174 | 175 | ## Summary 176 | 177 | Congratulations, you're now the owner of a new openaps instance. It's 178 | time to start exploring `openaps` core in more detail. 179 | 180 | * [Devices](core/devices.md) 181 | * [Reports](core/reports.md) 182 | * [Alias](core/alias.md) 183 | 184 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-6/Configure-Automatic-Sensitivity-Mode.md: -------------------------------------------------------------------------------- 1 | ## Configuring Automatic Sensitivity Mode 2 | 3 | For more information review https://github.com/openaps/oref0/issues/58 4 | 5 | 1) Ensure to get the latest dev branch 6 | ``` 7 | cd 8 | cd src 9 | cd oref0 10 | git pull 11 | git checkout dev 12 | sudo npm install -g 13 | ``` 14 | Make sure you run the last line to install the tools 15 | 16 | 2) Next in order to properly execute the new auto-sensitivity module, you need to have at least 24 hour worth of pump history data and enough bg readings (past 24 hours). 17 | In your openaps.ini apply the following changes: 18 | ``` 19 | [report "[Your Path]/glucose.json"] 20 | device = cgm 21 | use = iter_glucose 22 | reporter = JSON 23 | count = 288 24 | ``` 25 | 26 | Note: If using Nightscout add count=288 to your entries.json API call as a querystring parameter 27 | For NS it will look something like this depending on how you implement it (note the ?count=288) that is what you have to add 28 | ``` 29 | [device "curl"] 30 | fields = 31 | cmd = bash 32 | vendor = openaps.vendors.process 33 | args = -c "curl -s https://[Your URL]/api/v1/entries.json?count=288 | json -e 'this.glucose = this.sgv'" 34 | ``` 35 | 36 | 37 | If your [glucose.json] does not have enough entries you will see a warning when running your auto-sens.json report "Error: not enough glucose data to calculate autosens." 38 | 39 | 3) After applying the above change you need to add a new device and report as follow: 40 | ``` 41 | [device "auto-sens"] 42 | vendor = openaps.vendors.process 43 | extra = auto-sens.ini 44 | ``` 45 | and your auto-sens.ini should look like this: 46 | ``` 47 | [device "auto-sens"] 48 | fields = glucose pumphistory insulin_sensitivities basal_profile profile 49 | cmd = oref0 50 | args = detect-sensitivity 51 | ``` 52 | 53 | 4) Next create this report 54 | ``` 55 | [report "[Your Path]/auto-sens.json"] 56 | profile = [Your Path]/profile.json 57 | use = shell 58 | reporter = text 59 | json_default = True 60 | pumphistory = [Your Path]/pump-history-zoned.json 61 | basal_profile = [Your Path]/active-basal-profile.json 62 | insulin_sensitivities = [Your Path]/insulin-sensitivities.json 63 | glucose = [Your Path]/ns-glucose.json 64 | device = auto-sens 65 | remainder = [] 66 | ``` 67 | 68 | 5) Next we need to pass auto-sens.json to oref0-determine-basal.json, in openaps.ini add a new input simillar to folowing example below: 69 | ``` 70 | [device "oref0-determine-basal"] 71 | fields = iob current-temps glucose profile auto-sens meal 72 | cmd = oref0-determine-basal 73 | vendor = openaps.vendors.process 74 | args = 75 | 76 | [report "enact/suggested.json"] 77 | profile = [Your Path]/profile.json 78 | use = shell 79 | reporter = text 80 | current-temps = [Your Path]/temp-basal-status.json 81 | device = oref0-determine-basal 82 | iob = [Your Path]/iob.json 83 | glucose = [Your Path]/glucose.json 84 | meal = [Your Path]/meal.json 85 | auto-sens = [Your Path]/auto-sens.json 86 | ``` 87 | 88 | 6) Next you have to make sure you pull 28 hours (24h + DIA) of pump history. Change the hours to 24, so your pump history report should look like this: 89 | ``` 90 | [report "[Your Path]/pump-history.json"] 91 | device = pump 92 | hours = 28 93 | use = iter_pump_hours 94 | reporter = JSON 95 | ``` 96 | Note. Your loop should run without auto-sens.json report but if you don't pass that as an input you will see the following message while executing oref0-determine-basal.js: 97 | 98 | Optional feature Auto Sensitivity not enabled: { [Error: ENOENT: no such file or directory, open 'online'] errno: -2, code: 'ENOENT', syscall: 'open', path: 'online' } 99 | 100 | Here is an example of running the loop with Auto Sensitivity feature enabled: 101 | ``` 102 | Feb 26 22:26:11 raspberrypi openaps-loop: reporting oref0-prepare/mm-normalized.json 103 | Feb 26 22:26:38 raspberrypi openaps-loop: ............................................................................................................................................................................................................................................................................................... 104 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.51: -0.33, -0.33, 0.22 105 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.50: -0.33, -0.33, 0.13 106 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.49: -0.67, -0.36, -0.03 107 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.48: -0.67, -0.39, -0.11 108 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.47: -0.67, -0.46, -0.24 109 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.46: -0.67, -0.50, -0.38 110 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.45: -1.00, -0.54, -0.42 111 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.44: -1.24, -0.57, -0.47 112 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.43: -1.33, -0.58, -0.63 113 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.42: -1.49, -0.60, -0.67 114 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.41: -1.67, -0.62, -0.78 115 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.40: -1.67, -0.65, -0.88 116 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.39: -1.67, -0.66, -0.95 117 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.38: -2.00, -0.67, -1.12 118 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.37: -2.00, -0.68, -1.57 119 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.36: -2.00, -0.69, -1.67 120 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.35: -2.33, -0.69, -1.73 121 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.34: -2.33, -0.70, -1.89 122 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.33: -2.43, -0.74, -2.03 123 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.32: -2.67, -0.76, -2.16 124 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.31: -3.00, -0.77, -2.36 125 | Feb 26 22:26:38 raspberrypi openaps-loop: p=0.30: -3.00, -0.82, -2.55 126 | Feb 26 22:26:38 raspberrypi openaps-loop: Mean deviation: 0.76 127 | Feb 26 22:26:38 raspberrypi openaps-loop: Sensitivity within normal ranges 128 | Feb 26 22:26:38 raspberrypi openaps-loop: Basal adjustment 0.00U/hr 129 | Feb 26 22:26:38 raspberrypi openaps-loop: Ratio: 100%: new ISF: 42.0mg/dL/U 130 | Feb 26 22:26:39 raspberrypi openaps-loop: {"carbs":0,"boluses":0,"mealCOB":10} 131 | Feb 26 22:26:39 raspberrypi openaps-loop: {"ratio":1} 132 | Feb 26 22:26:39 raspberrypi openaps-loop: {"delta":-4,"glucose":129,"avgdelta":-6} 133 | Feb 26 22:26:39 raspberrypi openaps-loop: {"duration":17,"rate":1.125,"temp":"absolute"} 134 | Feb 26 22:26:39 raspberrypi openaps-loop: {"iob":0.089,"activity":0.0119,"bolussnooze":0,"basaliob":0.089,"netbasalinsulin":1.4,"hightempinsulin":1.8} 135 | Feb 26 22:26:39 raspberrypi openaps-loop: {"max_iob":3,"type":"current","dia":3,"current_basal":1.15,"max_daily_basal":1.15,"max_basal":3,"min_bg":100,"max_bg":120,"sens":42,"carb_ratio":10} 136 | Feb 26 22:26:39 raspberrypi openaps-loop: oref0-get-profile://text/shell/oref0-predict/profile.json 137 | Feb 26 22:26:39 raspberrypi openaps-loop: reporting oref0-predict/profile.json 138 | Feb 26 22:26:39 raspberrypi openaps-loop: oref0-calculate-iob://text/shell/oref0-predict/iob.json 139 | Feb 26 22:26:39 raspberrypi openaps-loop: reporting oref0-predict/iob.json 140 | Feb 26 22:26:39 raspberrypi openaps-loop: auto-sens://text/shell/oref0-monitor/auto-sens.json 141 | Feb 26 22:26:39 raspberrypi openaps-loop: reporting oref0-monitor/auto-sens.json 142 | Feb 26 22:26:39 raspberrypi openaps-loop: oref0-determine-basal://text/shell/oref0-predict/oref0.json 143 | Feb 26 22:26:39 raspberrypi openaps-loop: reporting oref0-predict/oref0.json 144 | Feb 26 22:26:42 raspberrypi openaps-loop: { 145 | Feb 26 22:26:42 raspberrypi openaps-loop: "temp": "absolute", 146 | Feb 26 22:26:42 raspberrypi openaps-loop: "bg": 129, 147 | Feb 26 22:26:42 raspberrypi openaps-loop: "tick": -4, 148 | Feb 26 22:26:42 raspberrypi openaps-loop: "eventualBG": 104, 149 | Feb 26 22:26:42 raspberrypi openaps-loop: "snoozeBG": 104, 150 | Feb 26 22:26:42 raspberrypi openaps-loop: "mealAssist": "Off: Carbs: 0 Boluses: 0 Target: 110 Deviation: -21 BGI: -2.5", 151 | Feb 26 22:26:42 raspberrypi openaps-loop: "reason": "Eventual BG 104>100 but Avg. Delta -6.00 < Exp. Delta -2.3, temp 1.125 ~ req 1.15U/hr" 152 | Feb 26 22:26:42 raspberrypi openaps-loop: } 153 | Feb 26 22:26:43 raspberrypi openaps-loop: No recommendation to send 154 | ``` 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source 10 | set I18NSPHINXOPTS=%SPHINXOPTS% source 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | echo. coverage to run coverage check of the documentation if enabled 41 | goto end 42 | ) 43 | 44 | if "%1" == "clean" ( 45 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 46 | del /q /s %BUILDDIR%\* 47 | goto end 48 | ) 49 | 50 | 51 | REM Check if sphinx-build is available and fallback to Python version if any 52 | %SPHINXBUILD% 1>NUL 2>NUL 53 | if errorlevel 9009 goto sphinx_python 54 | goto sphinx_ok 55 | 56 | :sphinx_python 57 | 58 | set SPHINXBUILD=python -m sphinx.__init__ 59 | %SPHINXBUILD% 2> nul 60 | if errorlevel 9009 ( 61 | echo. 62 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 63 | echo.installed, then set the SPHINXBUILD environment variable to point 64 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 65 | echo.may add the Sphinx directory to PATH. 66 | echo. 67 | echo.If you don't have Sphinx installed, grab it from 68 | echo.http://sphinx-doc.org/ 69 | exit /b 1 70 | ) 71 | 72 | :sphinx_ok 73 | 74 | 75 | if "%1" == "html" ( 76 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 77 | if errorlevel 1 exit /b 1 78 | echo. 79 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 80 | goto end 81 | ) 82 | 83 | if "%1" == "dirhtml" ( 84 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 85 | if errorlevel 1 exit /b 1 86 | echo. 87 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 88 | goto end 89 | ) 90 | 91 | if "%1" == "singlehtml" ( 92 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 93 | if errorlevel 1 exit /b 1 94 | echo. 95 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 96 | goto end 97 | ) 98 | 99 | if "%1" == "pickle" ( 100 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 101 | if errorlevel 1 exit /b 1 102 | echo. 103 | echo.Build finished; now you can process the pickle files. 104 | goto end 105 | ) 106 | 107 | if "%1" == "json" ( 108 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 109 | if errorlevel 1 exit /b 1 110 | echo. 111 | echo.Build finished; now you can process the JSON files. 112 | goto end 113 | ) 114 | 115 | if "%1" == "htmlhelp" ( 116 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 117 | if errorlevel 1 exit /b 1 118 | echo. 119 | echo.Build finished; now you can run HTML Help Workshop with the ^ 120 | .hhp project file in %BUILDDIR%/htmlhelp. 121 | goto end 122 | ) 123 | 124 | if "%1" == "qthelp" ( 125 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 129 | .qhcp project file in %BUILDDIR%/qthelp, like this: 130 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\OpenAPS.qhcp 131 | echo.To view the help file: 132 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\OpenAPS.ghc 133 | goto end 134 | ) 135 | 136 | if "%1" == "devhelp" ( 137 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 138 | if errorlevel 1 exit /b 1 139 | echo. 140 | echo.Build finished. 141 | goto end 142 | ) 143 | 144 | if "%1" == "epub" ( 145 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 146 | if errorlevel 1 exit /b 1 147 | echo. 148 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 149 | goto end 150 | ) 151 | 152 | if "%1" == "latex" ( 153 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 154 | if errorlevel 1 exit /b 1 155 | echo. 156 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 157 | goto end 158 | ) 159 | 160 | if "%1" == "latexpdf" ( 161 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 162 | cd %BUILDDIR%/latex 163 | make all-pdf 164 | cd %~dp0 165 | echo. 166 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 167 | goto end 168 | ) 169 | 170 | if "%1" == "latexpdfja" ( 171 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 172 | cd %BUILDDIR%/latex 173 | make all-pdf-ja 174 | cd %~dp0 175 | echo. 176 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 177 | goto end 178 | ) 179 | 180 | if "%1" == "text" ( 181 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 182 | if errorlevel 1 exit /b 1 183 | echo. 184 | echo.Build finished. The text files are in %BUILDDIR%/text. 185 | goto end 186 | ) 187 | 188 | if "%1" == "man" ( 189 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 190 | if errorlevel 1 exit /b 1 191 | echo. 192 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 193 | goto end 194 | ) 195 | 196 | if "%1" == "texinfo" ( 197 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 198 | if errorlevel 1 exit /b 1 199 | echo. 200 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 201 | goto end 202 | ) 203 | 204 | if "%1" == "gettext" ( 205 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 206 | if errorlevel 1 exit /b 1 207 | echo. 208 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 209 | goto end 210 | ) 211 | 212 | if "%1" == "changes" ( 213 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 214 | if errorlevel 1 exit /b 1 215 | echo. 216 | echo.The overview file is in %BUILDDIR%/changes. 217 | goto end 218 | ) 219 | 220 | if "%1" == "linkcheck" ( 221 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 222 | if errorlevel 1 exit /b 1 223 | echo. 224 | echo.Link check complete; look for any errors in the above output ^ 225 | or in %BUILDDIR%/linkcheck/output.txt. 226 | goto end 227 | ) 228 | 229 | if "%1" == "doctest" ( 230 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 231 | if errorlevel 1 exit /b 1 232 | echo. 233 | echo.Testing of doctests in the sources finished, look at the ^ 234 | results in %BUILDDIR%/doctest/output.txt. 235 | goto end 236 | ) 237 | 238 | if "%1" == "coverage" ( 239 | %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage 240 | if errorlevel 1 exit /b 1 241 | echo. 242 | echo.Testing of coverage in the sources finished, look at the ^ 243 | results in %BUILDDIR%/coverage/python.txt. 244 | goto end 245 | ) 246 | 247 | if "%1" == "xml" ( 248 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 249 | if errorlevel 1 exit /b 1 250 | echo. 251 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 252 | goto end 253 | ) 254 | 255 | if "%1" == "pseudoxml" ( 256 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 257 | if errorlevel 1 exit /b 1 258 | echo. 259 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 260 | goto end 261 | ) 262 | 263 | :end 264 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # SOURCE_ROOT=source 16 | SOURCE_ROOT=docs 17 | # Internal variables. 18 | PAPEROPT_a4 = -D latex_paper_size=a4 19 | PAPEROPT_letter = -D latex_paper_size=letter 20 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCE_ROOT) 21 | # the i18n builder cannot share the environment and doctrees with the others 22 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCE_ROOT) 23 | 24 | .PHONY: help 25 | help: 26 | @echo "Please use \`make ' where is one of" 27 | @echo " html to make standalone HTML files" 28 | @echo " dirhtml to make HTML files named index.html in directories" 29 | @echo " singlehtml to make a single large HTML file" 30 | @echo " pickle to make pickle files" 31 | @echo " json to make JSON files" 32 | @echo " htmlhelp to make HTML files and a HTML help project" 33 | @echo " qthelp to make HTML files and a qthelp project" 34 | @echo " applehelp to make an Apple Help Book" 35 | @echo " devhelp to make HTML files and a Devhelp project" 36 | @echo " epub to make an epub" 37 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 38 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 39 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 40 | @echo " text to make text files" 41 | @echo " man to make manual pages" 42 | @echo " texinfo to make Texinfo files" 43 | @echo " info to make Texinfo files and run them through makeinfo" 44 | @echo " gettext to make PO message catalogs" 45 | @echo " changes to make an overview of all changed/added/deprecated items" 46 | @echo " xml to make Docutils-native XML files" 47 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 48 | @echo " linkcheck to check all external links for integrity" 49 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 50 | @echo " coverage to run coverage check of the documentation (if enabled)" 51 | 52 | .PHONY: clean 53 | clean: 54 | rm -rf $(BUILDDIR)/* 55 | 56 | .PHONY: html 57 | html: 58 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 59 | @echo 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 61 | 62 | .PHONY: dirhtml 63 | dirhtml: 64 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 65 | @echo 66 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 67 | 68 | .PHONY: singlehtml 69 | singlehtml: 70 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 71 | @echo 72 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 73 | 74 | .PHONY: pickle 75 | pickle: 76 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 77 | @echo 78 | @echo "Build finished; now you can process the pickle files." 79 | 80 | .PHONY: json 81 | json: 82 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 83 | @echo 84 | @echo "Build finished; now you can process the JSON files." 85 | 86 | .PHONY: htmlhelp 87 | htmlhelp: 88 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 89 | @echo 90 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 91 | ".hhp project file in $(BUILDDIR)/htmlhelp." 92 | 93 | .PHONY: qthelp 94 | qthelp: 95 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 96 | @echo 97 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 98 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 99 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OpenAPS.qhcp" 100 | @echo "To view the help file:" 101 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OpenAPS.qhc" 102 | 103 | .PHONY: applehelp 104 | applehelp: 105 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 106 | @echo 107 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 108 | @echo "N.B. You won't be able to view it unless you put it in" \ 109 | "~/Library/Documentation/Help or install it in your application" \ 110 | "bundle." 111 | 112 | .PHONY: devhelp 113 | devhelp: 114 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 115 | @echo 116 | @echo "Build finished." 117 | @echo "To view the help file:" 118 | @echo "# mkdir -p $$HOME/.local/share/devhelp/OpenAPS" 119 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OpenAPS" 120 | @echo "# devhelp" 121 | 122 | .PHONY: epub 123 | epub: 124 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 125 | @echo 126 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 127 | 128 | .PHONY: latex 129 | latex: 130 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 131 | @echo 132 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 133 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 134 | "(use \`make latexpdf' here to do that automatically)." 135 | 136 | .PHONY: latexpdf 137 | latexpdf: 138 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 139 | @echo "Running LaTeX files through pdflatex..." 140 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 141 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 142 | 143 | .PHONY: latexpdfja 144 | latexpdfja: 145 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 146 | @echo "Running LaTeX files through platex and dvipdfmx..." 147 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 148 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 149 | 150 | .PHONY: text 151 | text: 152 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 153 | @echo 154 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 155 | 156 | .PHONY: man 157 | man: 158 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 159 | @echo 160 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 161 | 162 | .PHONY: texinfo 163 | texinfo: 164 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 165 | @echo 166 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 167 | @echo "Run \`make' in that directory to run these through makeinfo" \ 168 | "(use \`make info' here to do that automatically)." 169 | 170 | .PHONY: info 171 | info: 172 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 173 | @echo "Running Texinfo files through makeinfo..." 174 | make -C $(BUILDDIR)/texinfo info 175 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 176 | 177 | .PHONY: gettext 178 | gettext: 179 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 180 | @echo 181 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 182 | 183 | .PHONY: changes 184 | changes: 185 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 186 | @echo 187 | @echo "The overview file is in $(BUILDDIR)/changes." 188 | 189 | .PHONY: linkcheck 190 | linkcheck: 191 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 192 | @echo 193 | @echo "Link check complete; look for any errors in the above output " \ 194 | "or in $(BUILDDIR)/linkcheck/output.txt." 195 | 196 | .PHONY: doctest 197 | doctest: 198 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 199 | @echo "Testing of doctests in the sources finished, look at the " \ 200 | "results in $(BUILDDIR)/doctest/output.txt." 201 | 202 | .PHONY: coverage 203 | coverage: 204 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 205 | @echo "Testing of coverage in the sources finished, look at the " \ 206 | "results in $(BUILDDIR)/coverage/python.txt." 207 | 208 | .PHONY: xml 209 | xml: 210 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 211 | @echo 212 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 213 | 214 | .PHONY: pseudoxml 215 | pseudoxml: 216 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 217 | @echo 218 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 219 | 220 | .PHONY: serve 221 | serve: 222 | @echo 223 | make clean build html 224 | (cd $(BUILDDIR)/html/; python -m SimpleHTTPServer 8000 ) 225 | 226 | -------------------------------------------------------------------------------- /docs/reference/mm/mm-send-comm.py.md: -------------------------------------------------------------------------------- 1 | # `mm-send-comm.py` 2 | 3 | ## Help 4 | usage: mm-send-comm.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] 6 | [-v] [--rf-minutes SESSION_LIFE] [--auto-init] [--init] 7 | [--prefix-path PREFIX_PATH] [--saveall] 8 | [--prefix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp}] 9 | [--postfix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp}] 10 | {sleep,tweak,ManualCommand} ... 11 | 12 | mm-send-comm.py - send messages to a compatible MM insulin pump 13 | 14 | positional arguments: 15 | {sleep,tweak,ManualCommand} 16 | Main thing to do between --prefix and--postfix 17 | sleep Just sleep between command sets 18 | tweak Tweak a builtin command 19 | ManualCommand Customize a command 20 | 21 | optional arguments: 22 | -h, --help show this help message and exit 23 | --serial SERIAL serial number of pump [default: ] 24 | --port PORT Path to device [default: scan] 25 | --no-op Dry run, don't do main function 26 | --skip-prelude Don't do the normal prelude. 27 | --no-rf-prelude Do the prelude, but don't query the pump. 28 | --skip-postlude Don't do the normal postlude. 29 | -v, --verbose Verbosity 30 | --rf-minutes SESSION_LIFE 31 | How long RF sessions should last 32 | --auto-init Send power ctrl to initialize RF session. 33 | --init Send power ctrl to initialize RF session. 34 | --prefix-path PREFIX_PATH 35 | Prefix to store saved files when using --save or 36 | --saveall. 37 | --saveall Whether or not to save all responses. 38 | --prefix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp} 39 | Built-in commands to run before the main one. 40 | --postfix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp} 41 | Built-in commands to run after the main one. 42 | 43 | This tool is intended to help discover protocol behavior. Under no 44 | circumstance is it intended to deliver therapy. 45 | -------------------------------------------------------------------------------- /docs/reference/mm/mmeowlink-send.py.md: -------------------------------------------------------------------------------- 1 | # `mmeowlink-send.py` 2 | 3 | ## Help 4 | usage: mmeowlink-send.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] 6 | [-v] [--rf-minutes SESSION_LIFE] [--auto-init] 7 | [--init] [--radio_type {mmcommander,subg_rfspy}] 8 | [--mmcommander] [--subg_rfspy] 9 | [--prefix-path PREFIX_PATH] [--saveall] 10 | [--prefix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp}] 11 | [--postfix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp}] 12 | {sleep,tweak,ManualCommand} ... 13 | 14 | mmeowlink adapter to decocare's SendMsgApp 15 | 16 | positional arguments: 17 | {sleep,tweak,ManualCommand} 18 | Main thing to do between --prefix and--postfix 19 | sleep Just sleep between command sets 20 | tweak Tweak a builtin command 21 | ManualCommand Customize a command 22 | 23 | optional arguments: 24 | -h, --help show this help message and exit 25 | --serial SERIAL serial number of pump [default: ] 26 | --port PORT Path to device [default: scan] 27 | --no-op Dry run, don't do main function 28 | --skip-prelude Don't do the normal prelude. 29 | --no-rf-prelude Do the prelude, but don't query the pump. 30 | --skip-postlude Don't do the normal postlude. 31 | -v, --verbose Verbosity 32 | --rf-minutes SESSION_LIFE 33 | How long RF sessions should last 34 | --auto-init Send power ctrl to initialize RF session. 35 | --init Send power ctrl to initialize RF session. 36 | --radio_type {mmcommander,subg_rfspy} 37 | --mmcommander 38 | --subg_rfspy 39 | --prefix-path PREFIX_PATH 40 | Prefix to store saved files when using --save or 41 | --saveall. 42 | --saveall Whether or not to save all responses. 43 | --prefix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp} 44 | Built-in commands to run before the main one. 45 | --postfix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp} 46 | Built-in commands to run after the main one. 47 | -------------------------------------------------------------------------------- /docs/reference/mm/mmblelink-send.py.md: -------------------------------------------------------------------------------- 1 | # `mmblelink-send.py` 2 | 3 | ## Help 4 | usage: mmblelink-send.py [-h] [--serial SERIAL] [--port PORT] [--no-op] 5 | [--skip-prelude] [--no-rf-prelude] [--skip-postlude] 6 | [-v] [--rf-minutes SESSION_LIFE] [--auto-init] 7 | [--init] [--rx {0,1,2,0,1,2,PumpTX,PumpRX}] 8 | [--tx {0,1,2,0,1,2,PumpTX,PumpRX}] 9 | [--sleep_interval SLEEP_INTERVAL] 10 | [--prefix-path PREFIX_PATH] [--saveall] 11 | [--prefix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp}] 12 | [--postfix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp}] 13 | MAC {sleep,tweak,ManualCommand} ... 14 | 15 | mmblelink adapter to decocare's SendMsgApp 16 | 17 | positional arguments: 18 | MAC RileyLink address 19 | {sleep,tweak,ManualCommand} 20 | Main thing to do between --prefix and--postfix 21 | sleep Just sleep between command sets 22 | tweak Tweak a builtin command 23 | ManualCommand Customize a command 24 | 25 | optional arguments: 26 | -h, --help show this help message and exit 27 | --serial SERIAL serial number of pump [default: ] 28 | --port PORT Path to device [default: scan] 29 | --no-op Dry run, don't do main function 30 | --skip-prelude Don't do the normal prelude. 31 | --no-rf-prelude Do the prelude, but don't query the pump. 32 | --skip-postlude Don't do the normal postlude. 33 | -v, --verbose Verbosity 34 | --rf-minutes SESSION_LIFE 35 | How long RF sessions should last 36 | --auto-init Send power ctrl to initialize RF session. 37 | --init Send power ctrl to initialize RF session. 38 | --rx {0,1,2,0,1,2,PumpTX,PumpRX}, -R {0,1,2,0,1,2,PumpTX,PumpRX} 39 | --tx {0,1,2,0,1,2,PumpTX,PumpRX}, -T {0,1,2,0,1,2,PumpTX,PumpRX} 40 | --sleep_interval SLEEP_INTERVAL, -s SLEEP_INTERVAL 41 | Amount to sleep between polling. 42 | --prefix-path PREFIX_PATH 43 | Prefix to store saved files when using --save or 44 | --saveall. 45 | --saveall Whether or not to save all responses. 46 | --prefix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp} 47 | Built-in commands to run before the main one. 48 | --postfix {BaseCommand,Bolus,Experiment_OP161,Experiment_OP162,FilterGlucoseHistory,FilterHistory,FilterISIGHistory,GuardianSensorAlarmSilence,GuardianSensorDemoGraphTimeout,GuardianSensorRateChangeAlerts,GuardianSensorSettings,GuardianSensorSettings,KeypadPush,ManualCommand,Model511_ExperimentOP125,Model511_ExperimentOP126,Model511_Experiment_OP119,Model511_Experiment_OP120,Model511_Experiment_OP121,Model511_Experiment_OP122,Model511_Experiment_OP123,Model511_Experiment_OP124,Model511_Experiment_OP125,Model511_Experiment_OP126,Model511_Experiment_OP127,Model511_Experiment_OP128,Model511_Experiment_OP129,Model511_Experiment_OP130,Model511_Experiment_OP165,Model512Experiment_OP150,PowerControl,PowerControlOff,PumpCommand,PumpDisableDetailTrace,PumpEnableDetailTrace,PumpExperiment_OP69,PumpExperiment_OP70,PumpExperiment_OP71,PumpExperiment_OP72,PumpExperiment_OP73,PumpExperiment_OP75,PumpResume,PumpSuspend,PumpTraceSelect,PushACT,PushDOWN,PushEASY,PushESC,PushUP,Read128KMem,Read256KMem,ReadAlarms,ReadBGAlarmCLocks,ReadBGAlarmEnable,ReadBGReminderEnable,ReadBGTargets,ReadBGTargets515,ReadBGUnits,ReadBasalTemp,ReadBasalTemp508,ReadBatteryStatus,ReadBolusHistory,ReadBolusReminderEnable,ReadBolusReminders,ReadBolusWizardSetupStatus,ReadCalibrationFactor,ReadCarbRatios,ReadCarbRatios512,ReadCarbUnits,ReadContrast,ReadCurGlucosePageNumber,ReadCurPageNumber,ReadDailyTotals,ReadDetailTrace,ReadErrorStatus,ReadErrorStatus508,ReadFactoryParameters,ReadFirmwareVersion,ReadGlucoseHistory,ReadHistoryData,ReadISIGHistory,ReadInsulinSensitivities,ReadLanguage,ReadLogicLinkIDS,ReadNewTraceAlarm,ReadOldTraceAlarm,ReadOtherDevicesIDS,ReadPrimeBoluses,ReadProfileSets,ReadProfile_A512,ReadProfile_B512,ReadProfile_STD512,ReadProfiles511_A,ReadProfiles511_B,ReadProfiles511_STD,ReadPumpID,ReadPumpModel,ReadPumpState,ReadPumpStatus,ReadPumpTrace,ReadRTC,ReadRadioCtrlACL,ReadRemainingInsulin,ReadRemainingInsulin523,ReadRemoteControlID,ReadReservoirWarning,ReadSavedSettingsDate,ReadSensorHistoryData,ReadSensorSettings,ReadSettings,ReadSettings511,ReadSettings512,ReadSettings523,ReadTodayTotals508,ReadTotalsToday,ReadUserEvents,ReadVCNTRHistory,SelectBasalProfile,SelectBasalProfileA,SelectBasalProfileB,SelectBasalProfileSTD,SetAutoOff,SetBasalType,SetEnabledEasyBolus,SetSuspend,TempBasal,TempBasalPercent,WriteGlucoseHistoryTimestamp} 49 | Built-in commands to run after the main one. 50 | -------------------------------------------------------------------------------- /docs/docs/walkthrough/phase-1/visualization.md: -------------------------------------------------------------------------------- 1 | # Visualization and Monitoring 2 | 3 | [Nightscout](http://nightscout.info) is the recommended way to visualize your OpenAPS closed loop. Even if you don't choose to share your Nightscout instance with another person, it will be helpful for you to visualize what the loop is doing; what it's been doing; plus generate helpful reports for understanding your data and also allowing you to customize watchfaces with your OpenAPS data. This provides a visual alternative to SSHing into your raspberry Pi or loop system and looking through log files. 4 | 5 | ## Nightscout Integration 6 | 7 | The integration requires setting up Nightscout and making changes and additions to your OpenAPS implementation. 8 | 9 | ### Nightscout Setup 10 | 11 | OpenAPS requires the latest (currently dev) version of Nighthscout, which can be found here: https://github.com/nightscout/cgm-remote-monitor/tree/dev. 12 | 13 | Note: currently there is a bug in the dev version, which doesn't allow you to set up a new profile using the profile editor. If you are starting a fresh install of Nightscout, you should first deploy the master version of the code. Once the master version is up an running, you can create your profile with information on basal rates, etc. After that, you can deploy the dev version. If you have an existing version of Nightscout, then make sure you create your profile before moving to the dev version. Or, you may keep your existing Nightscout as is, and start a new Nightscout deployment (master first, followed by dev), specifically to test OpenAPS integration. 14 | 15 | The steps discussed here are essantially the same for both Azure and Heroku users. Two configuration changes must be made to the Nightscout implementation: 16 | 17 | * Add "openaps" (without the quotes) and, optionally, "pump" (without the quotes) to the list of plugins enabled, and 18 | * Add a new configuration variable DEVICESTATUS_ADVANCED="true" (without the quotes) 19 | 20 | For Azure users, here is what these configuration changes will look like (with just "openaps" added): ![azure config changes](https://files.gitter.im/eyim/lw6x/blob). For Heroku users, exactly the same changes should be made on the Config Vars page. The optional "pump" plugin enables additional pump monitoring pill boxes. For example, assuming you have added "pump" to the list of enabled plugins, you may add a new configuration variable PUMP_FIELDS="reservoir battery" to display pump reservoir and battery status on the Nightscout page. The "pump" plugin offers a number of other options, as documented on the Nightscout readme page: https://github.com/nightscout/cgm-remote-monitor/blob/dev/README.md#built-inexample-plugins 21 | 22 | Next, on your Nightscout website, go to the Settings (3 horizontal bars) in the upper right corner. At the very bottom of the Settings menu, in the "About" section, you may check the Nightscout version (e.g. version 0.9.0-dev). Just above is a list of Plugins available. OpenAPS should show up. Click the check box to enable. Similarly, in the case you've enabled the "pump" plugin, "Pump" should also show up in the list, and you may chekc the box to enable. You should now see the OpenAPS pill box (and any optional pump monitoring pill boxes) on the left side of the Nightscout page near the time. You may also want to graphically show the basal rates: select "Default" or "Icicle" from the "Render Basal" pull-down menu in the Settings. 23 | 24 | ### Environment Variables for OpenAPS Access to Nightscout 25 | 26 | To be able to upload data, OpenAPS needs to know the URL for your Nightscout website and the hashed version of your API_SECRET password, which you have entered as one of your Nightscout configuration variables. Two environment variables, NIGHTSCOUT_HOST and API_SECRET, are used to store the website address and the password, respectively. 27 | 28 | To obtain the hashed version of the API_SECRET, run the following ```echo -n "" | shasum``` and replace `````` with what you set up in Nightscout. For example, if your enter ```echo -n "password" | shasum```, the hashed version returned will be 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8. Run it with your password and save the hashed key that is output for the next step. 29 | 30 | In your terminal window, you may now define the two environment variables. This is done by adding them to your .profile in your home directory. The .profile runs each time the system starts and will ensure these variables are set for future use on the command line. 31 | 32 | ```nano ~/.profile``` and add the following at the end of the file below any other content that may already be there: 33 | ``` 34 | NIGHTSCOUT_HOST=https://; export NIGHTSCOUT_HOST 35 | API_SECRET=; export API_SECRET 36 | ``` 37 | 38 | Now run ```source /etc/profile``` to enact the changes we've just made without restart the machine 39 | 40 | ### Configuring and Uploading OpenAPS Status 41 | 42 | Integration with Nightscout requires couple of changes to your OpenAPS implementation, which include: 43 | 44 | * Adding a new `ns-status` device, and generating a new report `monitor/upload-status.json`, which consolidates the current OpenAPS status to be uploaded to Nightscout 45 | * Uploading the status report to Nightscount, using the `ns-upload` command 46 | 47 | Upon successful completion of these two steps, you will be able to see the current OpenAPS status by hovering over the OpenAPS pill box on your Nightscount page, as shown here, for example: ![Nightscout-Openaps pill box](https://files.gitter.im/eyim/J8OR/blob) 48 | 49 | The `ns-status` is a virtual device in the oref0 system, which consolidates OpenAPS status info in a form suitable for upload to Nightscout. First, add the device: 50 | 51 | ``` 52 | $ openaps device add ns-status process --require "clock iob suggested enacted battery reservoir status" ns-status 53 | ``` 54 | 55 | The corresponding entry in your openaps.ini file should look like this: 56 | 57 | [device "ns-status"]
58 | fields = clock iob suggested enacted battery reservoir status
59 | cmd = ns-status
60 | vendor = openaps.vendors.process
61 | args =
62 | 63 | Then use the `ns-status` device to add the `monitor/upload-status.json` report, which you may do as follows: 64 | 65 | ``` 66 | $ openaps report add monitor/upload-status.json JSON ns-status shell monitor/clock-zoned.json monitor/iob.json enact/suggested.json enact/enacted.json monitor/battery.json monitor/reservoir.json monitor/status.json 67 | ``` 68 | 69 | The reports required to generate upload-status.json should look familiar. If you have not generated any of these required reports, you should set them up and make sure they all work. In particular, note that monitor/clock-zoned.json contains the current pump clock time stamp, but with the timezone info included. If you have not generated that report already, you may do so using the following commands, which add a `tz` virtual device and use it to create clock-zoned.json starting from clock.json. 70 | 71 | ``` 72 | $ openaps vendor add openapscontrib.timezones 73 | $ openaps device add tz timezones 74 | $ git add tz.ini 75 | $ openaps report add monitor/clock-zoned.json JSON tz clock monitor/clock.json 76 | ``` 77 | 78 | At this point, you may want to update your monitor-pump alias to make sure that it produces all the required reports, so that uploading status to Nightscount can be automated. After you've generated a monitor/upload-status.json report, you can try to manually upload the OpenAPS status to Nightscout using the `ns-upload` command: 79 | 80 | ``` 81 | $ ns-upload $NIGHTSCOUT_HOST $API_SECRET devicestatus.json monitor/upload-status.json 82 | ``` 83 | 84 | If successful, this command will POST the status info to your Nightscout site, and return the content of the Nightscout devicestatus.json file, which you can examine to see what status information is sent to Nightscout. 85 | 86 | Finally, you may define a new alias `status-upload`, to combine generating the report and uploading the status to Nightscout: 87 | 88 | ``` 89 | $ openaps alias add status-upload '! bash -c "openaps report invoke monitor/upload-status.json && ns-upload $NIGHTSCOUT_HOST $API_SECRET devicestatus.json monitor/upload-status.json"' 90 | ``` 91 | 92 | To test this alias, you may first run your loop manually from command line, then execute `openaps status-upload`, examine the output, and check that the new status is visible on the OpenAPS pill box on your Nightscout page. To automate the status upload each time the loop is executed you can simply add `status-upload` to your main OpenAPS loop alias. The OpenAPS pill box will show when the last time your loop ran. If you hover over it, it will provide critical information that was used in the loop, which will help you understand what the loop is currently doing. 93 | 94 | The OpenAPS pill box has four states, based on what happened in the last 15 minutes: Enacted, Looping, Waiting, and Warning: 95 | 96 | * Waiting is when OpenAPS is uploading, but hasn't seen the pump in a while 97 | * Warning is when there hasn't been a status upload in the last 15 minutes 98 | * Enacted means OpenAPS has recently enacted the pump 99 | * Looping means OpenAPS is running but has not enacted the pump 100 | 101 | Some things to be aware of: 102 | 103 | * Make sure that the timezones for the pi (if need be you can use `sudo raspi-config` to change timezones), in your monitor/clock-zoned.json report, and the Nightscout website are all in the same time zone. 104 | * The basal changes won't appear in Nightscout until the second time the loop runs and the corresponding upload is made. 105 | * You can scroll back in time and at each glucose data point you can see what the critical information was at that time 106 | 107 | ### Uploading Latest Treatments to Nightscout 108 | 109 | In addition to uloading OpenAPS status, it also very beneficial to upload the treatment information from the pump into Nightscout. This removes the burden of entering this information into Nightscout manually. This can be accomplished using `nightscout` command and adding a new `upload-recent-treatments` alias as follows: 110 | 111 | ``` 112 | $ openaps alias add latest-ns-treatment-time '! bash -c "nightscout latest-openaps-treatment $NIGHTSCOUT_HOST | json created_at"' || die "Can't add latest-ns-treatment-time" 113 | $ openaps alias add format-latest-nightscout-treatments '! bash -c "nightscout cull-latest-openaps-treatments monitor/pumphistory-zoned.json settings/model.json $(openaps latest-ns-treatment-time) > upload/latest-treatments.json"' || die "Can't add format-latest-nightscout-treatments" 114 | $ 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" 115 | ``` 116 | 117 | 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. 118 | 119 | Note: Currently extended boluses are not handled well and depending on the timing of the upload are either missed entirely or have incorrect information. 120 | 121 | As a final step in the OpenAPS and Nightscout integration, you may add `status-upload` and `upload-recent-treatments` to your main loop, and automate the process using cron. Make sure you include the definitions of the environment variables NIGHTSCOUT_HOST and API_SECRET in the top part of your crontab file, without `export`, or quotes: 122 | ``` 123 | NIGHTSCOUT_HOST=https:// 124 | API_SECRET= 125 | ``` 126 | 127 | ### Setup script 128 | [This script](https://github.com/openaps/oref0/commit/d9951683cef1fd6aefc38d2c76ce9e5a177b9aa2) may be useful. 129 | --------------------------------------------------------------------------------