Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8ee8483
update example Go versions to verison with token based authentication
PieterGit Dec 25, 2018
c6ea53e
run travis with latest node 8 and node 10 (both LTS)
PieterGit Dec 25, 2018
d45d29c
remove init pump comms to set ww parameters. this is now done with ec…
PieterGit Dec 25, 2018
5e15e18
fix duplicate radio_locale in pump.ini and don't run default code in …
PieterGit Dec 25, 2018
e54bdbe
create pump.ini before nightscout autoconfigure-device-crud
PieterGit Dec 25, 2018
459c2e2
remove ww_ti_usb_reset
PieterGit Dec 25, 2018
5b720b1
remove extra empty line
PieterGit Dec 25, 2018
1d73dbb
WIP to deprecate old MDT CGM setup (new MDT CGM Go stuff just require…
cluckj Dec 25, 2018
4971861
remove depreacte medtronic non Go setup
cluckj Dec 25, 2018
ac43e91
rename openaps-*.sh to oref0-*.sh and adjust
PieterGit Dec 27, 2018
889cca7
remove crypto 0.0.3, it is included in Node
PieterGit Dec 27, 2018
e94cc78
update npm packages
PieterGit Dec 27, 2018
bd9a9c4
use jq >= 1.5 for slurpfile.
PieterGit Dec 27, 2018
1e2ac27
Introduce is_debian_jessie function and use it to install jq from jes…
PieterGit Dec 27, 2018
620ea30
still add openaps to oref0-packages for now
PieterGit Dec 27, 2018
a679bd9
remove creation of pump.ini as scott suggests
PieterGit Dec 27, 2018
9bad0e2
Merge branch 'dev' of https://github.com/openaps/oref0 into 201812_de…
PieterGit Jan 27, 2019
60aa85c
revert ac43e91a1a6a25fb3f42c1423ede7254a6e29cea renaming as scott sug…
PieterGit Jan 27, 2019
300a100
switch back to openaps-packages.sh instead of oref0-packages.sh as sc…
PieterGit Jan 27, 2019
9204022
on a fresh rpi3 there is no /usr/local/bin/mmtune so don't move it
PieterGit Jan 27, 2019
2c3d41b
Merge branch 'dev' of https://github.com/openaps/oref0 into 201812_dev
PieterGit Feb 17, 2019
9defb3c
implement changes as requested by scott
PieterGit Feb 17, 2019
d7c8a27
upgrade yargs to avoid security vulnerability . did a quick check of …
PieterGit Feb 17, 2019
2eeae2e
pull https://github.com/openaps/oref0/pull/1203 into this branch and …
cclauss Feb 17, 2019
72eac54
Merge branch 'dev' into 201812_dev
PieterGit Feb 17, 2019
21204a4
some cleanup, consistent radio_locale string in pump.ini
PieterGit Feb 17, 2019
e658acc
Merge branch '201812_dev' of https://github.com/PieterGit/oref0 into …
PieterGit Feb 17, 2019
54a0f25
there is no need to install the released oref0 globally, because oref…
PieterGit Feb 17, 2019
e074d61
prevent spurious grep message if monitor/mmtune.json is empty
PieterGit Feb 17, 2019
eb4d387
Merge branch 'dev' of https://github.com/openaps/oref0 into 201812_dev
PieterGit Feb 20, 2019
3b731e3
1) cleanup ugly pump.ini stuff for edison. 2) mmeowlink is not only n…
PieterGit Feb 20, 2019
07eba20
add missing then
PieterGit Feb 20, 2019
641fbdd
Merge branch 'dev' into 201812_dev
PieterGit Mar 1, 2019
ea1d009
fix package.json typo and upgrade coveralls to 3.0.3
PieterGit Mar 1, 2019
8d4f608
Merge branch 'dev' into 201812_dev
PieterGit Mar 2, 2019
4f95a21
remove webpack from this branch
PieterGit Mar 5, 2019
3665309
upgrade share2nightscout bridge and yargs
PieterGit Mar 9, 2019
7a809c9
Merge branch 'dev' of https://github.com/openaps/oref0 into 201812_dev
PieterGit Mar 9, 2019
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
11 changes: 9 additions & 2 deletions bin/openaps-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4

