Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install autotune with oref0-setup #312

Merged
merged 24 commits into from
Jan 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f4f0e3c
Commenting out "type": = "current" (#296)
danamlewis Dec 31, 2016
aed5d31
restart networking completely instead just cycling wlan0 (#284)
kenstack Jan 1, 2017
c308e17
Bt device name (#307)
Bender1061 Jan 1, 2017
3e9805b
Exit scripts when variables under or functions fail (#309)
ijustlovemath Jan 2, 2017
3c6e36f
first attempt at setting up nightly autotune with oref0-setup and usi…
scottleibrand Jan 2, 2017
3e84ac6
Merge branch 'dev' into autotune-install
scottleibrand Jan 2, 2017
989a204
increment version number for autotune
scottleibrand Jan 2, 2017
bf7ab3c
Merge branch 'autotune' into autotune-install
scottleibrand Jan 2, 2017
f529ed4
check if settings/autotune.json is valid json
scottleibrand Jan 2, 2017
0a1023d
specify a default for radio_locale
scottleibrand Jan 2, 2017
4618457
remove set -e from oref0-setup
scottleibrand Jan 2, 2017
2e9a098
require openaps 0.1.6 or higher for radio_locale
scottleibrand Jan 2, 2017
f700e08
apparently set -u requires radio_locale to be set
scottleibrand Jan 2, 2017
66c3145
radio_locale requires openaps 0.2.0-dev or later
scottleibrand Jan 2, 2017
588799d
attempt to fix set -eu NIGHTSCOUT_DEBUG: unbound variable
scottleibrand Jan 2, 2017
9485c4d
Revert "attempt to fix set -eu NIGHTSCOUT_DEBUG: unbound variable"
scottleibrand Jan 2, 2017
0061721
set -eu incompatible with test "$NIGHTSCOUT_DEBUG" = "1" &&
scottleibrand Jan 3, 2017
fac3cb3
Revert "Exit scripts when variables under or functions fail"
scottleibrand Jan 3, 2017
21b33e5
Merge pull request #311 from openaps/revert-309-patch-1
scottleibrand Jan 3, 2017
f7855b8
Merge branch 'dev' into autotune-install
scottleibrand Jan 3, 2017
6574a02
grep quietly
scottleibrand Jan 3, 2017
3d954f7
redirect oref0-ns-autotune stderr to log file
scottleibrand Jan 3, 2017
d6da295
update script name in usage
scottleibrand Jan 3, 2017
7e5537a
use settings/pumpprofile.json in oref0-ns-autotune
scottleibrand Jan 3, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions bin/oref0-autotune-test.sh → bin/oref0-ns-autotune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ esac
done

if [[ -z "$DIR" || -z "$NIGHTSCOUT_HOST" ]]; then
echo "Usage: oref0-autotune-test.sh <--dir=openaps_directory> <--ns-host=https://mynightscout.azurewebsites.net> [--start-date=YYYY-MM-DD] [--runs=number_of_runs] [--end-date=YYYY-MM-DD]"
echo "Usage: oref0-ns-autotune <--dir=openaps_directory> <--ns-host=https://mynightscout.azurewebsites.net> [--start-date=YYYY-MM-DD] [--runs=number_of_runs] [--end-date=YYYY-MM-DD]"
exit 1
fi
if [[ -z "$START_DATE" ]]; then
Expand All @@ -98,9 +98,9 @@ fi

# Get profile for testing copied to home directory. "openaps" is my loop directory name.
cd $directory && mkdir -p autotune
cp settings/profile.json autotune/profile.pump.json
# If a previous settings/autotune.json exists, use that; otherwise start from settings/profile.json
cp settings/autotune.json autotune/profile.json || cp autotune/profile.pump.json autotune/profile.json
cp settings/pumpprofile.json autotune/profile.pump.json
# If a previous valid settings/autotune.json exists, use that; otherwise start from settings/profile.json
cp settings/autotune.json autotune/profile.json && cat autotune/profile.json | json | grep -q start || cp autotune/profile.pump.json autotune/profile.json
cd autotune
# TODO: Need to think through what to remove in the autotune folder...

Expand Down Expand Up @@ -145,10 +145,12 @@ do
cp profile.json profile.$run_number.$i.json
# Autotune Prep (required args, <pumphistory.json> <profile.json> <glucose.json>), output prepped glucose
# data or <autotune/glucose.json> below
echo "~/src/oref0/bin/oref0-autotune-prep.js ns-treatments.json profile.json ns-entries.$i.json > autotune.$run_number.$i.json"
~/src/oref0/bin/oref0-autotune-prep.js ns-treatments.json profile.json ns-entries.$i.json > autotune.$run_number.$i.json

# Autotune (required args, <autotune/glucose.json> <autotune/autotune.json> <settings/profile.json>),
# output autotuned profile or what will be used as <autotune/autotune.json> in the next iteration
echo "~/src/oref0/bin/oref0-autotune.js autotune.$run_number.$i.json profile.json profile.pump.json > newprofile.$run_number.$i.json"
~/src/oref0/bin/oref0-autotune.js autotune.$run_number.$i.json profile.json profile.pump.json > newprofile.$run_number.$i.json

# Copy tuned profile produced by autotune to profile.json for use with next day of data
Expand Down
11 changes: 7 additions & 4 deletions bin/oref0-online.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
MAC=$1
echo -n "At $(date) my IP is: "
if ! curl -m 15 icanhazip.com; then
echo -n "Error, cycling wlan0 "
sudo ifdown wlan0
sudo ifup wlan0
echo -n "Error, cycling networking "
# simply restart networking completely for stability purposes
/etc/init.d/networking stop
sleep 5
/etc/init.d/networking start
echo -n "and getting new wlan0 IP"
ps aux | grep -v grep | grep -q "dhclient wlan0" && sudo killall dhclient
sudo dhclient wlan0 -r
Expand All @@ -13,7 +15,8 @@ if ! curl -m 15 icanhazip.com; then
echo -n "At $(date) my IP is: "
if ! curl -m 15 icanhazip.com; then
echo -n "Error, connecting BT to $MAC "
sudo killall bluetoothd; sudo /usr/local/bin/bluetoothd --experimental &
sudo killall bluetoothd; sleep 5; sudo /usr/local/bin/bluetoothd --experimental &
sudo hciconfig hci0 name $HOSTNAME
sudo bt-pan client $MAC
echo -n "and getting bnep0 IP"
sudo dhclient bnep0
Expand Down
104 changes: 62 additions & 42 deletions bin/oref0-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CGM="G4"
DIR=""
directory=""
EXTRAS=""
radio_locale="US"

for i in "$@"
do
Expand Down Expand Up @@ -185,6 +186,10 @@ if [[ -z "$DIR" || -z "$serial" ]]; then
if [[ $REPLY =~ ^[Yy]$ ]]; then
ENABLE+=" autosens "
fi
read -p "Enable autotuning of basals and ratios? y/[N] " -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
ENABLE+=" autotune "
fi
read -p "Enable advanced meal assist? y/[N] " -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
ENABLE+=" meal "
Expand Down Expand Up @@ -300,6 +305,7 @@ if [[ ! -z "$BT_MAC" || ${CGM,,} =~ "shareble" ]]; then
cd $HOME/src/bluez-5.37 && ./configure --enable-experimental --disable-systemd && \
make && sudo make install && sudo cp ./src/bluetoothd /usr/local/bin/ || die "Couldn't make bluez"
sudo killall bluetoothd; sudo /usr/local/bin/bluetoothd --experimental &
sudo hciconfig hci0 name $HOSTNAME
else
echo bluez v 5.37 already installed
fi
Expand Down Expand Up @@ -336,7 +342,7 @@ elif [[ ${CGM,,} =~ "shareble" ]]; then
if bluetoothd --version | grep -q 5.37 2>/dev/null; then
sudo cp $HOME/src/openxshareble/bluetoothd.conf /etc/dbus-1/system.d/bluetooth.conf || die "Couldn't copy bluetoothd.conf"
fi
# add two lines to /etc/rc.local if they are missing.
# add two lines to /etc/rc.local if they are missing.
if ! grep -q '/usr/local/bin/bluetoothd --experimental &' /etc/rc.local; then
sed -i"" 's/^exit 0/\/usr\/local\/bin\/bluetoothd --experimental \&\n\nexit 0/' /etc/rc.local
fi
Expand All @@ -346,7 +352,7 @@ elif [[ ${CGM,,} =~ "shareble" ]]; then
# comment out existing line if it exists and isn't already commented out
sed -i"" 's/^screen -S "brcm_patchram_plus" -d -m \/usr\/local\/sbin\/bluetooth_patchram.sh/# &/' /etc/rc.local
echo Checking openaps dev installation
if ! openaps use cgm -h | grep -q nightscout_calibrations; then
if ! openaps --version | egrep "0.[2-9].[0-9]"; then
if [ -d "$HOME/src/openaps/" ]; then
echo "$HOME/src/openaps/ already exists; pulling latest dev branch"
(cd ~/src/openaps && git fetch && git checkout dev && git pull) || die "Couldn't pull latest openaps dev"
Expand Down Expand Up @@ -442,7 +448,7 @@ if [[ -z "$ttyport" ]]; then
openaps alias add wait-for-long-silence 'report invoke monitor/temp_basal.json'
openaps alias add mmtune 'report invoke monitor/temp_basal.json'
else
# radio_locale requires openaps 0.1.6-dev or later
# radio_locale requires openaps 0.2.0-dev or later
openaps device add pump mmeowlink subg_rfspy $ttyport $serial $radio_locale || die "Can't add pump"
openaps alias add wait-for-silence '! bash -c "(mmeowlink-any-pump-comms.py --port '$ttyport' --wait-for 1 | grep -q comms && echo -n Radio ok, || openaps mmtune) && echo -n \" Listening: \"; for i in $(seq 1 100); do echo -n .; mmeowlink-any-pump-comms.py --port '$ttyport' --wait-for 30 2>/dev/null | egrep -v subg | egrep No && break; done"'
openaps alias add wait-for-long-silence '! bash -c "echo -n \"Listening: \"; for i in $(seq 1 200); do echo -n .; mmeowlink-any-pump-comms.py --port '$ttyport' --wait-for 45 2>/dev/null | egrep -v subg | egrep No && break; done"'
Expand Down Expand Up @@ -486,14 +492,6 @@ if [[ ${CGM,,} =~ "xdrip" ]]; then
touch /tmp/reboot-required
fi

# configure optional features
if [[ $ENABLE =~ autosens && $ENABLE =~ meal ]]; then
EXTRAS="settings/autosens.json monitor/meal.json"
elif [[ $ENABLE =~ autosens ]]; then
EXTRAS="settings/autosens.json"
elif [[ $ENABLE =~ meal ]]; then
EXTRAS='"" monitor/meal.json'
fi
# Install EdisonVoltage
if egrep -i "edison" /etc/passwd 2>/dev/null; then
echo "Checking if EdisonVoltage is already installed"
Expand All @@ -509,11 +507,29 @@ if egrep -i "edison" /etc/passwd 2>/dev/null; then
for type in edisonbattery; do
echo importing $type file
cat $HOME/src/oref0/lib/oref0-setup/$type.json | openaps import || die "Could not import $type.json"
done
done
fi

# configure optional features passed to enact/suggested.json report
if [[ $ENABLE =~ autosens && $ENABLE =~ meal ]]; then
EXTRAS="settings/autosens.json monitor/meal.json"
elif [[ $ENABLE =~ autosens ]]; then
EXTRAS="settings/autosens.json"
elif [[ $ENABLE =~ meal ]]; then
EXTRAS='"" monitor/meal.json'
fi
echo Running: openaps report add enact/suggested.json text determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json $EXTRAS
openaps report add enact/suggested.json text determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json $EXTRAS

# configure autotune if enabled
if [[ $ENABLE =~ autotune ]]; then
cd $directory || die "Can't cd $directory"
for type in autotune; do
echo importing $type file
cat $HOME/src/oref0/lib/oref0-setup/$type.json | openaps import || die "Could not import $type.json"
done
fi

# Create ~/.profile so that openaps commands can be executed from the command line
# as long as we still use enivorement variables it's easy that the openaps commands work from both crontab and from a common shell
# TODO: remove API_SECRET and NIGHTSCOUT_HOST (see https://github.com/openaps/oref0/issues/299)
Expand All @@ -533,44 +549,48 @@ echo
read -p "Schedule openaps in cron? y/[N] " -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
# add crontab entries
(crontab -l; crontab -l | grep -q "$NIGHTSCOUT_HOST" || echo NIGHTSCOUT_HOST=$NIGHTSCOUT_HOST) | crontab -
(crontab -l; crontab -l | grep -q "API_SECRET=" || echo API_SECRET=$(nightscout hash-api-secret $API_SECRET)) | crontab -
(crontab -l; crontab -l | grep -q "PATH=" || echo "PATH=$PATH" ) | crontab -
(crontab -l; crontab -l | grep -q "oref0-online $BT_MAC" || echo '* * * * * ps aux | grep -v grep | grep -q "oref0-online '$BT_MAC'" || oref0-online '$BT_MAC' >> /var/log/openaps/network.log' ) | crontab -
(crontab -l; crontab -l | grep -q "sudo wpa_cli scan" || echo '* * * * * sudo wpa_cli scan') | crontab -
(crontab -l; crontab -l | grep -q "killall -g --older-than" || echo '* * * * * killall -g --older-than 15m openaps') | crontab -
# repair or reset git repository if it's corrupted or disk is full
(crontab -l; crontab -l | grep -q "cd $directory && oref0-reset-git" || echo "* * * * * cd $directory && oref0-reset-git") | crontab -
#truncate git history to 1000 commits if it has grown past 1500
(crontab -l; crontab -l | grep -q "cd $directory && oref0-truncate-git-history" || echo "* * * * * cd $directory && oref0-truncate-git-history") | crontab -
if [[ ${CGM,,} =~ "shareble" ]]; then
(crontab -l; crontab -l | grep -q "cd $directory-cgm-loop && ps aux | grep -v grep | grep -q 'openaps monitor-cgm'" || echo "* * * * * cd $directory-cgm-loop && ps aux | grep -v grep | grep -q 'openaps monitor-cgm' || ( date; openaps monitor-cgm) | tee -a /var/log/openaps/cgm-loop.log; cp -up monitor/glucose-raw-merge.json $directory/cgm/glucose.json ; cp -up $directory/cgm/glucose.json $directory/monitor/glucose.json") | crontab -
elif [[ ${CGM,,} =~ "xdrip" ]]; then
(crontab -l; crontab -l | grep -q "cd $directory && ps aux | grep -v grep | grep -q 'openaps monitor-xdrip'" || echo "* * * * * cd $directory && ps aux | grep -v grep | grep -q 'openaps monitor-xdrip' || ( date; openaps monitor-xdrip) | tee -a /var/log/openaps/xdrip-loop.log; cp -up $directory/xdrip/glucose.json $directory/monitor/glucose.json") | crontab -
(crontab -l; crontab -l | grep -q "xDripAPS.py" || echo "@reboot python $HOME/.xDripAPS/xDripAPS.py") | crontab -
elif [[ $ENABLE =~ dexusb ]]; then
(crontab -l; crontab -l | grep -q "@reboot .*dexusb-cgm" || echo "@reboot /usr/bin/python -u /usr/local/bin/oref0-dexusb-cgm-loop >> /var/log/openaps/cgm-dexusb-loop.log 2>&1" ) | crontab -
elif ! [[ ${CGM,,} =~ "mdt" ]]; then # use nightscout for cgm
(crontab -l; crontab -l | grep -q "cd $directory && ps aux | grep -v grep | grep -q 'openaps get-bg'" || echo "* * * * * cd $directory && ps aux | grep -v grep | grep -q 'openaps get-bg' || ( date; openaps get-bg ; cat cgm/glucose.json | json -a sgv dateString | head -1 ) | tee -a /var/log/openaps/cgm-loop.log") | crontab -
fi
(crontab -l; crontab -l | grep -q "cd $directory && ps aux | grep -v grep | grep -q 'openaps ns-loop'" || echo "* * * * * cd $directory && ps aux | grep -v grep | grep -q 'openaps ns-loop' || openaps ns-loop | tee -a /var/log/openaps/ns-loop.log") | crontab -
if [[ $ENABLE =~ autosens ]]; then
(crontab -l; crontab -l | grep -q "cd $directory && ps aux | grep -v grep | grep -q 'openaps autosens'" || echo "* * * * * cd $directory && ps aux | grep -v grep | grep -q 'openaps autosens' || openaps autosens | tee -a /var/log/openaps/autosens-loop.log") | crontab -
fi
if [[ "$ttyport" =~ "spi" ]]; then
(crontab -l; crontab -l | grep -q "reset_spi_serial.py" || echo "@reboot reset_spi_serial.py") | crontab -
(crontab -l; crontab -l | grep -q "$NIGHTSCOUT_HOST" || echo NIGHTSCOUT_HOST=$NIGHTSCOUT_HOST) | crontab -
(crontab -l; crontab -l | grep -q "API_SECRET=" || echo API_SECRET=$(nightscout hash-api-secret $API_SECRET)) | crontab -
(crontab -l; crontab -l | grep -q "PATH=" || echo "PATH=$PATH" ) | crontab -
(crontab -l; crontab -l | grep -q "oref0-online $BT_MAC" || echo '* * * * * ps aux | grep -v grep | grep -q "oref0-online '$BT_MAC'" || oref0-online '$BT_MAC' >> /var/log/openaps/network.log' ) | crontab -
(crontab -l; crontab -l | grep -q "sudo wpa_cli scan" || echo '* * * * * sudo wpa_cli scan') | crontab -
(crontab -l; crontab -l | grep -q "killall -g --older-than" || echo '* * * * * killall -g --older-than 15m openaps') | crontab -
# repair or reset git repository if it's corrupted or disk is full
(crontab -l; crontab -l | grep -q "cd $directory && oref0-reset-git" || echo "* * * * * cd $directory && oref0-reset-git") | crontab -
# truncate git history to 1000 commits if it has grown past 1500
(crontab -l; crontab -l | grep -q "cd $directory && oref0-truncate-git-history" || echo "* * * * * cd $directory && oref0-truncate-git-history") | crontab -
if [[ ${CGM,,} =~ "shareble" ]]; then
(crontab -l; crontab -l | grep -q "cd $directory-cgm-loop && ps aux | grep -v grep | grep -q 'openaps monitor-cgm'" || echo "* * * * * cd $directory-cgm-loop && ps aux | grep -v grep | grep -q 'openaps monitor-cgm' || ( date; openaps monitor-cgm) | tee -a /var/log/openaps/cgm-loop.log; cp -up monitor/glucose-raw-merge.json $directory/cgm/glucose.json ; cp -up $directory/cgm/glucose.json $directory/monitor/glucose.json") | crontab -
elif [[ ${CGM,,} =~ "xdrip" ]]; then
(crontab -l; crontab -l | grep -q "cd $directory && ps aux | grep -v grep | grep -q 'openaps monitor-xdrip'" || echo "* * * * * cd $directory && ps aux | grep -v grep | grep -q 'openaps monitor-xdrip' || ( date; openaps monitor-xdrip) | tee -a /var/log/openaps/xdrip-loop.log; cp -up $directory/xdrip/glucose.json $directory/monitor/glucose.json") | crontab -
(crontab -l; crontab -l | grep -q "xDripAPS.py" || echo "@reboot python $HOME/.xDripAPS/xDripAPS.py") | crontab -
elif [[ $ENABLE =~ dexusb ]]; then
(crontab -l; crontab -l | grep -q "@reboot .*dexusb-cgm" || echo "@reboot /usr/bin/python -u /usr/local/bin/oref0-dexusb-cgm-loop >> /var/log/openaps/cgm-dexusb-loop.log 2>&1" ) | crontab -
elif ! [[ ${CGM,,} =~ "mdt" ]]; then # use nightscout for cgm
(crontab -l; crontab -l | grep -q "cd $directory && ps aux | grep -v grep | grep -q 'openaps get-bg'" || echo "* * * * * cd $directory && ps aux | grep -v grep | grep -q 'openaps get-bg' || ( date; openaps get-bg ; cat cgm/glucose.json | json -a sgv dateString | head -1 ) | tee -a /var/log/openaps/cgm-loop.log") | crontab -
fi
(crontab -l; crontab -l | grep -q "cd $directory && ps aux | grep -v grep | grep -q 'openaps ns-loop'" || echo "* * * * * cd $directory && ps aux | grep -v grep | grep -q 'openaps ns-loop' || openaps ns-loop | tee -a /var/log/openaps/ns-loop.log") | crontab -
if [[ $ENABLE =~ autosens ]]; then
(crontab -l; crontab -l | grep -q "cd $directory && ps aux | grep -v grep | grep -q 'openaps autosens'" || echo "* * * * * cd $directory && ps aux | grep -v grep | grep -q 'openaps autosens' || openaps autosens | tee -a /var/log/openaps/autosens-loop.log") | crontab -
fi
if [[ $ENABLE =~ autotune ]]; then
# autotune nightly at 12:05am using data from NS
(crontab -l; crontab -l | grep -q "oref0-autotune -d=$directory -n=$NIGHTSCOUT_HOST" || echo "5 0 * * * ( oref0-ns-autotune -d=$directory -n=$NIGHTSCOUT_HOST && cp $directory/autotune/profile.json $directory/settings/autotune.json) 2>&1 | tee -a /var/log/openaps/autotune.log") | crontab -
fi
if [[ "$ttyport" =~ "spi" ]]; then
(crontab -l; crontab -l | grep -q "reset_spi_serial.py" || echo "@reboot reset_spi_serial.py") | crontab -
fi
(crontab -l; crontab -l | grep -q "cd $directory && ( ps aux | grep -v grep | grep -q 'openaps pump-loop'" || echo "* * * * * cd $directory && ( ps aux | grep -v grep | grep -q 'openaps pump-loop' || openaps pump-loop ) 2>&1 | tee -a /var/log/openaps/pump-loop.log") | crontab -
crontab -l
fi
(crontab -l; crontab -l | grep -q "cd $directory && ( ps aux | grep -v grep | grep -q 'openaps pump-loop'" || echo "* * * * * cd $directory && ( ps aux | grep -v grep | grep -q 'openaps pump-loop' || openaps pump-loop ) 2>&1 | tee -a /var/log/openaps/pump-loop.log") | crontab -
crontab -l

if [[ ${CGM,,} =~ "shareble" ]]; then
echo
echo "To pair your G4 Share receiver, open its Setttings, select Share, Forget Device (if previously paired), then turn sharing On"
fi

fi

fi
fi # from 'read -p "Continue? y/[N] " -r' after interactive setup is complete

if [ -e /tmp/reboot-required ]; then
read -p "Reboot required. Press enter to reboot or Ctrl-C to cancel"
Expand Down
43 changes: 43 additions & 0 deletions lib/oref0-setup/autotune.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[
{
"settings/pumpprofile.json": {
"use": "shell",
"bg_targets": "settings/bg_targets.json",
"preferences": "preferences.json",
"settings": "settings/settings.json",
"basal_profile": "settings/basal_profile.json",
"reporter": "text",
"json_default": "True",
"carb_ratios": "settings/carb_ratios.json",
"device": "get-profile",
"remainder": "--model=settings/model.json",
"isf": "settings/insulin_sensitivities.json"
},
"type": "report",
"name": "settings/pumpprofile.json"
},
{
"settings/profile.json": {
"use": "shell",
"bg_targets": "settings/bg_targets.json",
"preferences": "preferences.json",
"settings": "settings/settings.json",
"basal_profile": "settings/basal_profile.json",
"reporter": "text",
"json_default": "True",
"carb_ratios": "settings/carb_ratios.json",
"device": "get-profile",
"remainder": "settings/temptargets.json --model=settings/model.json --autotune settings/autotune.json",
"isf": "settings/insulin_sensitivities.json"
},
"type": "report",
"name": "settings/profile.json"
},
{
"type": "alias",
"name": "get-settings",
"get-settings": {
"command": "report invoke settings/model.json settings/bg_targets_raw.json settings/bg_targets.json settings/insulin_sensitivities_raw.json settings/insulin_sensitivities.json settings/basal_profile.json settings/settings.json settings/carb_ratios.json settings/pumpprofile.json settings/profile.json"
}
}
]
2 changes: 1 addition & 1 deletion lib/profile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var carb_ratios = require('./carbs');
function defaults ( ) {
var profile = {
max_iob: 0 // if max_iob is not provided, never give more insulin than the pump would have
, type: 'current'
// , type: 'current'
, max_daily_safety_multiplier: 3
, current_basal_safety_multiplier: 4
, autosens_max: 1.2
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oref0",
"version": "0.3.4-dev",
"version": "0.3.5-dev",
"description": "openaps oref0 reference implementation of the reference design",
"scripts": {
"test": "make test",
Expand Down Expand Up @@ -32,6 +32,8 @@
"ns-upload": "./bin/ns-upload.sh",
"ns-upload-entries": "./bin/ns-upload-entries.sh",
"oref0": "./bin/oref0.sh",
"oref0-autotune-prep": "./bin/oref0-autotune-prep.js",
"oref0-autotune": "./bin/oref0-autotune.js",
"oref0-calculate-iob": "./bin/oref0-calculate-iob.js",
"oref0-copy-fresher": "./bin/oref0-copy-fresher",
"oref0-crun": "./bin/oref0-conditional-run.sh",
Expand All @@ -50,6 +52,7 @@
"oref0-meal": "./bin/oref0-meal.js",
"oref0-mint-max-iob": "./bin/oref0-mint-max-iob.sh",
"oref0-normalize-temps": "./bin/oref0-normalize-temps.js",
"oref0-ns-autotune": "./bin/oref0-ns-autotune.sh",
"oref0-online": "./bin/oref0-online.sh",
"oref0-pebble": "./bin/oref0-pebble.js",
"oref0-raw": "./bin/oref0-raw.js",
Expand Down