From bee2e250bac23b3c9c3f29f8a14213236916ba76 Mon Sep 17 00:00:00 2001 From: PieterGit Date: Thu, 29 Dec 2016 14:02:13 +0100 Subject: [PATCH] run subg-ww-radio-parameters script on mmtune --- bin/oref0-setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 39f840a12..d09927ed0 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -442,9 +442,14 @@ 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 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 + # add subg-ww-radio-parameters script to mmtune for WW pump. See https://github.com/oskarpearson/mmeowlink/issues/51 or https://github.com/oskarpearson/mmeowlink/wiki/Non-USA-pump-settings for details + sed -i"" 's/^\(mmtune.*\); \(echo -n .*mmtune:\)/\1; echo -n subg-ww-radio-parameters:; \/usr\/local\/bin\/oref0-subg-ww-radio-parameters-timeout; \2/g' openaps.ini + fi fi # Medtronic CGM