apt-get install -y sudo
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y git python python-dev software-properties-common python-numpy python-pip watchdog strace tcpdump screen acpid vim locate jq lm-sensors || die "Couldn't install packages"
sudo apt-get install -y git python python-dev software-properties-common python-numpy python-pip watchdog strace tcpdump screen acpid vim locate lm-sensors || die "Couldn't install packages"

# We require jq >= 1.5 for --slurpfile for merging preferences. Debian Jessie ships with 1.4
if is_debian_jessie; then
sudo apt-get -y -t jessie-backports install jq || die "Couldn't install jq from jessie-backports"
else
sudo apt-get -y install jq || die "Couldn't install jq"
fi

# install/upgrade to latest node 8 if neither node 8 nor node 10+ LTS are installed
if ! nodejs --version | grep -e 'v8\.' -e 'v1[02468]\.' ; then
Expand All @@ -27,6 +34,6 @@ sudo pip install -U openaps || die "Couldn't install openaps toolkit"
sudo pip install -U openaps-contrib || die "Couldn't install openaps-contrib"
sudo openaps-install-udev-rules || die "Couldn't run openaps-install-udev-rules"
sudo activate-global-python-argcomplete || die "Couldn't run activate-global-python-argcomplete"
sudo npm install -g json oref0 || die "Couldn't install json and oref0"
sudo npm install -g json || die "Couldn't install npm json"
echo openaps installed
openaps --version
9 changes: 9 additions & 0 deletions bin/oref0-bash-common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ is_edison () {
fi
}

# Returns success (0) if running on a Debian Jessie system, fail (1) otherwise
is_debian_jessie() {
if cat /etc/os-release | grep 'PRETTY_NAME="Debian GNU/Linux 8 (jessie)"' &> /dev/null; then
return 0
else
return 1
fi
}

