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

0.7.1 #1317

Merged
merged 70 commits into from
Jun 19, 2022
Merged

0.7.1 #1317

merged 70 commits into from
Jun 19, 2022

Conversation

danamlewis
Copy link
Contributor

@danamlewis danamlewis commented Nov 10, 2019

0.7.1 release.

This includes:

danamlewis and others added 30 commits November 9, 2019 20:37
* Add ability to calculate glucose noise

* don not use ** operator

* log messages for iob error

* remove test debug

* log message for calculating glucose noise

* fix preference check for calc_glucose_noise

* add calculate-glucose-noise to package.json

* default calc_glucose_noise preference to false

* fix error in comments

* use max noise value of CGM or oref0 computed noise

* update log messages for glucose noise; add noise test
… used anymore. (#1319)

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>
* first round of new comments and reorg notes; remove old comments

* more comments

* remove unused aci variable

* comment as to why we don't use setTempBasal()
* new script to install mraa+ccprog on oref0 dev

* comment space

* typofix

* git pull to update ccprog if it already exists

* cd to absolute path for ccprog

* install ccprog along with mraa

* Delete bin/mraa-ccprog-install.sh in favor of oref0-mraa-install from #1302
* flat CGM data isn't really an error, just a reason to dose neutrally

* add actual delta and avgdelta values to unchanged reason

* include current BG too
* Add test for meter bg values when getting last glucose

* skip meter bg when getting last glucose
…GET-LAST

Conflicts:
	lib/determine-basal/determine-basal.js
	tests/get-last-glucose.test.js
* Add a shutdown function for pi based rigs

Added code to shutdown a pi based rig when battery level is low. I tested this code on my pi rig with explorer HAT several times using my lab bench power supply and one time with a standard 18650 cell.

* Changed shutdown from +5 to now
…alive. (#1339)

This helps to distinguish between the case that pi does not have connection to the phone,
and the case that connection to the phone exists but phone has no external IP connection.

Also in the case that both WiFi and BT tethering is enabled one can see which of them is used (the one with the lower metric).

Here is an example to the output (when both WiFi and BT are enabled.):

At Mon 23 Dec 2019 04:50:08 PM IST my local Bluetooth IP is: 192.168.44.226
At Mon 23 Dec 2019 04:50:10 PM IST ping to default gateway 192.168.44.1 (bnep0 metric = 0) passed
At Mon 23 Dec 2019 04:50:10 PM IST ping to default gateway 192.168.44.1 (bnep0 metric = 214) passed
At Mon 23 Dec 2019 04:50:11 PM IST ping to default gateway 192.168.3.1 (wlan0 metric = 302) passed
At Mon 23 Dec 2019 04:50:11 PM IST my public IP is: 37.26.149.235

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>
* there is no inputs.retrospective, so always default to 24h before last glucose

* move variables up from rT.reason to rT

* simple oref0-simulator

* apply deviations to glucose.json if suggested.json invalid

* write to log.json; only keep/process ~400 glucose and pumphistory records

* only add UAM to ISF if ISFLength < 10

* print 5m non-average deviation and BG

* chmod +x

* make functions

* unchanging BG of 39 is legit (LOW)

* add support for carb entries

* Get profile from NS in format OpenAPS understands

Still WIP

* Deal with `sens` not having `timeAsSeconds`

* Remove debug print

* Deal with carbration not having timeAsSeconds

* More defence against lack of timeAsSeconds

* Refactor to add normalize_entry function

For now it just makes certain timeAsSeconds is present.
Move all such normalization to use this function.

* Move more common operations to normalize_entry

* Reformat by Black, no code changes

* Add timezone information to generated profile

* Add autosens limits to generated profile

Without it strange things can happen, like autotune trying to change ISF
from 56 to 700

* Deal better with Profile Switch not having valid profile

* Provide hint on how to specify profile name

* Add ability to write profile files directly

* Deal with profile files not existing yet

* Don't use very new python features

* Deal with entries not having 'time' field

* Normalize all timed entries

* Try to support AAPS with local profile

* whitespace

* define delta before use

* update determine-basal arguments

* advance clock when suggested.json is invalid

* don't advance clock twice

* use consistent timezone format

* calculate glucose stats

* rm *.json on init; default dev, noise, and carbs to zero

* default noise to 10 to make something interesting happen

* add oref0-simulator and oref0-backtest

* copy all examples recursively

* pumpprofile.json for running autotune

* wrapper script for backtesting with oref0-simulator

* another TODO

* TODO

* download preferences.json from Nightscout devicestatus.json endpoint

* comment out Texttable dependency stuff for now and output valid json to stdout

* download profile.json from Nightscout profile.json endpoint

* support real entries not on 5m boundaries

* download historical glucose data from Nightscout entries.json for the day prior

* default bolusIncrement to 0.1 is profile.bolus_increment isn't defined (for simulator)

* only use simulated results for interim stats

* download actual glucose data & compare stats; fix sens/profile

* print stats for actuals while running

* more compact stats

* output cleanup

* allow oref0-simulator to run retrospective autosens

* download ns-treatments.json for initial autosens

* comment out more Texttable() dependencies

* use python-2.7 compatible IOError instead of FileNotFoundError

* keep and use all-glucose.json values for easy stats

* ignore CGM error readings

* pass device for fakecgm simulator detection

* bypass CGM data is unchanged (tooflat) detection when in simulator mode

* don't run stats twice at end

* support specifying DIR, and default to datestamped /tmp/oref0-simulator dir

* TODO

* read a --preferences override file for testing different preferences

* remove debugging

* log backtest and autotune commands

* tee -a to append

* basic file mode support

* use mydate for OSX compatibiilty

* use mydate for OSX compatibiilty

* use reduce to merge, for jq 1.5 compatibility

* escape % for OSX printf compatibility

* escape % for OSX printf compatibility

* preferences isn't nested, so a simple add will suffice

* support autosens-override.json

* support --autosens-override

* support --profile and --preferences in autotunelog file mode

Co-authored-by: viq <vicviq@gmail.com>
* Add public ip information to status file

I want to show the public ip in my system menu on the disply and don't want to do an extra ping :)
This code is tested on my pi rig with explorer-HAT (for around two weeks).

* update hasPublicIp to publicIP

This file now contains the actual IP, so updating its name to better reflect that.

Co-authored-by: Scott Leibrand <scottleibrand@gmail.com>
* find and delete the oldest log file every minute to avoid full diskdelete the oldest log file

* start deleting at 10MB free
scottleibrand and others added 11 commits March 17, 2020 14:58
* Upload NS status when possible.

Before this checkin, ns-loop created the status data, and uploaded it to nightscout (if possible).
But in case of failure, the file will get overwritten.
This means that in the case of no internet, OAPS decisions get lost.
This checkin fixes it by adding timestamps to the files.
When internet is available, the files will be uploaded according to the correct order.
Files older than a day will be deleted.

Testing:
I have prevented uploading of files for a few hours, and when it was enabled again, data was shown correctly in nightscout site.
Decreased timeout, and saw the files being deleted.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* In the case that a status file does not contain iob delete it instead of uploading it.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Add code to run js code on a shared server.

This saves initilaztion time.

Worked for a day, which means testing only started.

* Fix a typo.

* Code to start shared node.

* Add code that verifies that shared node is answering to requests and
starting it if needed.

* Add code to store program input in order to test it.

* fix dashes to be underscores

* Add json file to shared code.

* Add code to capture data of json commands.

* New json funciontality, and changes from tests.

* Trival changes to white spaces handeling.

* Minor refactoring to the code.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* install socat on all platforms for shared-node

* remove non-json debug output breaking json parsing

* Merge branch 'tzachi-share-node-ns-status' of https://github.com/tzachi-dar/oref0 into tzachi-dar-tzachi-share-node-ns-status

Conflicts:
	bin/oref0-ns-loop.sh

* install socat on all platforms for shared-node

* remove non-json debug output breaking json parsing

* Remove temp files from the shared node.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Stop copying data to test_data.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Ad an update script and call it every 15 minutes.

Co-authored-by: Tzachi Dar <tzachi.dar@gmail.com>
* Update index.js

* Update determine-basal.js

* Added 0.2 as default and 0.3 as safety limit

* fixed code spacing

* removed %
Recently I re-ran the setup script on DEV and ran into the parsedatetime error. I narrowed it down to what I think is a typo, there is a `===` when I believe `==` is what was meant. I modified this file locally and ran with no issues.
As per @renegadeandy pull request renegadeandy#1

just tested it and it works nicely, so making PR for Dev.
Co-authored-by: Jeremy Cunningham <jpcunningh@gmail.com>
* Better error handling for Autotune without BG-data

Prevents technical error on the logging which users of Autotune(Web) see.

* Improve error message on Autotune without BG-data

Informs users on where to start investigation.
jauntySerpent added a commit to jauntySerpent/oref0 that referenced this pull request Jul 23, 2021
Fix regression error preventing token auth from working.

openaps#1341
@Foxy7
Copy link
Contributor

Foxy7 commented Aug 8, 2021

@danamlewis tested an update to Dev and worked fine, followed steps from https://openaps.readthedocs.io/en/latest/docs/Customize-Iterate/update-your-rig.html#alternative-step-1a-dev-to-get-on-dev-branch-to-test-even-more-recently-added-new-stuff.

Set up:

  • PC
  • Edison + Explorer board
root@MealsDev3:~# cd ~/src/oref0 && git checkout dev && git pull
Already on 'dev'
Your branch is up-to-date with 'origin/dev'.
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (34/34), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 37 (delta 21), reused 25 (delta 18), pack-reused 3
Unpacking objects: 100% (37/37), done.
From https://github.com/openaps/oref0
   5635387c..839a2502  dev                 -> origin/dev
   cf53e827..6ee8bd21  hypoDeviation       -> origin/hypoDeviation
 * [new branch]        min_halfBasalTarget -> origin/min_halfBasalTarget
Updating 5635387c..839a2502
Fast-forward
 bin/oref0-autotune-prep.js | 1 +
 bin/oref0-autotune.sh      | 2 +-
 bin/oref0-ns-loop.sh       | 8 +++++++-
 www/app.py                 | 2 +-
 4 files changed, 10 insertions(+), 3 deletions(-)
root@MealsDev3:~/src/oref0# npm run global-install
...

geekygirlsarah and others added 10 commits October 16, 2021 20:32
* rewind, prime and battery indicates change

* rewind, prime and battery indicates change

* "fixed" prime only

added filter for "fixed" primes only to count as site change. therefore manual primes will be ignored.
* Add config settings for low-battery shutdown thresholds

Adds a pair of config settings for low-battery shutdown thresholds.
One config setting is for Edison (denominated in millivolts), the
other is for Pi (given as percentage). This config setting is needed
for USB-powered Pi rigs, where the battery level indicator just
returns a random number, which might occasionally be zero.

* If unable to update with git pull, prompt before aborting

This is mainly for convenience during development; a checkout in
some weird branch doesn't necessarily return success when you
"git pull", but that doesn't necessarily mean you want to abort
oref0-runagain.sh.

* Fix bug that would clobber sshd_config

Depending on the initial contents of sshd_config, this would sometimes
try to add a line to it, but instead completely overwrite it to contain
only that line.

* Extend timeout on JS syntax check unit tests

On Pi Zero hardware, these tests would sometimes time out because
starting the nodejs interpreter is slow (even with a fixed nodejs
interpreter). Extend the timeout to 4s, from the default of 2s, so they
pass.

* Clean up require() usage in IOB unit test, making it pass without timeout on Pi Zero

* Add bash-unit-test-temp to gitignore

* Check for bad (super slow) RPi nodejs versions, install nvm version if found

* Tweak log messages about battery level
getting multiplication less or equal to 0 means that we have a really low target with a really low halfBasalTarget
with low TT and lowTTlowersSensitivity we need autosens_max as a value
we use multiplication instead of the division to avoid "division by zero error"
* Add high_bg enable SMB toggle

Still need to implement UTs, but this is an initial commit to get eyes on and daytime testing.

* Add logging

Also move the enableSMB_always at the end as it originally was

* Implement enableSMB_high_bg with dev

* Update determine-basal.js

Fix profile variable name for high bg target

Co-authored-by: Steven Bell <steven11@mail.usf.edu>
…nths. (#1232)

* Add a script to delete device status entries that are older than 2 months.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Fixes to delete old device status:
1) Create a local backup of the data.
2) Add number of days to delete as a parameter.
3) Add a nightly mode (parameters are given as enviorment variables).

