Comments (6)
new style walk through:
From scratch: install openaps (
sudo pip install -U openaps openaps-contrib
sudo pip install git+git://github.com/oskarpearson/mmeowlink.git
# and oref0
sudo npm install -g git://github.com/openaps/oref0.git'#dev'
- initialize openaps instance:
openaps init tutorial; cd tutorial
- install plugins:
openaps vendor add mmeowlink.vendors.mmeowlink
openaps vendor add openapscontrib.timezones
for 'share ble
sudo pip install git+git://github.com/bewest/Adafruit_Python_BluefruitLE.git'#wip/bewest/custom-gatt-profile'
sudo pip install git+git://github.com/bewest/openxshareble.git
openaps vendor add openxshareble
For pebble:
sudo pip install git+git://github.com/mddub/pancreabble.git
openaps vendor add pancreabble
See https://github.com/mddub/pancreabble for more details.
setup pump device:
Replace 123456
with your own pump's serial number.
carelink stick
openaps device add pump medtronic 123456
TI stick
The path, /dev/serial/by-id/usb-Nightscout_subg_rfspy_000002-if00
will change, depending on your own system.
openaps device add pump mmeowlink subg_rfspy /dev/serial/by-id/usb-Nightscout_subg_rfspy_000002-if00 123456
setup glucose device
- TODO: share/ble using openxshareble
- TODO: use
ns shell get
to fetch from NS - TODO: use bridges
- TODO: usb cable
- TODO: G5 ble
setup glucose reports:
openaps use cgm iter_glucose 288
seems to be needed for AMA. or maybeopenaps use ns shell get entries.json count=288
?
register oref0:
This creates several devices to manage oref0:
oref0 template mint device oref0 | openaps import
create lots of reports:
Create medtronic and oref0 reports, this handles timezones, units conversion, as well as detecting freshness of files.
oref0 template mint reports medtronic-pump | openaps import
oref0 template mint reports oref0-inputs | openaps import
add nightscout
Create ns
device. Replace https://my.nightscout.host
with your own Nightscout address, and averylongplainsecret
with your own plain API_SECRET
.
nightscout autoconfigure-device-crud https://my.nightscout.host averylongplainsecret
Make reports:
openaps report add nightscout/recent-treatments.json JSON ns shell format-recent-history-treatments monitor/pump-history.json model.json
openaps report add nightscout/uploaded.json JSON ns shell upload-non-empty-treatments nightscout/recent-treatments.json
admire work:
TODO: Aliases to weave it all together.
To review, there should be several devices:
$ openaps device show
process://oref0/oref0/
process://get-profile/oref0/get-profile
process://calculate-iob/oref0/calculate-iob
process://determine-basal/oref0/determine-basal
process://ns/nightscout/ns https://my.nightscout.host e6fc892e8e88235a476d197de3dfbef3f2db53d0
mmeowlink://pump
With quite a few reports:
$ openaps report show
get-profile://text/shell/oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json
determine-basal://text/shell/oref0-predict/oref0.json
pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
pump://JSON/read_clock/raw-pump/clock-raw.json
tz://JSON/clock/monitor/clock.json
pump://JSON/read_temp_basal/monitor/temp-basal-status.json
pump://JSON/iter_pump_hours/raw-pump/pump-history-raw.json
tz://JSON/rezone/monitor/pump-history.json
pump://JSON/model/model.json
pump://JSON/reservoir/monitor/reservoir.json
pump://JSON/read_status/monitor/status.json
pump://JSON/read_battery_status/monitor/battery.json
pump://JSON/set_temp_basal/oref0-enacted/enacted-temp-basal.json
oref0://JSON/shell/settings/settings.json
pump://JSON/read_settings/raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
pump://JSON/read_temp_basal/raw-pump/temp-basal-status.json
pump://JSON/reservoir/raw-pump/reservoir.json
pump://JSON/read_status/raw-pump/status.json
pump://JSON/read_battery_status/raw-pump/battery.json
ns://JSON/shell/nightscout/recent-treatments.json
ns://JSON/shell/nightscout/uploaded.json
Now we can simply invoke most of them in the right order.
Pro tip: Use openaps report show --cli
to view the corresponding use commands for each of these reports.
Let's make a few directories so the tools don't get stuck the first time:
mkdir monitor nightscout oref0-enacted oref0-monitor oref0-predict raw-cgm raw-pump settings
Here's some aliases @bewest is using successfully, these have been designed to be easy to mend and debug, as well as build upon.
$ openaps alias show
rm-warmup ! bash -c "rm -f model.json monitor/clock.json > /dev/null"
warmup report invoke model.json raw-pump/clock-raw.json monitor/clock.json
fail-warmup ! bash -c "echo PREFLIGHT FAIL; exit 1"
preflight ! bash -c "(openaps rm-warmup; echo PREFLIGHT ) && openaps warmup 2>&1 >/dev/null && grep -q T monitor/clock.json && echo PREFLIGHT OK || openaps fail-warmup"
monitor-cgm report invoke raw-cgm/glucose-raw.json monitor/glucose.json
monitor-pump-history report invoke raw-pump/pump-history-raw.json monitor/pump-history.json
get-basal-status report invoke monitor/temp-basal-status.json
get-pump-details report invoke monitor/reservoir.json monitor/status.json monitor/battery.json
get-settings report invoke raw-pump/bg-targets-raw.json settings/bg-targets.json raw-pump/insulin-sensitivities-raw.json settings/insulin-sensitivities.json raw-pump/selected-basal-profile.json raw-pump/settings.json settings/selected-basal-profile.json settings/settings.json
gather-pump-data ! bash -c "openaps get-basal-status; openaps get-pump-details; openaps monitor-pump-history; openaps get-settings"
gather-clean-data ! bash -c "openaps monitor-cgm && openaps gather-pump-data"
do-oref0 report invoke oref0-monitor/profile.json oref0-monitor/iob.json oref0-predict/oref0.json
enact-oref0 report invoke oref0-enacted/enacted-temp-basal.json
do-everything ! bash -c "(openaps preflight && openaps gather-clean-data && openaps do-oref0 && openaps enact-oref0); openaps report-nightscout"
ping ! echo PING
pong ! echo PONG
hello ! echo hello
okbar ! bash -c "echo $1" --
report-nightscout report invoke nightscout/recent-treatments.json nightscout/uploaded.json
from docs.
Aliases are now included:
bewest@bewest-MacBookPro:~/Documents/loop-new-style$ oref0 template mint alias -h
/usr/local/bin/oref0-template alias <type>
Commands:
common generate common aliases
Options:
-h, --help Show help [boolean]
bewest@bewest-MacBookPro:~/Documents/loop-new-style$ oref0 template mint alias common | openaps import
rm-warmup ! bash -c "rm -f model.json monitor/clock.json > /dev/null"
warmup report invoke model.json raw-pump/clock-raw.json monitor/clock.json
fail-warmup ! bash -c "echo PREFLIGHT FAIL; exit 1"
preflight ! bash -c "(openaps rm-warmup; echo PREFLIGHT ) && openaps warmup 2>&1 >/dev/null && grep -q T monitor/clock.json && echo PREFLIGHT OK || openaps fail-warmup"
monitor-cgm report invoke monitor/glucose-raw.json monitor/glucose.json
monitor-pump-history report invoke monitor/pump-history-raw.json monitor/pump-history.json
get-basal-status report invoke monitor/temp-basal-status.json
get-pump-details report invoke monitor/reservoir.json monitor/status.json monitor/battery.json
get-settings report invoke settings/bg-targets-raw.json settings/bg-targets.json settings/insulin-sensitivities-raw.json settings/insulin-sensitivities.json settings/selected-basal-profile.json settings/settings.json
gather-pump-data ! bash -c "openaps get-basal-status; openaps get-pump-details; openaps monitor-pump-history; openaps get-settings"
gather-clean-data ! bash -c "openaps monitor-cgm && openaps gather-pump-data"
do-oref0 report invoke oref0-monitor/profile.json oref0-monitor/iob.json oref0-predict/oref0.json
enact-oref0 report invoke oref0-enacted/enacted-temp-basal.json
do-everything ! bash -c "openaps preflight && openaps gather-clean-data && openaps do-oref0 && openaps enact-oref0"
from docs.
Here are some additional templates for consideration: https://gist.github.com/bewest/d3db9ca1c144b845382c885138a8f66e
from docs.
Hi Ben, I've tried template mint reports and template mint aliases (you are making everything too easy!). I think there may be a few inconsistencies in the minted aliases wrt minted reports, basically around raw-pump related reports:
monitor-pump-history report invoke monitor/pump-history-raw.json monitor/pump-history.json
should be:
monitor-pump-history report invoke raw-pump/pump-history-raw.json monitor/pump-history.json
get-settings report invoke settings/bg-targets-raw.json settings/bg-targets.json settings/insulin-sensitivities-raw.json settings/insulin-sensitivities.json settings/selected-basal-profile.json settings/settings.json
should be
get-settings report invoke raw-pump/bg-targets-raw.json settings/bg-targets.json raw-pump/insulin-sensitivities-raw.json settings/insulin-sensitivities.json raw-pump/selected-basal-profile.json settings/selected-basal-profile.json raw-pump/settings.json settings/settings.json
from docs.
@dm61 I added a patch to dev to tweak things, thanks to your feedback.
from docs.
Hi Ben unless I'm mistaken you need to add in a line to add in "tz" and "units" devices unless Iām mistaken openaps device add tz timezones
and openaps device add units units
Regards
John
from docs.
Related Issues (20)
- Add instructions on how to "open loop" HOT 4
- Interacting with the APS HOT 1
- Suggestion for flowcharts/visuals/diagrams/images moving forward HOT 5
- Hardware for attaching Explorer block to Intel Edison HOT 2
- Max IOB example is misleading
- suggestion making requirements for rig more clear (especially explorer HAT) HOT 6
- compatible pumps - update for Tandem t:slim X2 HOT 1
- Debian Jessie has lost upstream support HOT 1
- why not have chinese HOT 1
- "Get your rig parts" page puts casing info for Edison boards inside "Pi-based setups with rewired TI-stick" section HOT 1
- Information about Li-Po battery lifetime HOT 1
- Autobuild Documentation for Pull Requests HOT 1
- This is still broken - running curl -s https://raw.githubusercontent.com/openaps/docs/master/scripts/quick-packages.sh | bash - HOT 1
- MongoDB cluster setup instructions missing from Nightscout install page HOT 4
- Add Flashing Troubleshooting to the Main Nav HOT 3
- Dropdown rendering in github but not RTD
- Documentation outdated: overview incorrectly shows OmniPod as not loopable! HOT 2
- Does this still work after mLab MongoDB add-on removed from Heroku? HOT 2
- questions about androidaps note HOT 2
- Master vs dev discrepancy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.