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

Merging dev to master for 0.5.3 patch release #591

Merged
merged 36 commits into from
Sep 8, 2017
Merged

Merging dev to master for 0.5.3 patch release #591

merged 36 commits into from
Sep 8, 2017

Conversation

scottleibrand
Copy link
Contributor

@scottleibrand scottleibrand commented Aug 12, 2017

The following PRs are included in this PR. Please comment if you've explicitly tested any of the bug fixes / functionality from any of them.

  |   | Add import for Carbs&Insulin entered through Nightscout Care Portal (#547) |   |   | 207e59d
  |   | use pumphistory-merged.json for IOB calculations (#555) |   |   | bf37ac0
  |   | Add module needed for EdisonVoltage to work on jubilinux 0.2.0 (#559) |   |   | 0cbfb35
  |   | easy_install -U decocare (#548) |   |   | 83c24c4
  |   | Don't use xdrip/glucose.json when old or empty (#550) … |   |   | 34795b9
  |   | fix &current_basal_safety_multiplier typo (#560) |   |   | 397b2a7
  |   | only reset_spi_serial.py if [[ == /dev/spidev5.1 ]] (#569) |   |   | 0592d83
  |   | enable SMB/UAM (if enabled) for a full 6 hours after any carb entry (#561) |   |   | 050b542
  |   | Fix argument definition (#576) … |   |   | 8e28f25
  |   | check whether decocare-0.0.31 has been installed (#574) |   |   | cd3bf9c
  |   | Gather when suspended (#573) ) |   |   | 3629dbd
  |   | Autotune tokenauth (#578) … |   |   | 8b746e5
  |   | Fix handling of closely-timed boluses (#579) … |   |   | 010a05e
  |   | if currentDeviation is null, set mealCOB to 0 for zombie-carb safety (#589) |   |   | 514fbfb
  |   | don't SMB unless bg > threshold (#601) |   |   | 5d294fe
  |   | speed up COB calculation (#593) … |   |   | b8a31d8
  |   | Calling out the number one beginner error (#586) … |   |   | f201087
  |   | Separate out meal calcs from monitor-pump alias (#594) … |   |   | c29c32d
  |   | import openaps install scripts from docs (#598) |   |   | 7c466bf
  |   | only print minDelta < expectedDelta when it's true |   |   | 5431e2f
  |   | don't allow target_bg below 80 (#608) |   |   | 3923bb9
  |   | Fix for missing temp targets and carb treatments for timezones east of UTC (#614)  | 2b1293e
  |   | ignore bolusing status if pump is suspended (#625) |   |   | f5ed6b9
  |   | only updatePreferences with displayedDefaults (#609) |   |   | 8bf2142
  |   | remove filename extension from monitor-xdrip in crontab (#628) |   |   | d87d961
  |   | mmtune on failure if pump_loop_completed > 15m old (#631) … |   |   | 2f3277b
  |   | URL encoding for autotune filters (#636) … |   |   | 92919bd
  |   | remove variable (#647) |   |   | 575074c

scottleibrand and others added 18 commits July 16, 2017 15:21
…547)

* Update history.js

* Update history.js

* Update history.js

* Update history.js

* Update history.js

* no-op whitespace fixes

* put all fi's on their own lines

* re-add missing fi, and fix confusing whitespace

* fix if syntax to unbreak failing unit tests

* fix if syntax in lib/meal/history.js too
* make monitor-xdrip a shell script, with more debugging

* add monitor-xdrip to package.json
…herwise you'll get error: (#565)

```
The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-5748.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python2.7/dist-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.
```
Path references were from the openaps directory, rather than from the autotune directory as the helper text asks for.
It makes more sense for this variable to be the autotune directory, but the code is written now for it to be the openaps directory. If I knew how, I'd update lines 140-142 instead, but that's beyond my skills :)
* enable SMB/UAM (if enabled in preferences) for a full 6 hours after any carb entry

* refresh pumphistory when pump is suspended and we can't enact
* re apply #562 with SourceTree instead of GitHub Desktop

autotune fixes

- support for tokenbased authenitcation for autotune
- support for use of API_SECRET when Nightscout site is default denied
- skip files that are not complete for oref0-autotune-export-to-xlsx.py (instead of throwing error)
- out of the box support for other locales (set LC_NUMERIC=en_US.UTF-8 in oref0-autotune-recommends-report.sh)
- add units to oref0-autotune-recommends-report.sh
- deprecate API_SECRET_READ oref0-autotune.sh (but if API_SECRET is set to the hashed version, it will still work)
- meaningful errors if essential files do not exists (e.g. settings/pumpprofile.json)

* commit bin/oref0-autotune.sh changes

* Add import for Carbs&Insulin entered through Nightscout Care Portal (#547)

* Update history.js

* Update history.js

* Update history.js

* Update history.js

* Update history.js

* no-op whitespace fixes

* put all fi's on their own lines

* re-add missing fi, and fix confusing whitespace

* fix if syntax to unbreak failing unit tests

* fix if syntax in lib/meal/history.js too

* Add module needed for EdisonVoltage to work on jubilinux 0.2.0 (#559)

* easy_install -U decocare (#548)

* Don't use xdrip/glucose.json when old or empty (#550)

* make monitor-xdrip a shell script, with more debugging

* add monitor-xdrip to package.json

* use sudo to install it. this is required for installing it on rpi. Otherwise you'll get error: (#565)

```
The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-5748.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python2.7/dist-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.
```
* Combine closely-timed boluses properly

* Typo
@scottleibrand scottleibrand added this to the 0.5.3 milestone Aug 12, 2017
scottleibrand and others added 6 commits August 13, 2017 19:46
* speed up COB calculation

* Speed up COB calculation by only converting pumphistory to treatments once (#603)

* get treatments from pumphistory once, not every time we get_iob()

* get treatments from pumphistory once, not every time we get_iob()
* Calling out the number one beginner error

Number one error for beginners that blocks looping is when people don't have the pump set to absolute u/hr (in % basal type instead), which prevents the rig from being able to set temp basals.

* remove ' that is confusing vim; indentation

* fix percent grep

* check for percent mode after failure to make it more obvious

Conflicts:
	bin/oref0-pump-loop.sh
* refresh meal.json after merge_pumphistory

* newline
@dramageek
Copy link
Contributor

dramageek commented Aug 14, 2017

#576 and #577 were either/or patches, so we don't want both of them.

#576 changes the -h helper text to match what's needed in the current code.
#577 changes the code to match the current helper text.

@scottleibrand
Copy link
Contributor Author

Ok, which should I revert?

@dramageek
Copy link
Contributor

Revert #577 from the release

@efidoman
Copy link
Contributor

efidoman commented Aug 25, 2017

Did the number of preferences get cleaned up with this release? after npm global and runagain, this is my preferences file: { "max_iob": 9, "max_daily_safety_multiplier": 3, "current_basal_safety_multiplier": 4, "autosens_max": 1.2, "autosens_min": 0.7, "rewind_resets_autosens": true, "adv_target_adjustments": true, "unsuspend_if_no_temp": false, "enableSMB_with_bolus": false, "enableSMB_with_COB": false, "enableSMB_with_temptarget": false, "enableUAM": false }
I see via change #609 - this is on purpose

@scottleibrand
Copy link
Contributor Author

Yep. You can re-add anything you want to change from the defaults, but those are the only ones most people will need to change. Feedback welcome.

@efidoman
Copy link
Contributor

efidoman commented Aug 25, 2017

I'm OK with limiting the preferences seen by default as I agree that showing them all can be overwhelming for a new user. It would be nice to have an enhancement to the runagain install to allow it to optionally save our existing parameter/values.

@efidoman
Copy link
Contributor

efidoman commented Aug 26, 2017

working great so far for a full 24 hours. I like this new logic for SMB ...

// min_bg of 90 -> threshold of 65, 100 -> 70 110 -> 75, and 130 -> 85 var
threshold = min_bg - 0.5*(min_bg-40);
...
if (microBolusAllowed && enableSMB && profile.current_basal >= 0.3 && bg > threshold)

@RedCyclist1
Copy link

Install worked as expected with g5, edison/eb, 723 in AZ.

@philipgo
Copy link
Contributor

Works fine with G5/Edison+EB and 722, thank you ;)
Explicitly tested #547 , #559 , #579 (great!)
#614 never seemed to be a problem at GMT +2

@PieterGit
Copy link
Contributor

PieterGit commented Aug 27, 2017

Installing 0.5.3-dev on a fresh rig (G4/Edison+EB/754WW). Will report findings later.

Did a interactive run of oref-setup. This sentence confused me:

Do you want to be able to setup BT tethering later? y/[N]
Ok, no BT installation at this time, you can run this script again later if you change your mind.

I thought the later referred to not in this run. I answered No, because I wanted it to setup now.
But then it skipped the BT installation. Any objections to drop the later and change it to
Do you want to be able to setup BT tethering? y/[N]

@scottleibrand
Copy link
Contributor Author

Sounds like a good clarification. Feel free to PR it.

@PieterGit
Copy link
Contributor

PieterGit commented Aug 28, 2017

Will PR it later.

Main findings after 24h with 0.5.3-dev. Quite some pump loop errors, that don't recover.

Starting supermicrobolus pump-loop at Mon Aug 28 12:33:02 CEST 2017 with 12 second wait_for_silence:tes for new BG: glucose.json newer than pump_loop_completed
Radio ok. Listening: .No pump comms detected from other rigs
mmeowlink.exceptions.CommsException: No acknowledgement from pump on wakeup. Is it out of range or is the battery too low?nce before mmtuning
Radio ok. Listening: .No pump comms detected from other rigs

Seem to occur after the CGM failed (e.g. lsusb -99) and seem hard to recover even if the USB OTG and CGM is back up (e.g. because of reboot). One time reinserting the pump battery caused loop to start again. I believe pump communication should be minimized if cgm-data is stale, but I think that's a 0.6.x feature. Workaround that workend once: stop cronjobs and do a manual mmtune.

Maybe it's WW pump related. @ceben80 : can/have you tested this 0.5.3-rc yet?

@efidoman
Copy link
Contributor

Still working great for me after 4 days. No new issues - It may be coincidence, but the SMB functionality seems to react better for me in the last 4 days. It could have been something that changed in preferences.json thought. My testing has been system-level and I have only really explicitly tested the preferences.json change.

@dramageek
Copy link
Contributor

Working fine for me since the 25th. Jubilinux 0.1.1, explorer board, xdrip+. Eastern time zone.

@deddynh
Copy link

deddynh commented Aug 29, 2017

I have 5.3 working without issue now for 2 days on 1 explorer board rig with edison and another with Edison and TI stick. Will try and test some of the individual items. Also Eastern time zone.

@deddynh
Copy link

deddynh commented Aug 29, 2017

So I manually bolused using easy buttons on MM 722 for lunch. Shows in OpenAPS pill and loop.log but not on NS.
screenshot 2017-08-29 15 32 09
screenshot 2017-08-29 15 32 39

@jsmurray1
Copy link
Contributor

jsmurray1 commented Aug 30, 2017

My Pi3 rigs seem to get stuck if they can't get radio comms, even after a successful mmtune, they seem to hang. Seems like a reboot fixes them, I'll try and grab some logs when I get a chance. My edison rig seems to be working well though using the 1.3 Explorer and I believe it's runnning Jubilinux 0.2.0 (uname -a is.... Linux ed-rogue-1 3.10.17-poky-edison+ #6 SMP PREEMPT Wed Mar 23 21:47:59 EDT 2016 i686 GNU/Linux).

@thebookins
Copy link
Contributor

Just a note that #550 isn't working for us. #628 fixes it with a small change to the setup script.

@PieterGit
Copy link
Contributor

I think I found the root cause of why the maybe_mmtune didn't mmtune!
https://github.com/openaps/oref0/blame/dev/bin/oref0-pump-loop.sh#L352
Replace RANDOM to $RANDOM, so
[[ $(( ( $RANDOM % 100 ) )) > 75 ]] \

That will mmtune in 25% of the cases.

@ecc1
Copy link

ecc1 commented Sep 1, 2017

That shouldn't make any difference. RANDOM is treated as $RANDOM because it's inside $(( ... ))

@scottleibrand
Copy link
Contributor Author

@PieterGit @ecc1 Do you have any evidence that maybe_mmtune is actually broken? Because when I run the contents of that function from the command line, it works exactly as expected:

pi@pi2-erf ~/myopenaps $ for i in $(seq 1 1000); do [[ $(( ( RANDOM % 100 ) )) > 70 ]]     && echo "mmtuning"; done | grep -c mmtuning
305
pi@pi2-erf ~/myopenaps $ for i in $(seq 1 1000); do [[ $(( ( RANDOM % 100 ) )) > 70 ]]     && echo "mmtuning"; done | grep -c mmtuning
297
pi@pi2-erf ~/myopenaps $ for i in $(seq 1 1000); do [[ $(( ( RANDOM % 100 ) )) > 70 ]]     && echo "mmtuning"; done | grep -c mmtuning
298
pi@pi2-erf ~/myopenaps $ for i in $(seq 1 1000); do [[ $(( ( RANDOM % 100 ) )) > 70 ]]     && echo "mmtuning"; done | grep -c mmtuning
309

@jbwittmer
Copy link

jbwittmer commented Sep 3, 2017

Running so far on a Raspi3 updated from considerably older version of dev. Installed using oref0-runagain.sh
I don't use autotune in my loop, but have had to run in the past in order to enable smb when installing on other rigs. For whatever reason my prior autotune was preserved on this reinstall but when trying to run autotune manually I'm getting an error:

ERROR: API_SECRET is not set when calling oref0-autotune.sh

I'll watch the loop next couple of days and see how it works. Only run this rig at night.

@scottleibrand
Copy link
Contributor Author

Looks like your permissions on ~/src/oref0 subdirectories are messed up from a previous sudo run of something that didn't need it. I would remove the directory entirely and re-clone it.

@jbwittmer
Copy link

Update working fine on Raspi3 rig. Don't know what generated the autotune error I referenced above - re-ran it today and worked fine. I'll install on an Edison rig next

@scottleibrand scottleibrand changed the title Prep for merging dev to master for eventual 0.5.3 patch release Merging dev to master for 0.5.3 patch release Sep 4, 2017
scottleibrand and others added 3 commits September 4, 2017 17:48
* always mmtune on falure if mmtune.json is more than 15m old

* don't necessarily mmtune if pump_loop_completed within 15m

* pump_loop_completed is less than 5 bytes

* syntax

* always wait_for_silence and mmtune if pump_loop_completed > 15m old
* remove -g as it breaks autotune's time filters

* Revert "remove -g as it breaks autotune's time filters"

This reverts commit b60f341.

* encode autotune URLs' [] as %5B and %5D
@scottleibrand
Copy link
Contributor Author

We're planning to merge this and release 0.5.3 today if no objections.

* 2 additional profile shortcuts

add edison battery level and cartridge insulin level to profile shortcuts. I find them both useful and imagine others might as well.

* changed proposed "insulinremaining" alias to "reservoir"

...to match the .json file name.  Makes sense to me.
@scottleibrand scottleibrand merged commit b7509d0 into master Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.