* Write the backedup records in one line.

* New implmentation:
Delete all entries in one command.

* Fix enviorment variable for nightly mode.
* move oref0-calculate-iob to shared node.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* move oref0-meal to shared node.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Add more files to strict mode.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* move oref0-get-profile.js to shared node.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* start using oref0-get-profile

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Fix issues that have been found when running autosens.js in strict mode.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* move oref0-get-ns-entries to shared node.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Fix creation of test data for oref0-get-profile.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Add printing to oref0-get-ns-entries and it's successors.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Add printing to oref0-meal (only very high level)

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* Fix some minor errors found in testing.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>

* comment out echo dir_name from ns-loop.log

* comment out echo dir_name in pump-loop.log

Co-authored-by: Scott Leibrand <scottleibrand@gmail.com>
@scottleibrand
Copy link
Contributor

With the latest updates to dev, you'll likely need to run ~/myopenaps/oref0-runagain.sh after doing git pull to get the rig looping again. That's the standard procedure when upgrading, but isn't always needed for more minor updates.

* comment out shared-node cp to avoid full disk

* #1417: define undefined var dev5m
* comment out shared-node cp to avoid full disk

* don't send carbsReq alerts if COB is zero due to clock data parsing error

* run pushover in pump-loop

* run pushover in pump-loop

