openaps device show foo --json
and then copy-paste that into the appropriate place in lib/oref0-setup/device.json (or similar for reports) and replace whatever one is already there that you changed
git push
will it create a PR on that branch?
pumphistory.json
vs. a pumphistory-zoned.json
.
monitor/pumphistory.json
, you want a command something like openaps use pump iter_pump_hours 5.0
openaps report add monitor/pumphistory.json JSON pump iter_pump_hours 5.0
openaps report add monitor/pumphistory-zoned.json tz rezone --date timestamp --date dateString --date start_at --date end_at --date created_at monitor/pumphistory.json
openaps report show recent-missing-entries.json --cli
show? (Or maybe you need a directory name in front of the report name if it's in, e.g., a nightscout
subdirectory. )
monitor/glucose-zoned.json
(if you don't already have one) and then pass that instead?
monitor/glucose.json
look like?
head -12 monitor/glucose.json
"trend_arrow": "FLAT",
"system_time": "2016-09-26T03:43:26",
"direction": "Flat",
"sgv": 81,
"display_time": "2016-09-25T19:53:30",
"date": 1474847610000.0,
"dateString": "2016-09-25T19:53:30",
"unfiltered": 88272,
"filtered": 84304,
"device": "openaps://cgm",
[
{
"direction": "Flat",
"trend": 4,
"dateString": "2016-09-25T20:39:24-04:00",
"sgv": 94,
"date": 1474850364000,
"device": "share2",
"_id": "57e86e3f50351f9051513d19",
"type": "sgv",
"glucose": 94
},
-04:00
at the end of the dateString is the timezone.
pkg_resources.ContextualVersionConflict: (six 1.8.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.9'), set(['mock']))
Could not run nightscout autoconfigure-device-crud
glucose
should be rezone
, i.e. use tz rezone
not use tz glucose
openaps report add
to recreate, or if you're comfortable editing a text file, just edit openaps.ini
six
package.
pip install --upgrade six
?
Morning, I am having issues with the setup script on a standard PI with Carelink.
monitor/glucose.json didn't get created
Question - where can I find the actual scripts that create the reports so I can manually setup and ensure it gets done correctly?
I have been digging around in the /src folder but can't easily see it.
lib/oref0-setup
directory
@scottleibrand Got some bugs when using the setup script on a Pi3 with Carelink.
Having issues with glucose files, starting with monitor/glucose.json, raw-cgm/raw-entries.json not being created
pi@raspberrypi:~/openaps $ openaps get-bg
cgm://JSON/oref0_glucose/raw-cgm/raw-entries.json
grep: cgm/cgm-glucose.json: No such file or directory
rsync: link_stat "/home/pi/openaps/cgm/glucose.json" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]
pi@raspberrypi:~/openaps $
@davidkeddydb I had not done anything manually, just the script. When I review openaps.ini I can see that both seem to be setup properly. I can also confirm it is communicating with pump properly.
When I ran script on my Edison last week, devices setup properly
@sjolundjohn do you have a cgm.ini file? And you already did these from set up: oref0 template mint device oref0 | openaps import
Create medtronic and oref0 reports, this handles timezones, units conversion, as well as detecting freshness of files.
oref0 template mint reports medtronic-pump | openaps import
oref0 template mint reports oref0-inputs | openaps import
@davidkeddydb Many thanks for the offer to help!!! I am less concerned about getting it working and more concerned with finding the setup issues for @scottleibrand and @danamlewis since they wanted testers for the setup script.
I have a loop working on the same machine, different folder.
Many thanks for the offer - I think I am going to leave it hanging for now. The idea being that with that script things should be setup automatically and work.
I had this magical experience on the Edison where I ran the script and it worked almost right away. So, I believe there are bugs in the current script for the Pi/Nightscount setup which I hope to help iron out.
@davidkeddydb The Edison has onboard memory. 4gb + 1gb ram if memory serves correctly.
When I setup you did need a memory stick on the PI to flash, but I think that may have been sovled now
cgm://JSON/iter_glucose_hours/monitor/cgm-glucose.json
that was brought in through the script.
The question "What kind of cgm are you using, G4, G5, MDT) didn't come up last week.
I choose G4 which is what I have, though everything going to NS
openaps report invoke cgm/ns-glucose.json
pi@raspberrypi:~/openaps $ ls
cgm detect-sensitivity.ini enact iob.ini monitor ns.ini oref0.ini preferences.json pump-session.json settings units.ini
cgm.ini determine-basal.ini get-profile.ini meal.ini ns-glucose.ini openaps.ini pebble.ini pump.ini raw-cgm tz.ini upload
pi@raspberrypi:~/openaps $ openaps report invoke cgm/ns-glucose.json
ns://JSON/shell/cgm/ns-glucose.json
No JSON object could be decoded
Unknown request: oref0_glucose_since
openaps use ns shell get entries.json 'count=10'
openaps use ns shell upload treatments.json recently/combined-treatments.json
-h This message.
get type args Get records of type from
Nightscout matching args.
oref0_glucose [tz] [args] Get records matching oref0
requirements according to args
from Nightscout.
tz should be the name of the
timezones device (default with
no args is tz).
args are ampersand separated
arguments to append to the
search query for Nightscout.
oref0_glucose_without_zone [args] Like oref0_glucose but without
rezoning.
upload endpoint file Upload a file to the Nightscout endpoint.
latest-treatment-time - get latest treatment time from Nightscout
format-recent-history-treatments history model - Formats medtronic pump
history and model into
Nightscout compatible
treatments.
format-recent-type ZONE type file - Selects elements from the
file where the elements would
satisfy a gap in the last 1000
Nightscout records.
upload-non-empty-treatments file - Upload a non empty treatments
file to Nightscout.
lsgaps tz entries - Re-use openaps timezone device
to find gaps in a type (entries)
by default.
upload-non-empty-type type file
status - ns-status
get-status - status - get NS status
preflight - NS preflight
## Nightscout Endpoints
* entries.json - Glucose values, mbgs, sensor data.
* treatments.json - Pump history, bolus, treatments, temp basals.
* devicestatus.json - Battery levels, reservoir.
* profile.json - Planned rates/settings/ratios/sensitivities.
* status.json - Server status.
## Examples
### Get records from Nightscout
Use the get feature which takes two arguments: the name of the endpoint
(entries, devicestatus, treatments, profiles) and any query arguments to append
to the argument string. 'count=10' is a reasonable debugging value.
The query-params can be used to generate any query Nightscout can respond to.
openaps use ns shell get $endpoint $query-params
### Unifying pump treatments in Nightscout
To upload treatments data to Nightscout, prepare you zoned glucose, and pump
model reports, and use the following two reports:
openaps report add nightscout/recent-treatments.json JSON ns shell format-recent-history-treatments monitor/p
Was this a Pi already set up from before?
-- YES, running
npm run global-install
from the oref0 dir. We should add a check for this though.
pi@raspberrypi:~/openaps $ npm run global-install
npm ERR! Error: ENOENT, open '/home/pi/openaps/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 4.1.19-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "global-install"
npm ERR! cwd /home/pi/openaps
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/openaps/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/openaps/npm-debug.log
npm ERR! not ok code 0
pi@raspberrypi:~/src/oref0 $ npm run global-install
> oref0@0.2.0 global-install /home/pi/src/oref0
> npm install && sudo npm install -g && sudo npm link && sudo npm link oref0
npm WARN deprecated lodash.assign@4.2.0: This package is deprecated. Use Object.assign.
npm WARN engine form-data@2.0.0: wanted: {"node":">= 0.12"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hawk@3.1.3: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine escodegen@1.8.1: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine boom@2.10.1: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN engine boom@2.10.1: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
@scottleibrand Things happening, was able to pull cgm/ns-glucose.json
However still having issues with other glucose reports. I think this is likely due to setup process not working
pi@raspberrypi:~ $ cd openaps
pi@raspberrypi:~/openaps $ openaps pump-loop
Starting pump-loop at Mon 26 Sep 17:38:36 CEST 2016:
pump://JSON/read_temp_basal/monitor/temp_basal.json
reporting monitor/temp_basal.json
Old pumphistory: Refreshed pumphistory
rm: cannot remove ‘enact/suggested.json’: No such file or directory
determine-basal://text/shell/enact/suggested.json
Could not parse input data: { [Error: Cannot find module '/home/pi/openaps/monitor/glucose.json'] code: 'MODULE_NOT_FOUND' }
reporting enact/suggested.json
Old pumphistory-24h refreshed
Old settings refreshed
temp_basal.json less than 5m old
Pumphistory less than 5m old
Settings less than 10m old
Pumphistory-24 less than 20m old
Completed pump-loop at Mon 26 Sep 17:39:32 CEST 2016
You have new mail in /var/mail/pi
pi@raspberrypi:~/openaps $ openaps pump-loop
Starting pump-loop at Mon 26 Sep 17:39:38 CEST 2016:
pump://JSON/read_temp_basal/monitor/temp_basal.json
reporting monitor/temp_basal.json
Profile less than 60m old
temp_basal.json less than 5m old
Pumphistory less than 5m old
Settings less than 10m old
Pumphistory-24 less than 20m old
Completed pump-loop at Mon 26 Sep 17:39:45 CEST 2016
And then next step when trying to get BG:
pi@raspberrypi:~/openaps $ openaps get-bg
cgm://JSON/oref0_glucose/raw-cgm/raw-entries.json
grep: cgm/cgm-glucose.json: No such file or directory
rsync: link_stat "/home/pi/openaps/cgm/glucose.json" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]
OK Off I go
(crontab -l; crontab -l | grep -v '#' | grep -q ...
so it doesn't take in account commented out entries from a loop that you are wanting to keep around for historical purposes
(crontab -l; crontab -l | grep -Ev '^#' | grep -q
@scottleibrand will give it another go tomorrow. I had to rush home and left the pi at my office.
The switch to the Edison which I have at home now has been fantastic.
Next step a) New development boards which I am hoping get approved b) offline NS by putting NS and Mongo on the Edison.
After that I think I am going to be sorted.
I am amazed by the Loop and how quickly you get used to it. Sleeping at night without it feels crazy
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm cache clean -f
sudo npm install npm -g
sudo n stable