# Returns success (0) if running on a Raspberry Pi, fail (1) otherwise. Uses
# the existence of a "pi" account in /etc/passwd to determine that.
is_pi () {
Expand Down
10 changes: 7 additions & 3 deletions bin/oref0-mmtune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EOF

assert_cwd_contains_ini

export MEDTRONIC_PUMP_ID=`grep serial pump.ini | tr -cd 0-9`
export MEDTRONIC_PUMP_ID=`get_pref_string .pump_serial | tr -cd 0-9`
export MEDTRONIC_FREQUENCY=`cat monitor/medtronic_frequency.ini`

OREF0_DEBUG=${OREF0_DEBUG:-0}
Expand All @@ -28,7 +28,7 @@ fi

function mmtune_Go() {
set -o pipefail
if ( grep "WW" pump.ini ); then
if ( get_pref_string .radio_locale =~ ww ); then
Go-mmtune -ww | tee monitor/mmtune.json
else
Go-mmtune | tee monitor/mmtune.json
Expand All @@ -43,7 +43,8 @@ if ! [ -s monitor/mmtune.json ]; then
fi
#Read and zero pad best frequency from mmtune, and store/set it so Go commands can use it,
#but only if it's not the default frequency
if ! $([ -s monitor/mmtune.json ] && jq -e .usedDefault monitor/mmtune.json); then
if [ -s monitor/mmtune.json ]; then
if $(jq -e .usedDefault monitor/mmtune.json); then
freq=`jq -e .setFreq monitor/mmtune.json | tr -d "."`
while [ ${#freq} -ne 9 ];
do
Expand All @@ -57,6 +58,9 @@ if ! $([ -s monitor/mmtune.json ] && jq -e .usedDefault monitor/mmtune.json); th
grep -v setFreq monitor/mmtune.json | grep -A2 $(json -a setFreq -f monitor/mmtune.json) | while read line
do echo -n "$line "
done
fi
else
die "monitor/mmtune.json is empty or does not exist"
fi

echo
Expand Down
15 changes: 8 additions & 7 deletions bin/oref0-pump-loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source $(dirname $0)/oref0-bash-common-functions.sh || (echo "ERROR: Failed to r
# - when subcommand outputs are not needed in the main log file:
# - redirect the output to either fd >&3 or fd >&4 based on
# - when you want the output visible.
export MEDTRONIC_PUMP_ID=`grep serial pump.ini | tr -cd 0-9`
export MEDTRONIC_PUMP_ID=`get_pref_string .pump_serial | tr -cd 0-9`
export MEDTRONIC_FREQUENCY=`cat monitor/medtronic_frequency.ini`
OREF0_DEBUG=${OREF0_DEBUG:-0}
if [[ "$OREF0_DEBUG" -ge 1 ]] ; then
Expand Down Expand Up @@ -454,8 +454,8 @@ function prep {
upto30s=$(head -1 /tmp/wait_for_silence)
upto45s=$(head -1 /tmp/wait_for_silence)
fi
# read tty port from pump.ini
eval $(grep port pump.ini | sed "s/ //g")
# read tty port from preferences
eval $(get_pref_string .ttyport | sed "s/ //g")
# if that fails, try the Explorer board default port
if [ -z $port ]; then
port=/dev/spidev5.1
Expand Down Expand Up @@ -496,10 +496,11 @@ function preflight {

# reset radio, init world wide pump (if applicable), mmtune, and wait_for_silence 60 if no signal
function mmtune {
if grep "carelink" pump.ini 2>&1 >/dev/null; then
echo "using carelink; skipping mmtune"
return
fi
#carelink is deprecated in 0.7.0
#if grep "carelink" pump.ini 2>&1 >/dev/null; then
#echo "using carelink; skipping mmtune"
# return
#fi

echo -n "Listening for $upto45s s silence before mmtuning: "
wait_for_silence $upto45s
Expand Down
103 changes: 29 additions & 74 deletions bin/oref0-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ source $(dirname $0)/oref0-bash-common-functions.sh || (echo "ERROR: Failed to r

# TODO: deprecate g4-upload and g4-local-only
usage "$@" <<EOT
Usage: $self <--dir=directory> <--serial=pump_serial_#> [--tty=/dev/ttySOMETHING] [--max_iob=0] [--ns-host=https://mynightscout.herokuapp.com] [--api-secret=[myplaintextapisecret|token=subjectname-plaintexthashsecret] [--cgm=(G4-upload|G4-local-only|G4-go|G5|MDT|xdrip|xdrip-js)] [--bleserial=SM123456] [--blemac=FE:DC:BA:98:76:54] [--dexcom_tx_sn=12A34B] [--btmac=AB:CD:EF:01:23:45] [--enable='autotune'] [--radio_locale=(WW|US)] [--ww_ti_usb_reset=(yes|no)]
Usage: $self <--dir=directory> <--serial=pump_serial_#> [--tty=/dev/ttySOMETHING] [--max_iob=0] [--ns-host=https://mynightscout.herokuapp.com] [--api-secret=[myplaintextapisecret|token=subjectname-plaintexthashsecret] [--cgm=(G4-upload|G4-local-only|G4-go|G5|MDT|xdrip|xdrip-js)] [--bleserial=SM123456] [--blemac=FE:DC:BA:98:76:54] [--dexcom_tx_sn=12A34B] [--btmac=AB:CD:EF:01:23:45] [--enable='autotune'] [--radio_locale=(WW|US)]
EOT

# defaults
Expand Down Expand Up @@ -104,9 +104,6 @@ case $i in
-p=*|--btpeb=*)
BT_PEB="${i#*=}"
;;
--ww_ti_usb_reset=*) # use reset if pump device disappears with TI USB and WW-pump
ww_ti_usb_reset="${i#*=}"
;;
-pt=*|--pushover_token=*)
PUSHOVER_TOKEN="${i#*=}"
;;
Expand Down Expand Up @@ -284,7 +281,11 @@ function copy_go_binaries () {

function move_mmtune () {
request_stop_local_binary Go-mmtune
mv /usr/local/bin/mmtune /usr/local/bin/Go-mmtune || echo "Couldn't move mmtune to Go-mmtune"
if [ -f /usr/local/bin/mmtune ]; then
mv /usr/local/bin/mmtune /usr/local/bin/Go-mmtune || die "Couldn't move mmtune to Go-mmtune"
else
die "Couldn't move_mmtune() because /usr/local/bin/mmtune exists"
fi
}


Expand Down Expand Up @@ -376,7 +377,7 @@ if [[ -z "$DIR" || -z "$serial" ]]; then
fi
read -p "Would you like to [D]ownload released precompiled Go pump communication library or install an [U]nofficial (possibly untested) version.[D]/U " -r
if [[ $REPLY =~ ^[Uu]$ ]]; then
read -p "You could either build the Medtronic library from [S]ource, or type the version tag you would like to use, example 'v2018.08.08' [S]/<version> " -r
read -p "You could either build the Medtronic library from [S]ource, or type the version tag you would like to use, example 'v2019.01.21' [S]/<version> " -r
if [[ $REPLY =~ ^[Ss]$ ]]; then
buildgofromsource=true
echo "Building Go pump binaries from source"
Expand All @@ -395,7 +396,7 @@ if [[ -z "$DIR" || -z "$serial" ]]; then
ecc1medtronicversion="tags/$REPLY"
echo "Will use https://github.com/ecc1/medtronic/releases/$REPLY."

read -p "Also enter the ecc1/dexcom version, example 'v2018.07.26' <version> " -r
read -p "Also enter the ecc1/dexcom version, example 'v2018.12.05' <version> " -r
ecc1dexcomversion="tags/$REPLY"
echo "Will use https://github.com/ecc1/dexcom/$REPLY if Go-dexcom is needed."
fi
Expand All @@ -420,20 +421,6 @@ if [[ -z "$DIR" || -z "$serial" ]]; then
# Force uppercase, just in case the user entered ww
radio_locale=${radio_locale^^}

# check if user has a TI USB stick and a WorldWide pump and want's to reset the USB subsystem during mmtune if the TI USB fails
ww_ti_usb_reset="no" # assume you don't want it by default
if ! is_edison; then
if [[ $radio_locale =~ ^WW$ ]]; then
echo "If you have a TI USB stick and a WW pump and a Raspberry PI, you might want to reset the USB subsystem if it can't be found during a mmtune process. If so, enter Y. Otherwise just hit enter (default no):"
echo
if prompt_yn "Do you want to reset the USB system in case the TI USB stick can't be found during a mmtune proces?" N; then
ww_ti_usb_reset="yes"
else
ww_ti_usb_reset="no"
fi
fi
fi

if [[ -z "${radio_locale}" ]]; then
radio_locale='US'
fi
Expand Down Expand Up @@ -533,12 +520,6 @@ if [[ -z "$DIR" || -z "$serial" ]]; then
echo
echo

else
if [[ $ww_ti_usb_reset =~ ^[Yy] ]]; then
ww_ti_usb_reset="yes"
else
ww_ti_usb_reset="no"
fi
fi

echo -n "Setting up oref0 in $directory for pump $serial with $CGM CGM, "
Expand Down Expand Up @@ -617,9 +598,6 @@ fi
if [[ ! -z "$radio_locale" ]]; then
echo -n " --radio_locale='$radio_locale'" | tee -a $OREF0_RUNAGAIN
fi
if [[ ${ww_ti_usb_reset,,} =~ "yes" ]]; then
echo -n " --ww_ti_usb_reset='$ww_ti_usb_reset'" | tee -a $OREF0_RUNAGAIN
fi
if [[ ! -z "$BLE_MAC" ]]; then
echo -n " --blemac='$BLE_MAC'" | tee -a $OREF0_RUNAGAIN
fi
Expand Down Expand Up @@ -741,7 +719,7 @@ if prompt_yn "" N; then
preferences_from_args+="\"min_5m_carbimpact\":$min_5m_carbimpact "
fi
function join_by { local IFS="$1"; shift; echo "$*"; }
# merge existing prefrences with preferences from arguments. (preferences from arguments take precedence)
# merge existing preferences with preferences from arguments. (preferences from arguments take precedence)
echo "{ $(join_by , ${preferences_from_args[@]}) }" > arg_prefs.json
if [[ -s preferences.json ]]; then
cat arg_prefs.json | jq --slurpfile existing_prefs preferences.json '$existing_prefs[0] + .' > updated_prefs.json && rm arg_prefs.json
Expand All @@ -758,6 +736,8 @@ if prompt_yn "" N; then
set_pref_string .enable "$ENABLE"
set_pref_string .ttyport "$ttyport"
set_pref_string .myopenaps_path "$directory"
set_pref_string .pump_serial "$serial"
set_pref_string .radio_locale "$radio_locale"
if [[ ! -z "$BT_PEB" ]]; then
set_pref_string .bt_peb "$BT_PEB"
fi
Expand Down Expand Up @@ -998,15 +978,6 @@ if prompt_yn "" N; then
fi
fi

# from 0.5.0 the subg-ww-radio-parameters script will be run from oref0_init_pump_comms.py
# this will be called when mmtune is use with a WW pump.
# See https://github.com/oskarpearson/mmeowlink/issues/51 or https://github.com/oskarpearson/mmeowlink/wiki/Non-USA-pump-settings for details
# use --ww_ti_usb_reset=yes if using a TI USB stick and a WW pump. This will reset the USB subsystem if the TI USB device is not found.
# TODO: remove this workaround once https://github.com/oskarpearson/mmeowlink/issues/60 has been fixed
if [[ ${ww_ti_usb_reset,,} =~ "yes" ]]; then
openaps alias remove mmtune
openaps alias add mmtune "! bash -c \"oref0_init_pump_comms.py --ww_ti_usb_reset=yes -v; find monitor/ -size +5c | grep -q mmtune && cp monitor/mmtune.json mmtune_old.json; echo {} > monitor/mmtune.json; echo -n \"mmtune: \" && openaps report invoke monitor/mmtune.json; grep -v setFreq monitor/mmtune.json | grep -A2 $(cat monitor/mmtune.json | jq -r .setFreq) | while read line; do echo -n \"$line \"; done\""
fi
echo Checking kernel for mraa installation
#if uname -r 2>&1 | egrep "^4.1[0-9]"; then # don't install mraa on 4.10+ kernels
# echo "Skipping mraa install for kernel 4.10+"
Expand Down Expand Up @@ -1040,39 +1011,37 @@ if prompt_yn "" N; then
#echo Installing latest openaps dev && sudo pip install --default-timeout=1000 git+https://github.com/openaps/openaps.git@dev || die "Couldn't install openaps"
#fi

# we only need spi_serial and mraa for MDT CGM, which Go doesn't support yet
# Create pump device
# We only need the openaps pump device for mdt CGM and mmeowlink users, which Go doesn't support yet
if [[ ${CGM,,} =~ "mdt" ]]; then
cd $directory || die "Can't cd $directory"
echo "Removing any existing pump device:"
( killall -g openaps; killall -g oref0-pump-loop) 2>/dev/null; openaps device remove pump 2>/dev/null
if [[ -z "$ttyport" ]]; then
openaps device add pump medtronic $serial || die "Can't add pump"
# add carelink to pump.ini
# add carelink to pump.ini. TODO: check if this workaround can be removed
grep -q radio_type pump.ini || echo "radio_type=carelink" >> pump.ini
# carelinks can't listen for silence or mmtune, so just do a preflight check instead
openaps alias add wait-for-silence 'report invoke monitor/temp_basal.json'
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.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"'
if [[ ${radio_locale,,} =~ "ww" ]]; then
if [ -d "$HOME/src/subg_rfspy/" ]; then
echo "$HOME/src/subg_rfspy/ already exists; pulling latest"
(cd $HOME/src/subg_rfspy && git fetch && git pull) || die "Couldn't pull latest subg_rfspy"
else
echo -n "Cloning subg_rfspy: "
(cd $HOME/src && git clone https://github.com/ps2/subg_rfspy) || die "Couldn't clone oref0"
fi
fi
elif [[ "$ttyport" =~ "mmeowlink" ]]; then # e.g. for TI USB
# 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"'
# TODO: check in codebase if https://github.com/ps2/subg_rfspy/tree/master/tools python scripts are still used
if [[ ${radio_locale,,} =~ "ww" ]]; then
if [ -d "$HOME/src/subg_rfspy/" ]; then
echo "$HOME/src/subg_rfspy/ already exists; pulling latest"
(cd $HOME/src/subg_rfspy && git fetch && git pull) || die "Couldn't pull latest subg_rfspy"
else
echo -n "Cloning subg_rfspy: "
(cd $HOME/src && git clone https://github.com/ps2/subg_rfspy) || die "Couldn't clone oref0"
fi

# Hack to check if radio_locale has been set in pump.ini.
# It will remove empty line at the end of pump.ini and then append radio_locale if it's not there yet
grep -q radio_locale pump.ini || echo "$(< pump.ini)" > pump.ini ; echo "radio_locale=$radio_locale" >> pump.ini
fi
else
else # in all other case create a pump.ini with serial and radio_locale. TODO: can we skip creating a pump.ini. I can't find references of it's being used
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that xdrip-js uses pump.ini, we should let them know before removing it: @efidoman @jpcunningh @thebookins

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't want to suggest to remove it now. As far as I can see I removed all the references to the pump.ini from the oref0 code base. I hope @efidoman @jpcunningh @thebookins can say if their software somehow uses pump.ini. I just checked Lookout, but can't find any reference: https://github.com/xdrip-js/Lookout/search?q=pump.ini&unscoped_q=pump.ini

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created xdrip-js/Logger#137 for that

echo '[device "pump"]' > pump.ini
echo "serial = $serial" >> pump.ini
echo "radio_locale = $radio_locale" >> pump.ini
Expand Down Expand Up @@ -1285,13 +1254,9 @@ if prompt_yn "" N; then
mkdir -p $HOME/go
source $HOME/.bash_profile


#Necessary to "bootstrap" Go commands...
if [[ ${radio_locale,,} =~ "ww" ]]; then
echo 868.4 > $directory/monitor/medtronic_frequency.ini
#Store radio_locale for later use
# It will remove empty line at the end of pump.ini and then append radio_locale if it's not there yet
grep -q radio_locale pump.ini || echo "$(< pump.ini)" > pump.ini ; echo "radio_locale=$radio_locale" >> pump.ini
else
echo 916.55 > $directory/monitor/medtronic_frequency.ini
fi
Expand Down Expand Up @@ -1347,16 +1312,6 @@ if prompt_yn "" N; then
move_mmtune
fi

#if [[ "$ttyport" =~ "spi" ]]; then
#echo Resetting spi_serial
#reset_spi_serial.py
#fi
# Commenting out the mmtune as attempt to stop the radio reboot errors that happen when re-setting up.
# echo Attempting to communicate with pump:
# ( killall -g openaps; killall -g oref0-pump-loop ) 2>/dev/null
# openaps mmtune
# echo

# clear any extraneous input before prompting
while(read -r -t 0.1); do true; done

Expand Down
Loading