* check pushover_snooze immediately before sending a pushover

* pathfix

* run pushover in pump-loop instead of cron-every-minute

* don't background pushover for now

* uncomment debug line

* debugging

* debugging

* debugging

* -e to make jq return non-zero if no snooze found

* apparently this line never worked

* comment out debug line

* no newline

* don't print date

* remove extra logging

* fix check for empty MAKER_KEY

* only print snooze message if there's something to snooze

* don't print contents of file

* update Pushover Glances to include temp basal rate*duration

* direction arrows

* U/h

* use NS to coordinate glances snoozes between rigs

* more compact carbsreq string

* make glanceDelay configurable

* better check of whether pushoverGlances is a number

* fix glanceDelay=pushoverGlances if numeric check

* wait_for_silence  before refreshing profile and pumphistory

* fix glanceDelay=pushoverGlances if numeric check

* fix carbhistory egrep syntax

* ls profile.json.new if invalid

* Invalid profile.json.new debugging

* Invalid profile.json.new debugging

* Invalid profile.json.new debugging

* NS uses UTC now

* grep -q exits early w/ 141 in some race conditions: use grep >/dev/null instead

* remove debug lines

* Revert "NS uses UTC now"

This reverts commit e9f8810.

* convert NS UTC date into local time

* don't print

* comment out debug lines

* don't print snooze.json, just the fact we uploaded one

* check that glance api returns status: 1

* don't print snooze.json

* just print the fact we sent a carbsReq pushover

* don't print meal.json (twice)

* less verbose logging after wait_for_silence

* don't print

* check that pushover api returns status: 1

* spacing

* just print COB after refreshing meal.json

* less verbose logging

* print entirer meal.json, colorized

* remove duplicate cat of meal.json

* add delta to glance title

* print last_glance time inline

* display tick instead of delta

* tick before arrow

* remove quotes

* retry w/o new BG after failure to parse clock data

* don't use grep -q to avoid return code 141 race condition

* don't use grep -q to avoid return code 141 race condition

* don't use grep -q to avoid return code 141 race condition

* don't mkdir: directory entries eventually fill up the disk
@danamlewis
Copy link
Contributor Author

danamlewis commented Jun 14, 2022

We reflashed and reinstalled 2 Edison/Explorer Board rigs from scratch again, and confirmed they're working well. This is in addition to ongoing use of 0.7.1 as dev for months.

(Note: we added openaps/docs#1581 to the docs and we'll change that back after we release 0.7.1, addressing the git:// issues from Github in master. We will also merge openaps/docs#1571 after release).

If there are any active Pi users, please either confirm that 0.7.1 (dev) is working well for you (still) and/or if you haven't, update to 0.7.1 (current dev) and confirm.

Without any feedback or flags of issues, since this has been working well for folks for months, we'll release 0.7.1 in 2 days barring any newly reported issues.

@danamlewis danamlewis merged commit 69d7673 into master Jun 19, 2022
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.

None yet