These are chat archives for nightscout/intend-to-bolus

31st
Jul 2016
John Dodds
@johners97
Jul 31 2016 00:04
Ooooh what is entries? I don't have that report
I use mmol/L so I have glucoseclean.json
Ben West
@bewest
Jul 31 2016 00:25
it has to do with the way your report is defined:
openaps report show --cli nightscout/recent-missing-entries.json what does this show?
John Dodds
@johners97
Jul 31 2016 00:34
openaps use ns shell format-recent-type tz  entries monitor/glucose.json
I entered entries in manually to the report on openaps.ini
Mitchell Slep
@moomoobloo
Jul 31 2016 00:44
Anyone use Pancreabble? I'm following the setup instructions and I can pair my Pebble with the Pi but then this command fails:
$ sudo rfcomm bind hci0 55:2E:61:2D:09:7A
Can't create device: Address already in use
John Dodds
@johners97
Jul 31 2016 00:54
pi@john:~/my_openaps $ openaps report invoke nightscout/recent-missing-entries.json
ns://JSON/shell/nightscout/recent-missing-entries.json
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 196, in main
    data = sorted(data, key=get)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 178, in get
    return parse(item.get(args.date))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 552, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 671, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 188, in split
    return list(cls(s))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 184, in next
    return self.__next__()  # Python 2.x support
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 177, in __next__
    token = self.get_token()
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 93, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'NoneType' object has no attribute 'read'
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 58, in run
    reporter(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 33, in __call__
    self.blob = self.serialize(data)
  File "/usr/
I get this

  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 31, in serialize
    return self.method.serialize(render(data), self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/process.py", line 56, in prerender_json
    return json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Concluded with 'No JSON object could be decoded`
Chris Oattes
@cjo20
Jul 31 2016 00:56
@johners97 check each of the input files for that report
Generally, if you run a command and it doesn't work, it's a good idea to look through the input files to see what they contain, check the data looks sensible etc.
It'll make it easier for you to work out what is going on yourself
John Dodds
@johners97
Jul 31 2016 01:07
@cjo20 I have and can't work out what the issue is (take into consideration I have never programmed)
Chris Oattes
@cjo20
Jul 31 2016 01:08
johners97: What are the input files and what would you expect them to contain?
John Dodds
@johners97
Jul 31 2016 01:09
monitor/glucose.json entries tz I think
Mitchell Slep
@moomoobloo
Jul 31 2016 01:09
@moomoobloo answering my own question - fixed with sudo rfcomm release hci0, and then did all the steps really quickly before the address changed
Chris Oattes
@cjo20
Jul 31 2016 01:11
johners97: so the only thing there that is actually a file is monitor/glucose.json. Does that file contain what you'd expect?
John Dodds
@johners97
Jul 31 2016 01:12
I'm not sure, maybe I should use monitor/glucoseclean.json instead?
Totally lost with ns
Chris Oattes
@cjo20
Jul 31 2016 01:13
well take a look at monitr/glucose.json. Is there anything in that file?
John Dodds
@johners97
Jul 31 2016 01:14
pi@john:~/my_openaps $ cat monitor/glucose.json
[
  {
    "packet_size": 0,
    "name": "DataEnd",
    "date": "2016-07-31T02:14:00",
    "date_type": "none",
    "_tell": 1,
    "op": "0x01"
  },
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "sgv": 88,
    "date": "2016-07-31T02:09:00",
    "packet_size": 0,
    "op": 44
  },
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 3,
    "sgv": 82,
    "date": "2016-07-31T02:04:00",
    "packet_size": 0,
    "op": 41
  },
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 4,
    "sgv": 76,
    "date": "2016-07-31T01:59:00",
    "packet_size": 0,
    "op": 38
  },
  {
    "packet_size": 6,
    "name": "SensorCalFactor",
    "raw": "41-f6-1f-10-0e-52",
    "date": "2016-07-31T01:54:00",
    "factor": 3.666,
    "date_type": "minSpecific",
    "_tell": 5,
    "op": "0x0f"
  },
  {
    "body": "43",
    "packet_size": 5,
    "amount": 67,
    "name": "CalBGForGH",
    "raw": "41-e8-1f-10-43",
    "date": "2016-07-31T01:40:00",
    "date_type": "minSpecific",
    "_tell": 15,
    "op": "0x0e"
  }
Yeah
Chris Oattes
@cjo20
Jul 31 2016 01:18
So if the data in that file looks vaguely sensible, you know that the report wants glucose data, but the glucose data you're giving it isn't what it wants
John Dodds
@johners97
Jul 31 2016 01:18
Therefore what do I do
hm
Ben West
@bewest
Jul 31 2016 01:20
needs to be rezoned
ah, also
John Dodds
@johners97
Jul 31 2016 01:20
rezoned??
Ben West
@bewest
Jul 31 2016 01:20
that glucose data is coming from medtronic
John Dodds
@johners97
Jul 31 2016 01:20
yes
Ben West
@bewest
Jul 31 2016 01:20
that requires using mm-format-ns-glucose tool first, as well
John Dodds
@johners97
Jul 31 2016 01:21
How do I do that? omg :(
Ben West
@bewest
Jul 31 2016 01:21
the first report to get your glucose data should be called raw-pump/glucose.json or similar
hmm
to create the device, something like oref0 device-helper mm-glucose-format 'mm-format-ns-glucose $*' | openaps import
this will create a mm-glucose-format device
so then you can openaps use mm-glucose-format shell raw-pump/glucose.json
save that as something like raw-pump/glucose-reformatted.json
then rezone it with something like openaps use tz rezone --astimezone raw-pump/glucose-reformatted.json
save that as monitor/glucose.json
John Dodds
@johners97
Jul 31 2016 01:25
pi@john:~/my_openaps $ oref0 device-helper mm-glucose-format 'mm-format-ns-glucose $*' | openaps import
process://mm-glucose-format/bash/-c "mm-format-ns-glucose $*" --
pi@john:~/my_openaps $ openaps use mm-glucose-format shell raw-pump/glucose.json
cat: raw-pump/glucose.json: No such file or directory
No JSON object could be decoded

Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 58, in run
    reporter(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 33, in __call__
    self.blob = self.serialize(data)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 31, in serialize
    return self.method.serialize(render(data), self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/process.py", line 56, in prerender_json
    return json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
pi@john:~/my_openaps $
Ben West
@bewest
Jul 31 2016 01:26
yeah, I'm saying medtronic glucose handling is a little different, you'll need several new reports
what's your current glucose report?
openaps report show --cli monitor/glucose.json
basically that needs to be renamed to raw-pump/mm-glucose.json or simila
John Dodds
@johners97
Jul 31 2016 01:27
openaps use insulin_pump iter_glucose 5
Ben West
@bewest
Jul 31 2016 01:27
ok, so we can add it as new report:
openaps report add raw-pump/mm-glucose.json JSON insulin_pump iter_glucose 5
John Dodds
@johners97
Jul 31 2016 01:28
Ok done that
Ben West
@bewest
Jul 31 2016 01:28
ok, now invoke it to get some data
openaps report invoke raw-pump/mm-glucose.json
now you can do openaps use mm-glucose-format shell raw-pump/mm-glucose.json to reformat it for oref0/NS
oops, made a mistake
it should be
hmmm
the device:
oref0 device-helper mm-glucose-format 'mm-format-ns-glucose --oref0 $*' | openaps import
John Dodds
@johners97
Jul 31 2016 01:30
So you want me to enter oref0...etc ?
Ben West
@bewest
Jul 31 2016 01:31
the tool needs the --oref0 flag to really do the right thing
this redefines the whole tool
John Dodds
@johners97
Jul 31 2016 01:31
ok, done that
Ben West
@bewest
Jul 31 2016 01:32
ok, so openaps use mm-glucose-format shell raw-pump/mm-glucose.json should print similar json, but prepared for oref0 and nightscout
so save that as a report:
John Dodds
@johners97
Jul 31 2016 01:32
pi@john:~/my_openaps $ openaps use mm-glucose-format shell raw-pump/mm-glucose.json
[
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 1,
    "dateString": "2016-07-31T02:34:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469928840000,
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "glucose": 112,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "dateString": "2016-07-31T02:29:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469928540000,
    "sgv": 112,
    "type": "sgv",
    "op": 56
  },
  {
    "glucose": 106,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 3,
    "dateString": "2016-07-31T02:24:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469928240000,
    "sgv": 106,
    "type": "sgv",
    "op": 53
  },
  {
    "glucose": 98,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 4,
    "dateString": "2016-07-31T02:19:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469927940000,
    "sgv": 98,
    "type": "sgv",
    "op": 49
  },
  {
    "glucose": 94,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 5,
    "dateString": "2016-07-31T02:14:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469927640000,
    "sgv": 94,
    "type": "sgv",
    "op": 47
  },
  {
    "glucose": 88,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 6,
    "dateString": "2016-07-31T02:09:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469927340000,
    "sgv": 88,
    "type": "sgv",
    "op": 44
  }
Ben West
@bewest
Jul 31 2016 01:33
openaps report add raw-pump/ns-glucose.json JSON mm-glucose-format shell raw-pump/mm-glucose.json
(is that your local timezone? +0100? it's 2:34 am?
John Dodds
@johners97
Jul 31 2016 01:34
pi@john:~/my_openaps $ openaps report add raw-pump/ns-glucose.json JSON mm-glucose-format shell raw-pump/mm-glucose.json
added mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
pi@john:~/my_openaps $ openaps report invoke raw-pump/ns-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
pi@john:~/my_openaps $ cat raw-pump/ns-glucose.json
[
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 1,
    "dateString": "2016-07-31T02:34:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469928840000,
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "glucose": 112,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "dateString": "2016-07-31T02:29:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469928540000,
    "sgv": 112,
    "type": "sgv",
    "op": 56
  },
  {
    "glucose": 106,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 3,
    "dateString": "2016-07-31T02:24:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469928240000,
    "sgv": 106,
    "type": "sgv",
    "op": 53
  },
  {
    "glucose": 98,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 4,
    "dateString": "2016-07-31T02:19:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469927940000,
    "sgv": 98,
    "type": "sgv",
    "op": 49
  },
  {
    "glucose": 94,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 5,
    "dateString": "2016-07-31T02:14:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469927640000,
    "sgv": 94,
    "type": "sgv",
    "op": 47
  },
  {
    "glucose": 88,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 6,
    "dateString": "2016-07-31T02:09:00+0100",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469927340000,
    "sgv": 88,
    "type": "sgv",
    "op": 44
  }
My time zone is GMT...my raspberry pi was being funky so I manually entered date and time so I could get my time in line
What now?
Ben West
@bewest
Jul 31 2016 01:35
ok, now we redefine monitor/glucose.json to be the rezoned version of this
hmmm
it's important to get the date right
sudo dpkg-reconfigure tzdata should pop up a menu to select the zone
John Dodds
@johners97
Jul 31 2016 01:36
it never works but i will try again

pi@john:~/my_openaps $ sudo dpkg-reconfigure tzdata

Current default time zone: 'Europe/London'
Local time is now:      Sun Jul 31 02:35:28 BST 2016.
Universal Time is now:  Sun Jul 31 01:35:28 UTC 2016.
Ben West
@bewest
Jul 31 2016 01:37
is that right? 1:35 am?
John Dodds
@johners97
Jul 31 2016 01:37
Nope
Local time is right, universal isnt
see what i mean
Ben West
@bewest
Jul 31 2016 01:37
do you have ntpdate?
what happens when you run ntpdate
John Dodds
@johners97
Jul 31 2016 01:38

pi@john:~/my_openaps $ ntpdate
-bash: ntpdate: command not found
Ben West
@bewest
Jul 31 2016 01:38
sudo apt-get install ntpdate
actually that looks right to me
Chris Oattes
@cjo20
Jul 31 2016 01:38
Current default time zone: 'Europe/London'
Local time is now:      Sun Jul 31 02:38:19 BST 2016.
Universal Time is now:  Sun Jul 31 01:38:19 UTC 2016.
is correct for someone in the UK
Ben West
@bewest
Jul 31 2016 01:38
it is in fact 1:30ish AM in GMT
Chris Oattes
@cjo20
Jul 31 2016 01:39
London isn't currently in GMT, it's BST
which is GMT+1
John Dodds
@johners97
Jul 31 2016 01:39
Whhaattt i'm in Scotland, the time on my laptop, phone says 02:39
:(
Chris Oattes
@cjo20
Jul 31 2016 01:39
Yes, so "Local time is now: 02:39" is what you'd expect. UTC = GMT = Winter time
John Dodds
@johners97
Jul 31 2016 01:40
So it's right...?
Chris Oattes
@cjo20
Jul 31 2016 01:40
When the clocks go forward in march, we aren't on GMT any longer, we're on BST
Ben West
@bewest
Jul 31 2016 01:40
hmm that's odd
TZ="Europe/London" date
Sun Jul 31 02:40:27 BST 2016
John Dodds
@johners97
Jul 31 2016 01:41
So confused here
Ben West
@bewest
Jul 31 2016 01:41
selecting Europe/London in the config I would expect would do the right thing
Chris Oattes
@cjo20
Jul 31 2016 01:41
@bewest yes, that's correct
John Dodds
@johners97
Jul 31 2016 01:42

pi@john:~/my_openaps $ TZ="Europe/London" date
Sun 31 Jul 02:40:59 BST 2016
Chris Oattes
@cjo20
Jul 31 2016 01:42
BST is UTC+1
John Dodds
@johners97
Jul 31 2016 01:42
ok then...what now
Feel like i'm going through a storm
Ben West
@bewest
Jul 31 2016 01:42
try just date
John Dodds
@johners97
Jul 31 2016 01:43
pi@john:~/my_openaps $ date
Sun 31 Jul 02:41:53 BST 2016
Ben West
@bewest
Jul 31 2016 01:43
oh, so yours is setup correct it looks ike
John Dodds
@johners97
Jul 31 2016 01:43
This is weird
Ben West
@bewest
Jul 31 2016 01:43
perfect
John Dodds
@johners97
Jul 31 2016 01:43
Yes perfect
Ben West
@bewest
Jul 31 2016 01:43
so now we do one more rezone for fun
Chris Oattes
@cjo20
Jul 31 2016 01:43
@johners97 What are you confused by?
John Dodds
@johners97
Jul 31 2016 01:44
ok this sounds fun
Ben West
@bewest
Jul 31 2016 01:45
openaps report add monitor/glucose.json JSON tz rezone --astimezone --date dateString raw-pump/ns-glucose.json
John Dodds
@johners97
Jul 31 2016 01:45
pi@john:~/my_openaps $ openaps report add monitor/glucose.json JSON tz rezone --astimezone --date dateString raw-pump/ns-glucose.json
added tz://JSON/rezone/monitor/glucose.json
Ben West
@bewest
Jul 31 2016 01:45
ok, now we should be able to use this to upload to nightscout or run oref0
John Dodds
@johners97
Jul 31 2016 01:46
ok,
Ben West
@bewest
Jul 31 2016 01:46
openaps report invoke monitor/glucose.json nightscout/recent-missing-entries.json
John Dodds
@johners97
Jul 31 2016 01:47

pi@john:~/my_openaps $ openaps report invoke monitor/glucose.json nightscout/recent-missing-entries.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
ns://JSON/shell/nightscout/recent-missing-entries.json
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 196, in main
    data = sorted(data, key=get)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 178, in get
    return parse(item.get(args.date))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 552, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 671, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 188, in split
    return list(cls(s))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 184, in next
    return self.__next__()  # Python 2.x support
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 177, in __next__
    token = self.get_token()
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 93, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'NoneType' object has no attribute 'read'
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 58, in run
    reporter(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/rep
God...
Ben West
@bewest
Jul 31 2016 01:47
hmm
openaps use ns shell preflight
does this print true?
John Dodds
@johners97
Jul 31 2016 01:48
indeed it does
Ben West
@bewest
Jul 31 2016 01:48
hmm
and what about openaps use ns shell get entries.json count=2?
John Dodds
@johners97
Jul 31 2016 01:49
pi@john:~/my_openaps $ openaps use ns shell get entries.json count=2
[
  {
    "direction": "SingleUp",
    "calibrationStatus": 1,
    "calibrationFactor": 3.25571346282959,
    "unfilteredGlucose": 87.18728637695312,
    "sgv": 87,
    "isig": 26.7797794342041,
    "device": "Medtronic_CGM",
    "isCalibrating": false,
    "date": 1469838244000,
    "_id": "579bf3a6554f7253d65a67e2"
  },
  {
    "direction": "Flat",
    "calibrationStatus": 1,
    "calibrationFactor": 3.25571346282959,
    "unfilteredGlucose": 79.57862091064453,
    "sgv": 79,
    "isig": 24.442760467529297,
    "device": "Medtronic_CGM",
    "isCalibrating": false,
    "date": 1469837971000,
    "_id": "579bf296554f7253d65a67de"
  }
Ben West
@bewest
Jul 31 2016 01:50
o-O
John Dodds
@johners97
Jul 31 2016 01:50
huh
Ben West
@bewest
Jul 31 2016 01:51
is that jberian stuff maybe?
John Dodds
@johners97
Jul 31 2016 01:51
jberian stuff?
Ben West
@bewest
Jul 31 2016 01:51
I'm wondering where that data came from
Chris Oattes
@cjo20
Jul 31 2016 01:51
Ben was expecting something that looks more like this I think:
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 20,
    "dateString": "2016-07-30T22:42:00+0100",
    "packet_size": 0,
    "sgv": 210,
    "date": 1469914920000,
    "device": "openaps://medtronic/pump/cgm",
    "_id": "579d201230284cb3a616d986",
    "type": "sgv",
    "op": 105
  },
Ben West
@bewest
Jul 31 2016 01:51
it doesn't have a dateString field
that's critical to my code, not that dateString field
ok
John Dodds
@johners97
Jul 31 2016 01:52
hmm
Ben West
@bewest
Jul 31 2016 01:53
if you already have data in nightscout, do you need to upload this data?
John Dodds
@johners97
Jul 31 2016 01:54
Ahh, I had data being uploaded via the commander thing yesterday via the phone
but it was slightly funky
Ben West
@bewest
Jul 31 2016 01:54
hmmm
John Dodds
@johners97
Jul 31 2016 01:54
Not yesterday, the day before i think
hm
Ben West
@bewest
Jul 31 2016 01:55
quick hack here is to set MONGO_COLLECTION=entries_02 and restart cgm-remote-monitor
John Dodds
@johners97
Jul 31 2016 01:55
Ok, i shall go onto azure portal and do that?
Ben West
@bewest
Jul 31 2016 01:55
yeah, I think so
Chris Oattes
@cjo20
Jul 31 2016 01:55
That data from ns get is ~24 hours old
John Dodds
@johners97
Jul 31 2016 01:56
huuh
Ben West
@bewest
Jul 31 2016 01:56
that matches what yous aid
said
John Dodds
@johners97
Jul 31 2016 01:56
yes
thats correct
>
Ben West
@bewest
Jul 31 2016 01:56
pointing it at a new entries collection will cause it to ignore that data, which will allow us to upload this data
John Dodds
@johners97
Jul 31 2016 01:57
right just entered it and restarting my ns website
/cgm remote
ok so ive reset it, now I reenter openaps use ns shell get entries.json count=2 ?
,
Chris Oattes
@cjo20
Jul 31 2016 01:59
what does your monitor/glucose.json contain, and what is the output of openaps report show --cli nightscout/recent-missing-entries.json?
Ben West
@bewest
Jul 31 2016 02:00
I think that report is defined ok now
Chris Oattes
@cjo20
Jul 31 2016 02:00
It's worth checking :)
Ben West
@bewest
Jul 31 2016 02:00
yeah, try openaps use ns shell get entries.json count=2
should return [] or maybe nothing
John Dodds
@johners97
Jul 31 2016 02:00
It returned [] yes
,
Ben West
@bewest
Jul 31 2016 02:01
ok, openaps report invoke nightscout/recent-missing-entries.json
John Dodds
@johners97
Jul 31 2016 02:01
pi@john:~/my_openaps $ openaps report invoke nightscout/recent-missing-entries.json
ns://JSON/shell/nightscout/recent-missing-entries.json
/usr/local/bin/nightscout: line 125: Third argument, contents to upload, FILE, does not exist: command not found
/usr/local/bin/nightscout: line 126: Third argument, contents to upload, FILE, not readable.: command not found
reporting nightscout/recent-missing-entries.json
Chris Oattes
@cjo20
Jul 31 2016 02:02
openaps report show --cli nightscout/recent-missing-entries.json
Ben West
@bewest
Jul 31 2016 02:02
yeah ^^
John Dodds
@johners97
Jul 31 2016 02:03
pi@john:~/my_openaps $ openaps report show --cli nightscout/recent-missing-entries.json
openaps use ns shell format-recent-type tz  entries monitor/glucose.json
Ben West
@bewest
Jul 31 2016 02:04
ok
John Dodds
@johners97
Jul 31 2016 02:04
,
Ben West
@bewest
Jul 31 2016 02:04
openaps report invoke monitor/glucose.json we might have missed that step
John Dodds
@johners97
Jul 31 2016 02:04
pi@john:~/my_openaps $ openaps report invoke monitor/glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
Ben West
@bewest
Jul 31 2016 02:05
openaps report invoke nightscout/recent-missing-entries.json again
John Dodds
@johners97
Jul 31 2016 02:05
pi@john:~/my_openaps $ openaps report invoke nightscout/recent-missing-entries.json
ns://JSON/shell/nightscout/recent-missing-entries.json
reporting nightscout/recent-missing-entries.json
worked
Ben West
@bewest
Jul 31 2016 02:05
yeah, now it works
now the upload part will also work, that's the thing it was stuck on
John Dodds
@johners97
Jul 31 2016 02:06
thanks
Ben West
@bewest
Jul 31 2016 02:06
so openaps report invoke nightscout/uploaded-entries.json should cause NS to update
John Dodds
@johners97
Jul 31 2016 02:07
ok, my ns looks funky
although not entirely funky
Ben West
@bewest
Jul 31 2016 02:07
hmmm
John Dodds
@johners97
Jul 31 2016 02:08
It has updated tho
like, it shows basals etc but it looks funky
what should i do7
I feel like a pain right now, but i am neck deep here, even when im being told what to do
Ben West
@bewest
Jul 31 2016 02:10
ok, did you mention you had DISPLAY_UNITS=mmol set on cgm-remote-monitor? if so in your upload step, you might need to set units=mg/dL
or other option is to run units tool on it
John Dodds
@johners97
Jul 31 2016 02:10
DISPLAY_UNITS = mmol yes
Ben West
@bewest
Jul 31 2016 02:10
what do you mean it looks funky? you can copy/paste screenshot here
yeah, then the upload needs to tell it the incoming data is the other unit
or need to run the unit tool on it to conver it
John Dodds
@johners97
Jul 31 2016 02:12
blob
Ben West
@bewest
Jul 31 2016 02:12
ah, no glucose
John Dodds
@johners97
Jul 31 2016 02:12
Not gonna sleep until this is done
yeah
,
Ben West
@bewest
Jul 31 2016 02:14
openaps report show
actually
openaps report show --json | json -g | json -a name
John Dodds
@johners97
Jul 31 2016 02:16
raw-pump/bg-targets-raw.json
settings/bg-targets.json
raw-pump/insulin-sensitivities-raw.json
settings/insulin-sensitivities.json
raw-pump/clock-raw.json
monitor/clock.json
monitor/temp-basal-status.json
oref0-predict/oref0.json
raw-pump/pump-history-raw.json
monitor/pump-history.json
model.json
monitor/reservoir.json
monitor/status.json
monitor/battery.json
oref0-enacted/enacted-temp-basal.json
settings/settings.json
raw-pump/settings.json
settings/selected-basal-profile.json
raw-pump/selected-basal-profile.json
raw-pump/temp-basal-status.json
raw-pump/reservoir.json
raw-pump/status.json
raw-pump/battery.json
last_four_pump_hours.json
monitor/clock-zoned.json
nightscout/recent-treatments.json
nightscout/uploaded.json
nightscout/recent-missing-entries.json
nightscout/uploaded-entries.json
nightscout/preflight.json
settings/model.json
monitor/glucose.json
settings/bg_targets_raw.json
settings/bg_targets.json
settings/insulin_sensitivities.json
settings/basal-profile.json
settings/profile.json
monitor/pumphistory.json
monitor/iob.json
monitor/temp_basal.json
enact/suggested.json
monitor/glucoseclean.json
nightscout/openaps-status.json
settings/insulin-sensitivities-raw.json
enact/enacted.json
raw-pump/mm-glucose.json
raw-pump/ns-glucose.json
Ben West
@bewest
Jul 31 2016 02:17
openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json
then: cat nightscout/uploaded-entries.json | json -a dateString | wc -l
John Dodds
@johners97
Jul 31 2016 02:20
pi@john:~/my_openaps $ openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
ns://JSON/shell/nightscout/recent-missing-entries.json
reporting nightscout/recent-missing-entries.json
ns://JSON/shell/nightscout/uploaded-entries.json
No JSON object could be decoded

Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 48, in main
    reporters.Reporter(report, device, task)(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 33, in __call__
    self.blob = self.serialize(data)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 31, in serialize
    return self.method.serialize(render(data), self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/process.py", line 56, in prerender_json
    return json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Ben West
@bewest
Jul 31 2016 02:20
hmm
cat nightscout/recent-missing-entries.json | json -a dateString
John Dodds
@johners97
Jul 31 2016 02:21
pi@john:~/my_openaps $ cat nightscout/recent-missing-entries.json | json -a dateString
pi@john:~/my_openaps $
Ben West
@bewest
Jul 31 2016 02:21
hmm
very suspicious looking
cat nightscout/recent-missing-entries.json
something has gone awry ;-)
John Dodds
@johners97
Jul 31 2016 02:22
pi@john:~/my_openaps $ cat nightscout/recent-missing-entries.json
[]
Ben West
@bewest
Jul 31 2016 02:22
ha, well it's empty
John Dodds
@johners97
Jul 31 2016 02:22
looks like it ;)
Chris Oattes
@cjo20
Jul 31 2016 02:22
because it's uploaded stuff already :P
Ben West
@bewest
Jul 31 2016 02:22
very likely
Chris Oattes
@cjo20
Jul 31 2016 02:22
openaps use ns shell get entries.json count=2
Ben West
@bewest
Jul 31 2016 02:22
^^^
John Dodds
@johners97
Jul 31 2016 02:23
pi@john:~/my_openaps $ openaps use ns shell get entries.json count=2
[]
the website is funky like before though
blob
Ben West
@bewest
Jul 31 2016 02:25
hmm... I see bunch of treatments stacked on the left
John Dodds
@johners97
Jul 31 2016 02:25
,
Ben West
@bewest
Jul 31 2016 02:25
let's see openaps use ns shell get treatments.json count=2
you have good data in cat monitor/glucose.json?
John Dodds
@johners97
Jul 31 2016 02:26
pi@john:~/my_openaps $ openaps use ns shell get treatments.json count=2
[
  {
    "raw_rate": {
      "_type": "TempBasal",
      "temp": "absolute",
      "_description": "TempBasal 2016-07-31T00:30:05 head[2], body[1] op[0x33]",
      "timestamp": "2016-07-31T00:30:05",
      "_body": "00",
      "_head": "332a",
      "rate": 1.05,
      "_date": "45de005f10"
    },
    "timestamp": "2016-07-31T00:30:05",
    "raw_duration": {
      "_type": "TempBasalDuration",
      "_description": "TempBasalDuration 2016-07-31T00:30:05 head[2], body[0] op[0x16]",
      "timestamp": "2016-07-31T00:30:05",
      "_body": "",
      "_head": "1601",
      "duration (min)": 30,
      "_date": "45de005f10"
    },
    "created_at": "2016-07-31T00:30:05",
    "enteredBy": "openaps://medtronic/754",
    "rate": 1.05,
    "eventType": "Temp Basal",
    "duration": 30,
    "_id": "579d3ca3554f7253d65a7192",
    "medtronic": "mm://openaps/mm-format-ns-treatments/Temp Basal",
    "absolute": 1.05
  },
  {
    "raw_rate": {
      "_type": "TempBasal",
      "temp": "absolute",
      "_description": "TempBasal 2016-07-30T23:06:54 head[2], body[1] op[0x33]",
      "timestamp": "2016-07-30T23:06:54",
      "_body": "00",
      "_head": "3334",
      "rate": 1.3,
      "_date": "76c6175e10"
    },
    "timestamp": "2016-07-30T23:06:54",
    "raw_duration": {
      "_type": "TempBasalDuration",
      "_description": "TempBasalDuration 2016-07-30T23:06:54 head[2], body[0] op[0x16]",
      "timestamp": "2016-07-30T23:06:54",
      "_body": "",
      "_head": "1601",
      "duration (min)": 30,
      "_date": "76c6175e10"
    },
    "created_at": "2016-07-30T23:06:54",
    "enteredBy": "openaps://medtronic/754",
    "rate": 1.3,
    "eventType": "Temp Basal",
    "duration": 30,
    "_id": "579d285e554f7253d65a70a0",
    "medtronic": "mm://openaps/mm-format-ns-treatments/Temp Basal",
    "absolute": 1.3
  }
Ben West
@bewest
Jul 31 2016 02:27
ah, ok
that's also missing zones
John Dodds
@johners97
Jul 31 2016 02:27
pi@john:~/my_openaps $ cat monitor/glucose.json
[
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 1,
    "dateString": "2016-07-31T03:18:00+01:00",
    "packet_size": 0,
    "date": 1469931480000,
    "device": "openaps://medtronic/pump/cgm",
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "dateString": "2016-07-31T03:13:00+01:00",
    "packet_size": 0,
    "date": 1469931180000,
    "op": 69,
    "device": "openaps://medtronic/pump/cgm",
    "sgv": 138,
    "type": "sgv",
    "glucose": 138
  },
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 3,
    "dateString": "2016-07-31T03:08:00+01:00",
    "packet_size": 0,
    "date": 1469930880000,
    "op": 69,
    "device": "openaps://medtronic/pump/cgm",
    "sgv": 138,
    "type": "sgv",
    "glucose": 138
  },
  {
    "date": 1469930580000,
    "name": "10-Something",
    "date_type": "minSpecific",
    "_tell": 4,
    "dateString": "2016-07-31T03:03:00+01:00",
    "packet_size": 4,
    "raw": "43-c3-1f-10",
    "device": "openaps://medtronic/pump/cgm",
    "type": "pumpdata",
    "op": "0x10"
  },
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 9,
    "dateString": "2016-07-31T03:19:00+01:00",
    "packet_size": 0,
    "date": 1469931540000,
    "device": "openaps://medtronic/pump/cgm",
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 10,
    "dateString": "2016-07-31T03:14:00+01:00",
    "packet_size": 0,
    "date": 1469931240000,
    "op": 0,
    "device": "openaps://medtronic/pump/cgm",
    "sgv": 0,
    "type": "sgv",
    "glucose": 0
  }
Ben West
@bewest
Jul 31 2016 02:27
yeah, that loks good
ok
let's see what happens:
John Dodds
@johners97
Jul 31 2016 02:28
,
Ben West
@bewest
Jul 31 2016 02:28
openaps use ns shell upload entries.json monitor/glucose.json
this is just one time experiment
John Dodds
@johners97
Jul 31 2016 02:28
pi@john:~/my_openaps $ openaps use ns shell upload entries.json monitor/glucose.json
[
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 1,
    "dateString": "2016-07-31T03:18:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469931480000,
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "glucose": 138,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "dateString": "2016-07-31T03:13:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469931180000,
    "sgv": 138,
    "type": "sgv",
    "op": 69
  },
  {
    "glucose": 138,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 3,
    "dateString": "2016-07-31T03:08:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469930880000,
    "sgv": 138,
    "type": "sgv",
    "op": 69
  },
  {
    "name": "10-Something",
    "date_type": "minSpecific",
    "_tell": 4,
    "dateString": "2016-07-31T03:03:00+01:00",
    "packet_size": 4,
    "raw": "43-c3-1f-10",
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469930580000,
    "type": "pumpdata",
    "op": "0x10"
  },
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 9,
    "dateString": "2016-07-31T03:19:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469931540000,
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "glucose": 0,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 10,
    "dateString": "2016-07-31T03:14:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469931240000,
    "sgv": 0,
    "type": "sgv",
    "op": 0
  }
Ben West
@bewest
Jul 31 2016 02:29
hehehe
how does NS look?
John Dodds
@johners97
Jul 31 2016 02:29
it worked
blob
^^^ wrong pic
blob
Ben West
@bewest
Jul 31 2016 02:30
ok, working under the idea that helps "prime" the data flux
John Dodds
@johners97
Jul 31 2016 02:30
jesis christ
trust me it works tho
Ben West
@bewest
Jul 31 2016 02:30
a few minutes have passed, hopefully there's a slightly newer glucose value available, attempt that very very long report invoke ....... command again
John Dodds
@johners97
Jul 31 2016 02:30
blob
Ben West
@bewest
Jul 31 2016 02:31
the one that had everything listed again
John Dodds
@johners97
Jul 31 2016 02:32
`openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json`
This one?
Ben West
@bewest
Jul 31 2016 02:32
yeah
John Dodds
@johners97
Jul 31 2016 02:32
Just wait until another sensor reading
Ben West
@bewest
Jul 31 2016 02:32
should be several available
should be at least 4 new ones
from perspective of nightscout
John Dodds
@johners97
Jul 31 2016 02:35
pi@john:~/my_openaps $ openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
ns://JSON/shell/nightscout/recent-missing-entries.json
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 298, in main
    if spec.includes(get(elem)):
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 264, in get
    return parse(item.get(args.date))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 552, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 671, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 188, in split
    return list(cls(s))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 184, in next
    return self.__next__()  # Python 2.x support
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 177, in __next__
    token = self.get_token()
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 93, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'NoneType' object has no attribute 'read'
No JSON object could be decoded

Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-p
jesus christ
Ben West
@bewest
Jul 31 2016 02:36
hmmm
Chris Oattes
@cjo20
Jul 31 2016 02:37
openaps use ns shell lsgaps tz entries
Ben West
@bewest
Jul 31 2016 02:37
openaps report show --cli nightscout/recent-missing-entries.json
nah, entries is a keyword here for the tool to know which endpoint to test against
John Dodds
@johners97
Jul 31 2016 02:38
pi@john:~/my_openaps $ openaps report show --cli nightscout/recent-missing-entries.json
openaps use ns shell format-recent-type tz  entries monitor/glucose.json
Ben West
@bewest
Jul 31 2016 02:38
hmm
John Dodds
@johners97
Jul 31 2016 02:38
hm
Ben West
@bewest
Jul 31 2016 02:38
let's try that exactly first
and then with a change
openaps use ns shell format-recent-type tz entries monitor/glucose.json
openaps use ns shell format-recent-type tz entries/sgv monitor/glucose.json
first one should print [] hopefully
second one should print tons of stuff, hopefully
John Dodds
@johners97
Jul 31 2016 02:40

pi@john:~/my_openaps $ openaps use ns shell format-recent-type tz entries monitor/glucose.json
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 298, in main
    if spec.includes(get(elem)):
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 264, in get
    return parse(item.get(args.date))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 552, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 671, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 188, in split
    return list(cls(s))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 184, in next
    return self.__next__()  # Python 2.x support
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 177, in __next__
    token = self.get_token()
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 93, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'NoneType' object has no attribute 'read'
No JSON object could be decoded

Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 58, in run
    reporter(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 33, in __call__
    self.blob = self.serialize(data)
  File "/usr/local/li
hm
Chris Oattes
@cjo20
Jul 31 2016 02:41
openaps use ns shell lsgaps tz entries
John Dodds
@johners97
Jul 31 2016 02:42

pi@john:~/my_openaps $ openaps use ns shell lsgaps tz entries
[
  {
    "current": "2016-07-31T03:40:47+01:00",
    "prev": "2016-07-31T03:19:00+01:00",
    "dateString": "2016-07-31T03:40:47+01:00",
    "delta": 1307.0
  }
Ben West
@bewest
Jul 31 2016 02:42
yeah, that would be interesting, I mis read that earlier
John Dodds
@johners97
Jul 31 2016 02:42
hm
Chris Oattes
@cjo20
Jul 31 2016 02:42
openaps use ns shell lsgaps tz entries | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json
Ben West
@bewest
Jul 31 2016 02:43
might try entries/sgv instead as well
will grab by only sgv type
John Dodds
@johners97
Jul 31 2016 02:43
pi@john:~/my_openaps $ openaps use ns shell lsgaps tz entries | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json
[
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 1,
    "dateString": "2016-07-31T03:38:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469932680000,
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "glucose": 130,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "dateString": "2016-07-31T03:33:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469932380000,
    "sgv": 130,
    "type": "sgv",
    "op": 65
  },
  {
    "glucose": 132,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 3,
    "dateString": "2016-07-31T03:28:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469932080000,
    "sgv": 132,
    "type": "sgv",
    "op": 66
  },
  {
    "glucose": 136,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 4,
    "dateString": "2016-07-31T03:23:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469931780000,
    "sgv": 136,
    "type": "sgv",
    "op": 68
  }
Ben West
@bewest
Jul 31 2016 02:43
ah
John Dodds
@johners97
Jul 31 2016 02:44
openaps use ns shell lsgaps tz entries/svg | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json
? @bewest
try that?
Ben West
@bewest
Jul 31 2016 02:45
yeah
no
entries/sgv sorry
John Dodds
@johners97
Jul 31 2016 02:45
just entries/svg?
Ben West
@bewest
Jul 31 2016 02:45
yours has a typo
svg is not same as sgv
John Dodds
@johners97
Jul 31 2016 02:46
openaps use ns shell lsgaps tz entries/sgv | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json
Ben West
@bewest
Jul 31 2016 02:47
yeah
John Dodds
@johners97
Jul 31 2016 02:47

pi@john:~/my_openaps $ openaps use ns shell lsgaps tz entries/sgv | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json
[
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 1,
    "dateString": "2016-07-31T03:38:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469932680000,
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "glucose": 130,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "dateString": "2016-07-31T03:33:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469932380000,
    "sgv": 130,
    "type": "sgv",
    "op": 65
  },
  {
    "glucose": 132,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 3,
    "dateString": "2016-07-31T03:28:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469932080000,
    "sgv": 132,
    "type": "sgv",
    "op": 66
  },
  {
    "glucose": 136,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 4,
    "dateString": "2016-07-31T03:23:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469931780000,
    "sgv": 136,
    "type": "sgv",
    "op": 68
  },
  {
    "glucose": 136,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 5,
    "dateString": "2016-07-31T03:18:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "date": 1469931480000,
    "sgv": 136,
    "type": "sgv",
    "op": 68
  }
Chris Oattes
@cjo20
Jul 31 2016 02:47
@bewest I think the problem is that tz select uses display_time as the default for --date, which this dataset doesn't have. nightscout.sh uses openaps use ns shell lsgaps ${ZONE} ${TYPE} | openaps use ${ZONE} select --current now --gaps - ${FILE} | json, which uses the default --date field for the tz device
Ben West
@bewest
Jul 31 2016 02:47
yeah, that makes sense
nice find
that date spec on lsgaps?
John Dodds
@johners97
Jul 31 2016 02:48
hm
Ben West
@bewest
Jul 31 2016 02:48
oh, on select
I think current dev uses entire list
hmm
Chris Oattes
@cjo20
Jul 31 2016 02:48
@use( )
class select (Use):
  """ select some data out of a timeseries
  """
  def configure_app (self, app, parser):
    parser.add_argument('input', nargs=argparse.REMAINDER, default=None)
    # parser.add_argument('--minutes', type=float, default=10)
    parser.add_argument('--date',  default='display_time')
    parser.add_argument('--current',  default='now')
    parser.add_argument('--prev',  default=None)
    parser.add_argument('--gaps',  default=None)
    parser.add_argument('--timezone','-z', default=None)
    parser.add_argument('--no-timezone', action='store_true',  default=False)
Ben West
@bewest
Jul 31 2016 02:48
oh
John Dodds
@johners97
Jul 31 2016 02:49
,
Chris Oattes
@cjo20
Jul 31 2016 02:49
I'm on master for openapscontrib/timezones
Ben West
@bewest
Jul 31 2016 02:49
yeah, bingo
that's all there is for that one right now
yeah that's definitely the issue
John Dodds
@johners97
Jul 31 2016 02:51
>
Chris Oattes
@cjo20
Jul 31 2016 02:51
@johners97 why do you keep sending random punctuation?
John Dodds
@johners97
Jul 31 2016 02:51
my hand
it keeps hitting the keyboard
Ben West
@bewest
Jul 31 2016 02:52
that should be changed to do --date dateString
that's easiest and will help a lot
select could maybe be patched to do what happens elsewhere, which is take a list of keys to check maybe
or maybe change the default, not sure
John Dodds
@johners97
Jul 31 2016 02:54
you guys are helping a lot @bewest @cjo20
Chris Oattes
@cjo20
Jul 31 2016 02:55
Looks like everything in timezone just has a default of display_time
John Dodds
@johners97
Jul 31 2016 02:55
blob
GODDDD
I literally copy and pasted it this time
Ben West
@bewest
Jul 31 2016 02:56
rezone can handle a list of args
Chris Oattes
@cjo20
Jul 31 2016 02:57
openaps use ns shell lsgaps tz entries/sgv | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json > nightscout/recent-missing-entries.json then openaps report invoke nightscout/uploaded-entries.json
@bewest I'd probably just change the nightscout.sh line
Ben West
@bewest
Jul 31 2016 02:58
or openaps use ns shell lsgaps tz entries/sgv | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
John Dodds
@johners97
Jul 31 2016 03:00
@cjo20 worked, added two data points onto the graph from the last points
@bewest says pipe error
Ben West
@bewest
Jul 31 2016 03:01
ah ok, do it his way for now ;-)
John Dodds
@johners97
Jul 31 2016 03:01
pi@john:~/my_openaps $ cat nightscout/uploaded-entries.json
[
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 1,
    "dateString": "2016-07-31T03:38:00+01:00",
    "packet_size": 0,
    "date": 1469932680000,
    "device": "openaps://medtronic/pump/cgm",
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "dateString": "2016-07-31T03:33:00+01:00",
    "packet_size": 0,
    "date": 1469932380000,
    "op": 65,
    "device": "openaps://medtronic/pump/cgm",
    "sgv": 130,
    "type": "sgv",
    "glucose": 130
  }
```
pi@john:~/my_openaps $ openaps use ns shell lsgaps tz entries/sgv | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json
No JSON object could be decoded
Input file entries.json does not exist.

Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 58, in run
    reporter(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 33, in __call__
    self.blob = self.serialize(data)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 31, in serialize
    return self.method.serialize(render(data), self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/process.py", line 56, in prerender_json
    return json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 58, in run
    reporter(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 35, in __call__
    self.close( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 37, in close
    getattr(self.method, 'close_output_stream', default_close_stream)(self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 13, in default_close_stream
    reporter.output.close( )
IOError: [Errno 32] Broken pipe
Ben West
@bewest
Jul 31 2016 03:02
oh, careful
my version had an extra - on the end that was important
openaps use ns shell lsgaps tz entries/sgv | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
Chris Oattes
@cjo20
Jul 31 2016 03:02
the extra - at the end tells it to take its input from the command line, so the output of the previous command is used as input for the current command
John Dodds
@johners97
Jul 31 2016 03:03
Sorry, it worked
:)

pi@john:~/my_openaps $ openaps use ns shell lsgaps tz entries/sgv | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
[
  {
    "name": "DataEnd",
    "date_type": "none",
    "_tell": 1,
    "dateString": "2016-07-31T03:38:00+01:00",
    "packet_size": 0,
    "date": 1469932680000,
    "device": "openaps://medtronic/pump/cgm",
    "type": "pumpdata",
    "op": "0x01"
  },
  {
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 2,
    "dateString": "2016-07-31T03:33:00+01:00",
    "packet_size": 0,
    "date": 1469932380000,
    "op": 65,
    "device": "openaps://medtronic/pump/cgm",
    "sgv": 130,
    "type": "sgv",
    "glucose": 130
  }
Chris Oattes
@cjo20
Jul 31 2016 03:04
@johners97 The reports you've got set up at the moment won't work to upload things, because of an issue with the way one of the files in oref0 processes the data, but they'll work when someone has submitted a fix for it
@bewest you ok to do a PR / submit for a fix? It's 4am and I'd like some sleep :P
John Dodds
@johners97
Jul 31 2016 03:05
@cjo20 Ok, once the fix is done I'll come back and @@ you two
Is that ok @bewest ? I need sleep too! haha
Ben West
@bewest
Jul 31 2016 03:05
yeah
sudo npm install -g git://github.com/openaps/oref0.git#dev for the fi
fix
and then the long invoke should work as intended
already patched :-)
Chris Oattes
@cjo20
Jul 31 2016 03:07
:+1:
John Dodds
@johners97
Jul 31 2016 03:07
the long inboke?
Chris Oattes
@cjo20
Jul 31 2016 03:08
openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json
then: cat nightscout/uploaded-entries.json | json -a dateString | wc -l
John Dodds
@johners97
Jul 31 2016 03:08
oh ueah sorry
pi@john:~/my_openaps $ openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
ns://JSON/shell/nightscout/recent-missing-entries.json
reporting nightscout/recent-missing-entries.json
ns://JSON/shell/nightscout/uploaded-entries.json
reporting nightscout/uploaded-entries.json
pi@john:~/my_openaps $ cat nightscout/uploaded-entries.json | json -a dateString | wc -l
5
Works!
Hmm
Should I err put this in the loop?
or
Ben West
@bewest
Jul 31 2016 03:13
yes, you'll need to organize your aliases so those reports get invoked in that order
usually they get broken up into 2 or 3 aliases, but you could certainly but all those reports into a single alias
John Dodds
@johners97
Jul 31 2016 03:15
ok, sorry im so tired right now, the uploading pump data is ok to go isnt it
Ben West
@bewest
Jul 31 2016 03:16
yeah, those are all the reports in that order that fetch the data, prepares it, and uploads it to NS
John Dodds
@johners97
Jul 31 2016 03:18
[report "raw-pump/mm-glucose.json"]
device = insulin_pump
count = 5
use = iter_glucose
reporter = JSON
Can I set the count to say 200?
Ben West
@bewest
Jul 31 2016 03:19
yes
Chris Oattes
@cjo20
Jul 31 2016 03:19
288 might be better
Ben West
@bewest
Jul 31 2016 03:19
a lot of them are non-sgv's, 300 is a nice round number
John Dodds
@johners97
Jul 31 2016 03:19
why? :package:
:smile:
Ben West
@bewest
Jul 31 2016 03:20
288 is 24 hours worth of 5 minute intervals
John Dodds
@johners97
Jul 31 2016 03:20
ok :)
hmm yeah, your right, it still works but doesnt take in my sensor readings from yesterday
Ben West
@bewest
Jul 31 2016 03:24
ah.. well
John Dodds
@johners97
Jul 31 2016 03:24
unless i go into mlab and delete the non-sgvs ?
Ben West
@bewest
Jul 31 2016 03:24
if you got your monitor/glucose.json file full of glucose from yesterday...
we can use a variant of something you already did :-)
John Dodds
@johners97
Jul 31 2016 03:25
ok :P
It is pretty full yeah
All i need to do now is work out how to do that...and how to link openaps with ns properly so theres no ? mark at it in my ns :)
Ben West
@bewest
Jul 31 2016 03:27
openaps use ns shell get entries/sgv.json count=300 | openaps use tz lsgaps --minutes 5 --before yesterday --after now - | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
hmm maybe
yeah
usually it will attempt to look at last hour or two and fill in any gaps
as a one time thing, something like this can be used to make it go back farther
oops
edited, there we go
John Dodds
@johners97
Jul 31 2016 03:30
deited?
edited?
Ben West
@bewest
Jul 31 2016 03:30
I edited it so it says entries/sgv.json now
before it said entries/sgv
there's a bunch of - type things in there that are all important
single hyphen like that usually means "use all the stuff from the previous | (pipe)"
the --before yesterday --after now part is what controls how much data to include
should be able to give it any phrase that matches what you like with date --date "yesterday" to see what it will include
John Dodds
@johners97
Jul 31 2016 03:34
Tryna work out what ive done done wrong
pi@john:~/my_openaps $ openaps use ns shell get entries/sgv.json count=300 | openaps use tz lsgaps --minutes 5 --before yesterday --after now - | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 196, in main
    data = sorted(data, key=get)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 178, in get
    return parse(item.get(args.date))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 552, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 671, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 188, in split
    return list(cls(s))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 184, in next
    return self.__next__()  # Python 2.x support
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 177, in __next__
    token = self.get_token()
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 93, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'NoneType' object has no attribute 'read'
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-pac
I'm su[[psed
to replace things in that havent i
goodness sake, ignore that
Ben West
@bewest
Jul 31 2016 03:36
hmm
maybe just the first portions: openaps use ns shell get entries/sgv.json count=300 | openaps use tz lsgaps --minutes 5 --before yesterday --after now -
ah
John Dodds
@johners97
Jul 31 2016 03:38
openaps use ns shell get entries/sgv.json count=300 | openaps use tz lsgaps --minutes 5 --before yesterday --after now - | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
ok so openaps use tz select --current now --date dateString --gaps - monitor/glucose.json |openaps use ns shell upload entries.json -
there is something there i need to change>
?*
Ben West
@bewest
Jul 31 2016 03:40
# as a test:
openaps use ns shell get entries/sgv.json count=300 | openaps use tz lsgaps --date dateString --minutes 6 --before yesterday --after now -
# if that looks good,
openaps use ns shell get entries/sgv.json count=300 | openaps use tz lsgaps --date dateString --minutes 6 --before yesterday --after now - | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
yeah, that should work to fill in the gaps as much as possible
is there a low?
John Dodds
@johners97
Jul 31 2016 03:43
yay it worked
there is yes
John Dodds
@johners97
Jul 31 2016 03:49
damn it my ssh has frozen while doing openaps use ns shell get treatments.json
whats the command to upload pump data
to ns again dammit
Martin Haeberli
@mhaeberli
Jul 31 2016 03:53
@bewest - please remind me how to get a raw-cgm equivalent report out of Nightscout ...
Ben West
@bewest
Jul 31 2016 03:54
openaps use ns shell get entries/sgv.json count=300
John Dodds
@johners97
Jul 31 2016 03:55
:) thanks alot ben
Martin Haeberli
@mhaeberli
Jul 31 2016 03:56
so to report: ?
openaps report add raw-cgm/glucose-raw.json JSON ns shell get entries/sgv.json count=300
John Dodds
@johners97
Jul 31 2016 03:56
would never have got this nearlydone without you
Ben West
@bewest
Jul 31 2016 03:57
yeah, that should work
Martin Haeberli
@mhaeberli
Jul 31 2016 04:01
@bewest and… what would be the ns equivalent of:
openaps use <my_dexcom_name> iter_glucose 1
Ben West
@bewest
Jul 31 2016 04:01
count=1
Martin Haeberli
@mhaeberli
Jul 31 2016 04:01
d’oh!
openaps use ns shell get entries/sgv.json count=1
@bewest by the way, how does oref0 cope with parallel xDrip and Share numbers ?
Ben West
@bewest
Jul 31 2016 04:03
it does not
John Dodds
@johners97
Jul 31 2016 04:05
I dont want to cause any harm to my openaps. How do I get all my basal/pump info into ns again? I know how to get the cgm data in :-)
Martin Haeberli
@mhaeberli
Jul 31 2016 04:05
k so for now just turn off xDrip - I guess in future I could code up something that filtered out one or the other automatically ...
Ben West
@bewest
Jul 31 2016 04:06
you can add additional search parameters to the count
Martin Haeberli
@mhaeberli
Jul 31 2016 04:06
@bewest ! of course ! so if I wanted only xDrip entries, ...
Ben West
@bewest
Jul 31 2016 04:07
what does the device field say?
count=1&find[device]=xDrip
Martin Haeberli
@mhaeberli
Jul 31 2016 04:07
xDrip-BluetoothWixel in the one case
in the other case, share2 - so i’ll give that a try
Ben West
@bewest
Jul 31 2016 04:09
count=1&find[device][$ne]=share
it's all the mongo search syntax appended to the find object and urlencoded, php style
Martin Haeberli
@mhaeberli
Jul 31 2016 04:11
i feel like i’m not bash escaping correctly ...
so the $ is giving me trouble … time for a bit of reading ...
Ben West
@bewest
Jul 31 2016 04:12
needs to be in single quotes
'count=1&find[device][$ne]=share'
Martin Haeberli
@mhaeberli
Jul 31 2016 04:12
woot!
Ben West
@bewest
Jul 31 2016 04:12
that will search for things where the device field does not equal share
Martin Haeberli
@mhaeberli
Jul 31 2016 04:13
i got it - so we can keep share and xdrip data, adjust the raw report for now to harvest only one of them, feed that to oref0
Ben West
@bewest
Jul 31 2016 04:13
the entries/sgv.json path is actually syntactic sugar for find[type]=sgv
Martin Haeberli
@mhaeberli
Jul 31 2016 04:13
:+1:
John Dodds
@johners97
Jul 31 2016 04:14
openaps use ns shell upload treatments.json
This should upload yes
[report "nightscout/openaps-status.json"]
oper = monitor/clock.json
use = shell
reporter = JSON
json_default = True
device = ns
remainder = oref0-monitor/iob.json oref0-predict/oref0.json oref0-enacted/enacted-temp-basal.json monitor/battery.json monitor/reservoir.json monitor/status.json
This is what gets the openaps status I assume
John Dodds
@johners97
Jul 31 2016 04:19
Ignore me i found something...
John Dodds
@johners97
Jul 31 2016 05:29
calculate-iob://JSON/shell/monitor/iob.json
reporting monitor/iob.json
calculate-iob://JSON/shell/monitor/iob.json
reporting monitor/iob.json
determine-basal://text/shell/enact/suggested.json
Avgdelta lookback NaN minutes
Error: date field not found: cannot calculate twodelta
Could not parse input data:  [ReferenceError: twoavg is not defined]
reporting enact/suggested.json
insulin_pump://JSON/set_temp_basal/enact/enacted.json
enact/enacted.json  raised  No JSON object could be decoded
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 40, in main
    output = task.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 430, in main
    program = self.get_program(args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 427, in get_program
    program = json.load(argparse.FileType('r')(params.get('input')))
  File "/usr/lib/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
LOOP FAILED.
Since updating this is happening
John Dodds
@johners97
Jul 31 2016 05:35
So, enact/enacted.json no longer has output...
John Dodds
@johners97
Jul 31 2016 05:52
pi@john:~/my_openaps $ openaps report invoke enact/suggested.json
determine-basal://text/shell/enact/suggested.json
Avgdelta lookback NaN minutes
Error: date field not found: cannot calculate twodelta
Could not parse input data:  [ReferenceError: twoavg is not defined]
reporting enact/suggested.json
Mitchell Slep
@moomoobloo
Jul 31 2016 05:52
I set up Pancreabble, but I'm getting a pairing request on the watch (Pebble Time) every time my loop sends a status update. Any ideas why?
John Dodds
@johners97
Jul 31 2016 05:54
:(
Date field... time... issue with time...zoning?
delta related to time, so a time issue?
Chris Oattes
@cjo20
Jul 31 2016 09:27
@johners97 I've created a pull request to fix that issue
sebastiaanvduijn
@sebastiaanvduijn
Jul 31 2016 11:24
Hi, i have 2 pumps one medtronic 744 without the PC connect menu which works fine I can read and write without any problems. I also have the medtronic VEO 754 which have the PC connect menu, I only can read the data from it, for example i tried to set the time and it don't change. But when i open the PC connect menu and the pump says ready to receive data i can change the time. So a write request will work when you have opened the menu of PC connect. I am going to test further in order to make sure this will work correctly.
Chris Oattes
@cjo20
Jul 31 2016 12:02
Yeah, the "PC connect" option enables write access, but it only lasts for 2 minutes
Eric
@ecc1
Jul 31 2016 12:16
I wonder if it accepts remote key press commands during that period. If so, we could do a keepalive at the end of each 2 minutes. Battery life would be terrible though.
Chris Oattes
@cjo20
Jul 31 2016 12:24
@ecc1 you mean manually select PC connect?
Eric
@ecc1
Jul 31 2016 12:26
Do the equivalent of manual selection, by sending those keypresses over RF (already supported in delicate)
Decocare
Chris Oattes
@cjo20
Jul 31 2016 12:38
I'd be worried about what would happen if someone was trying to use the pump as it sent those commands
John Dodds
@johners97
Jul 31 2016 12:58
@cjo20 How do I update it
John Dodds
@johners97
Jul 31 2016 13:04
Actually, I remebered how - but has it been merged with dev

pi@john:~ $ sudo dpkg-reconfigure tzdata

Current default time zone: 'Europe/London'
Local time is now: Sun Jul 31 12:24:46 BST 2016.
Universal Time is now: Sun Jul 31 11:24:46 UTC 2016.

Other issue is, my pi lost power unexpectedly and it won't update to the correct time


pi@john:~ $ sudo dpkg-reconfigure tzdata

Current default time zone: 'Europe/London'
Local time is now:      Sun Jul 31 12:24:46 BST 2016.
Universal Time is now:  Sun Jul 31 11:24:46 UTC 2016.
Everytime the pi loses power, the time ends up deranged (back in time often). I need a way to fix that
John Dodds
@johners97
Jul 31 2016 13:13
Ok, i'm assuming it's been merged. If it hasn't then I will fork it, make the change and base my oref0 as my own?
Sorry silly, question, updated it now, however, the date issue still stands
John Dodds
@johners97
Jul 31 2016 13:18
With regards to the pi, not oref0 or openaps
FIXED IT
:D
John Dodds
@johners97
Jul 31 2016 13:24
sudo /etc/init.d/ntp stop
sudo ntpd -q -g
sudo /etc/init.d/ntp start
John Dodds
@johners97
Jul 31 2016 13:54
pi@john:~/my_openaps $ openaps report invoke enact/suggested.json
determine-basal://text/shell/enact/suggested.json
Avgdelta lookback NaN minutes
Two data point lookback NaN minutes

/usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js:145
        bgTime = new Date(glucose_data[0].display_time.replace('T', ' '));
                                                       ^
TypeError: Object 1469944980000 has no method 'replace'
    at Object.<anonymous> (/usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js:145:56)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
reporting enact/suggested.json
after I updated your file change to mine @cjo20
pi@john:~/my_openaps $ openaps loop
insulin_pump://JSON/read_clock/monitor/clock.json
reporting monitor/clock.json
PREFLIGHT OK
insulin_pump://JSON/read_settings/settings/settings.json
reporting settings/settings.json
insulin_pump://JSON/read_bg_targets/settings/bg_targets_raw.json
reporting settings/bg_targets_raw.json
units://JSON/bg_targets/settings/bg-targets.json
reporting settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/settings/insulin-sensitivities-raw.json
reporting settings/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
reporting settings/insulin-sensitivities.json
insulin_pump://JSON/read_basal_profile_std/settings/basal-profile.json
reporting settings/basal-profile.json
get-profile://text/shell/settings/profile.json
Could not sort temptargets_data.  Optional feature temporary targets disabled.
reporting settings/profile.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
glucose://JSON/clean/monitor/glucoseclean.json
reporting monitor/glucoseclean.json
insulin_pump://JSON/read_clock/monitor/clock.json
reporting monitor/clock.json
insulin_pump://JSON/read_temp_basal/monitor/temp_basal.json
reporting monitor/temp_basal.json
insulin_pump://JSON/iter_pump_hours/monitor/pumphistory.json
reporting monitor/pumphistory.json
calculate-iob://JSON/shell/monitor/iob.json
reporting monitor/iob.json
calculate-iob://JSON/shell/monitor/iob.json
reporting monitor/iob.json
determine-basal://text/shell/enact/suggested.json
Avgdelta lookback NaN minutes
Two data point lookback NaN minutes

/usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js:145
        bgTime = new Date(glucose_data[0].display_time.replace('T', ' '));
                                                       ^
TypeError: Object 1469944980000 has no method 'replace'
    at Object.<anonymous> (/usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js:145:56)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
reporting enact/suggested.json
insulin_pump://JSON/set_temp_basal/enact/enacted.json
enact/enacted.json  raised  No JSON object could be decoded
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 40, in main
    output = task.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 430, in main
    program = self.get_program(args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 427, in get_program
    program = json.lo
loop failed
live4sw
@live4sw
Jul 31 2016 14:01
Hi guys - had a quick question. I'm on a trip and the guest house has a "guest wifi" setup where you connect to the network and then get a Cisco Connect login page where you enter a password.
Is there a way to set up wpa_supplicant to access this? I don't have a monitor here so I can only ssh into the RPi.
John Dodds
@johners97
Jul 31 2016 14:10
try to get ns working, end up with my loop not working :(
Chris Oattes
@cjo20
Jul 31 2016 14:10
@live4sw not sure, you could try lynx via ssh though
John Dodds
@johners97
Jul 31 2016 14:11

pi@john:~/my_openaps $ openaps report invoke enact/suggested.json
determine-basal://text/shell/enact/suggested.json
Avgdelta lookback NaN minutes
Error: date field not found: cannot calculate twodelta
Could not parse input data:  [ReferenceError: twoavg is not defined]
reporting enact/suggested.json
Chris Oattes
@cjo20
Jul 31 2016 14:12
@johners97 which glucose file are you using as an input?
John Dodds
@johners97
Jul 31 2016 14:13
glucose.json, glucoseclean.json
Chris Oattes
@cjo20
Jul 31 2016 14:13
You can only feed one glucose file in to suggested.json, so which is it?
John Dodds
@johners97
Jul 31 2016 14:16
glucoseclean.json
Chris Oattes
@cjo20
Jul 31 2016 14:16
can you give an example of one of the entries in glucoseclean.json?
John Dodds
@johners97
Jul 31 2016 14:19
},
  {
    "glucose": 76,
    "display_time": 1469924580000,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 93,
    "dateString": "2016-07-31T01:23:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "type": "sgv",
    "op": 38
  },
  {
One of the many

[report "monitor/glucoseclean.json"]
device = glucose
use = clean
infile = monitor/glucose.json
reporter = JSON

[report "enact/suggested.json"]
profile = settings/profile.json
use = shell
temp_basal = monitor/temp_basal.json
reporter = text
json_default = True
device = determine-basal
remainder =
iob = monitor/iob.json
glucose = monitor/glucoseclean.json
oref0-iob = monitor/iob.json
temp-basal = monitor/temp_basal.json
oref0-profile = settings/profile.json
Chris Oattes
@cjo20
Jul 31 2016 14:21
The input to suggested.json needs to be zoned
John Dodds
@johners97
Jul 31 2016 14:21
glucose?
Chris Oattes
@cjo20
Jul 31 2016 14:21
yes
The glucose input to suggested.json needs to be zoned
John Dodds
@johners97
Jul 31 2016 14:22

[report "raw-pump/ns-glucose.json"]
device = mm-glucose-format
remainder = raw-pump/mm-glucose.json
use = shell
json_default = True
reporter = JSON

[report "raw-pump/mm-glucose.json"]
device = insulin_pump
count = 288
use = iter_glucose
reporter = JSON
These are zoned?
Chris Oattes
@cjo20
Jul 31 2016 14:23
no
John Dodds
@johners97
Jul 31 2016 14:23
Can you show me how,
tz?
Theres nothing in the documentation on how to do this
:(
John Dodds
@johners97
Jul 31 2016 14:31
pi@john:~/my_openaps $  openaps report invoke monitor/glucose-zoned.json

tz://JSON/rezone/monitor/glucose-zoned.json
monitor/glucose-zoned.json  raised  'long' object has no attribute 'read'
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 40, in main
    output = task.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 89, in main
    results = self.convert(inputs)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 84, in convert
    record[field] = self.rezone(parse(value)).isoformat( )
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 552, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 671, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 188, in split
    return list(cls(s))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 184, in next
    return self.__next__()  # Python 2.x support
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 177, in __next__
    token = self.get_token()
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 93, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'long' object has no attribute 'read'
Had openaps working fine yesterday...
knew I shouldn't have bothered with nightscout
John Dodds
@johners97
Jul 31 2016 14:40
:D
John Dodds
@johners97
Jul 31 2016 14:54
Another person is having the same problem
with
pi@john:~/my_openaps $ openaps report invoke enact/suggested.json
determine-basal://text/shell/enact/suggested.json
Avgdelta lookback NaN minutes
Error: date field not found: cannot calculate twodelta
Could not parse input data:  [ReferenceError: twoavg is not defined]
reporting enact/suggested.json
But, this is the dev version of oref0.
if we change back to master of oref0, loop works, ns does not. If we change to dev of oref0, ns works, loop does not............
GabeA23
@GabeA23
Jul 31 2016 15:28

Do you think PayPal buyer protection would cover a purchased pump that doesn't work? Based on their description, it doesn't really seem like it:

https://www.paypal.com/us/webapps/mpp/paypal-safety-and-security

John Dodds
@johners97
Jul 31 2016 15:39
pi@john:~/my_openaps $ openaps report invoke enact/suggested.json
determine-basal://text/shell/enact/suggested.json
Avgdelta lookback NaN minutes
Error: date field not found: cannot calculate twodelta
Could not parse input data:  [ReferenceError: twoavg is not defined]
reporting enact/suggested.json
How do I rezone-glucose (medtronic guys)
Eric Jensen
@elnjensen
Jul 31 2016 15:56
@live4sw Not exactly a clean solution but you could make a local wifi network from phone or laptop (that is connected to guest wifi) and piggyback RPi onto that.
John Dodds
@johners97
Jul 31 2016 16:15
:(
John Dodds
@johners97
Jul 31 2016 16:23
:( help
Kim St. Dennis
@kimstdennis_twitter
Jul 31 2016 18:08
any have any insight into nodejs-legacy errors on the edison? Google was fruitless and a gitter search turned up @ddaniels1 having the same issue, but no resolution. With no node packages intalled, this is the error;
The following packages have unmet dependencies:
 nodejs-legacy : Depends: nodejs (>= 0.6.19~dfsg1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
kstdennis@ksdcgmed:~$
Kim St. Dennis
@kimstdennis_twitter
Jul 31 2016 18:18
hmmm Apt sources...
can someone with a running edison post the contents of /etc/apt/sources.list?
Ben West
@bewest
Jul 31 2016 18:20
is it not working?
Kim St. Dennis
@kimstdennis_twitter
Jul 31 2016 18:20
nah, can't get nodejs-legacy installed
Ben West
@bewest
Jul 31 2016 18:21
which node and which nodejs
Kim St. Dennis
@kimstdennis_twitter
Jul 31 2016 18:21
both blank
no node installed.
was hoping nodejs-legacy would pull in it's deps
Ben West
@bewest
Jul 31 2016 18:22
sudo apt-get update should refresh thtse sources/conten
Kim St. Dennis
@kimstdennis_twitter
Jul 31 2016 18:22
doesn't seem to be pulling in correctly. I'm wondering if I've got my sources set incorrectly
Ben West
@bewest
Jul 31 2016 18:23
unlikely unless you changed them
after apt-get update, I'd try sudo apt-get install nodejs nodejs-legacy
Kim St. Dennis
@kimstdennis_twitter
Jul 31 2016 18:26
Hmm I updated the sources after moving from wheezy to jessie
John Dodds
@johners97
Jul 31 2016 18:37
@bewest Can you help me please? :P
been stuck for hours

my loop is not working.Preflight works fine, and all the reports invoke fine except this one

determine-basal://text/shell/enact/suggested.json
Avgdelta lookback NaN minutes
Error: date field not found: cannot calculate twodelta
Could not parse input data:  [ReferenceError: twoavg is not defined]
reporting enact/suggested.json

So i realized i need to perhaps zone the glucose data because i use medtronic but I have been unable to !

John Dodds
@johners97
Jul 31 2016 18:42
There is nothing available to support me to carry on to the next stage, well having the loop actually work. I've updated oref0 and it appears the monitor/glucoseclean.json input is not right. What report must I add and invoke in order to have the correct format for input?
Ain't interpreting the glucose data I have therefore I need to change the format...have no idea how
var getLastGlucose = function (data) {
    data = data.map(function prepGlucose (obj) {
        //Support the NS sgv field to avoid having to convert in a custom way
        obj.glucose = obj.glucose || obj.sgv;
        return obj;
    });

    var now = data[0];
    var last = data[1];
    var minutes;
    var change;
    var avg;

    //TODO: calculate average using system_time instead of assuming 1 data point every 5m
    if (typeof data[3] !== 'undefined' && data[3].glucose > 30) {
        minutes = 3*5;
        change = now.glucose - data[3].glucose;
    } else if (typeof data[2] !== 'undefined' && data[2].glucose > 30) {
        minutes = 2*5;
        change = now.glucose - data[2].glucose;
    } else if (typeof last !== 'undefined' && last.glucose > 30) {
        minutes = 5;
        change = now.glucose - last.glucose;
    } else { change = 0; }
    // multiply by 5 to get the same units as delta, i.e. mg/dL/5m
    avg = change/minutes * 5;

    return {
        delta: now.glucose - last.glucose
        , glucose: now.glucose
        , avgdelta: Math.round( avg * 1000 ) / 1000
    };
};

module.exports = getLastGlucose;
John Dodds
@johners97
Jul 31 2016 18:47
"support the NS sgv field to avoid having to concert in a custom way" ...ok so I know my conversion has something to do with that?
lib/glucose-last-get.js
Kim St. Dennis
@kimstdennis_twitter
Jul 31 2016 18:49
I was just looking at that to see if I could help, https://github.com/openaps/oref0/pull/181/files
bparrish0
@bparrish0
Jul 31 2016 18:51
John, I'm having the same issue. For one thing it seems to be looking for a date field in glucoseclean.json, but in glucoseclean it's called "display_time"..if i change that field to "date" i can get further in the report, but get other errors
'''Could not determine last BG time
'''Error: could not calculate eventualBG
Ben West
@bewest
Jul 31 2016 18:53
need to investigate that report that is failing...
openaps report show --cli enact/suggested.json
John Dodds
@johners97
Jul 31 2016 18:56
pi@john:~/my_openaps $ openaps report show --cli enact/suggested.json
openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucoseclean.json settings/profile.json
ok
Chris Oattes
@cjo20
Jul 31 2016 18:59
[report "monitor/glucose-zoned.json"]
use = rezone
reporter = JSON
astimezone = False
date = display_time
adjust = missing
input = monitor/glucoseclean.json
device = tz
timezone = BST
John Dodds
@johners97
Jul 31 2016 19:00
Yes...how do you make that report?
:)
openaps report add....
openaps report add monitor/glucose-zoned.json................
Remember I have no experience of programming... so it's hard for me
hard for lots of people
bparrish0
@bparrish0
Jul 31 2016 19:05
john: you can "nano openaps.ini" and paste it in directly
Chris Oattes
@cjo20
Jul 31 2016 19:06
And I generate glucoseclean.json from
[report "monitor/glucoseclean.json"]
device = glucose
use = clean
infile = monitor/glucose.json
reporter = JSON
@johners97 You need to stop telling yourself that you can't do it because you don't have any knowledge of programming
Dana Lewis
@danamlewis
Jul 31 2016 19:08
+1, @cjo20
bparrish0
@bparrish0
Jul 31 2016 19:08
i'm still getting the same issues when using the zoned glucose..it's not looking for the output of ns-format-mm-glucsoe is it?
Chris Oattes
@cjo20
Jul 31 2016 19:10
I pass that glucose-zoned in to enact/suggested.json and it seems to work
@johners97 What openaps gives you is the ability to chain together a series of reports to produce whatever output you want. oref0,tz and a few other things gives you a set of tools that help you process the data. What you have in openaps.ini is just a description of how to create a file, and which inputs it needs to create it. Most of the error messages tell you which file is going wrong, or which data it can't find.
John Dodds
@johners97
Jul 31 2016 19:14
pi@john:~/my_openaps $ openaps report invoke monitor/glucose-zoned.json
tz://JSON/rezone/monitor/glucose-zoned.json
monitor/glucose-zoned.json  raised  'long' object has no attribute 'read'
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 40, in main
    output = task.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 89, in main
    results = self.convert(inputs)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 84, in convert
    record[field] = self.rezone(parse(value)).isoformat( )
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 552, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 671, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 188, in split
    return list(cls(s))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 184, in next
    return self.__next__()  # Python 2.x support
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 177, in __next__
    token = self.get_token()
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 93, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'long' object has no attribute 'read'
Ok, well this is what I get
Kim St. Dennis
@kimstdennis_twitter
Jul 31 2016 19:15
for any folks that have issues with nodejs-legacy on the edison, editing my sources list at /etc/apt/sources.list fixed the issue. Sources can be found here; https://wiki.debian.org/SourcesList and eventually I also added;
deb http://ftp.us.debian.org/debian jessie main .
rlwrap was also another dependency I was missing.
Tony Zarro
@tzarro
Jul 31 2016 19:18
hey guys, having a problem and hoping someone can help...I have an Openaps instance running well on a Pi2, and am now trying to get it working by replacing CareLink with a TI USB stick. It seems to work perfectly when running manually ("openaps loop"), but when I run the "openaps retry-loop" function it isn't working.
Now my retry-loop contains a reference to mm-stick warmup, but since I am now running with the TI USB stick should I edit or remove that refererence (retry-loop = ! bash -c "until ( ! mm-stick warmup || openaps loop); do sleep 5; done"
Chris Oattes
@cjo20
Jul 31 2016 19:20
openaps use glucose clean monitor/glucose.json > monitor/glucoseclean.json; openaps use tz rezone --date display_time --timezone "BST" monitor/glucoseclean.json > monitor/glucose-zoned.json; openaps use determine-basal shell monitor/meal.json monitor/iob.json monitor/temp_basal.json monitor/glucose-zoned.json settings/profile.json
You might have to change some of the arguments to determine-basal
John Dodds
@johners97
Jul 31 2016 19:25
pi@john:~/my_openaps $ openaps use tz rezone --date display_time --timezone "BST" monitor/glucoseclean.json > monitor/glucose-zoned.json
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 89, in main
    results = self.convert(inputs)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.15-py2.7.egg/openapscontrib/timezones/__init__.py", line 84, in convert
    record[field] = self.rezone(parse(value)).isoformat( )
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 552, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 671, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 188, in split
    return list(cls(s))
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 184, in next
    return self.__next__()  # Python 2.x support
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 177, in __next__
    token = self.get_token()
  File "/usr/local/lib/python2.7/dist-packages/python_dateutil-2.5.3-py2.7.egg/dateutil/parser.py", line 93, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'long' object has no attribute 'read'
Ah right, not sure what this is about tbh
Chris Oattes
@cjo20
Jul 31 2016 19:26
openaps use <pump> iter_glucose 288 > monitor/glucose.json; openaps use glucose clean monitor/glucose.json > monitor/glucoseclean.json; openaps use tz rezone --date display_time --timezone "BST" monitor/glucoseclean.json > monitor/glucose-zoned.json; openaps use determine-basal shell monitor/meal.json monitor/iob.json monitor/temp_basal.json monitor/glucose-zoned.json settings/profile.json
Gina
@gclyon
Jul 31 2016 19:29
Following this thread, as I'm experiencing same issue as @johners97 & @bparrish0 . Seems after running glucose clean, date turns into display_time. ...trying to understand "rezoning"
Chris Oattes
@cjo20
Jul 31 2016 19:30
@gclyon rezoning is adding TZ information to the date fields so that it can be sure that 01:00 means 01:00 and not 00:00 (for example)
John Dodds
@johners97
Jul 31 2016 19:33
pi@john:~/my_openaps $ openaps use insulin_pump iter_glucose 288 > monitor/glucose.json; openaps use glucose clean monitor/glucose.json > monitor/glucoseclean.json; openaps use tz rezone --date display_time --timezone "BST" monitor/glucoseclean.json > monitor/glucose-zoned.json; openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose-zoned.json settings/profile.json
Avgdelta lookback 30 minutes
Error: date field not found: cannot calculate twodelta
Could not parse input data:  [ReferenceError: twoavg is not defined]
No JSON object could be decoded

Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 58, in run
    reporter(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 33, in __call__
    self.blob = self.serialize(data)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 31, in serialize
    return self.method.serialize(render(data), self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/process.py", line 56, in prerender_json
    return json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
ah ok well i tried it
Chris Oattes
@cjo20
Jul 31 2016 19:38
what does an entry from glucose-zoned look like?
John Dodds
@johners97
Jul 31 2016 19:39
 {
    "display_time": "2016-07-31T00:43:00+01:00",
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 349,
    "packet_size": 0,
    "op": 47,
    "glucose": 94
  },
  {
    "display_time": "2016-07-31T00:38:00+01:00",
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 350,
    "packet_size": 0,
    "op": 48,
    "glucose": 96
  }
John Dodds
@johners97
Jul 31 2016 19:52
looks like this btw
"glucose": 96,
    "display_time": 1469921880000,
    "name": "GlucoseSensorData",
    "date_type": "prevTimestamp",
    "_tell": 350,
    "dateString": "2016-07-31T00:38:00+01:00",
    "packet_size": 0,
    "device": "openaps://medtronic/pump/cgm",
    "type": "sgv",
    "op": 48
glucoseclean.json ^
Glucose-zoned is the first one I sent
Ben West
@bewest
Jul 31 2016 20:00
I think you should just be using monitor/glucose.json, which we set up yesterday
what was the big long invoke we had yesterday?
Ben West
@bewest
Jul 31 2016 20:05

yours is like this:

openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucoseclean.json settings/profile.json

whereas I would try this:

openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json
bparrish0
@bparrish0
Jul 31 2016 20:06
when using monitor/glucose.json i get: Error: could not calculate eventualBG
Ben West
@bewest
Jul 31 2016 20:06
hmm, which problem is yours, I don't think you had same problem as @johners97
John Dodds
@johners97
Jul 31 2016 20:06
pi@john:~/my_openaps $ openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json
Avgdelta lookback 30 minutes
Two data point lookback 10 minutes
BG data is too old, or clock set incorrectly.  Your CGM time is Sun Jul 31 2016 20:44:00 GMT+0100 (BST) but your system time is Sun Jul 31 2016 21:06:11 GMT+0100 (BST)
{
  "reason": "BG data is too old, or clock set incorrectly.  Your CGM time is Sun Jul 31 2016 20:44:00 GMT+0100 (BST) but your system time is Sun Jul 31 2016 21:06:11 GMT+0100 (BST)"
bparrish0
@bparrish0
Jul 31 2016 20:07
i am basically having the same issue, went from master to dev today and enact/suggested isn't liking my glucose input
Ben West
@bewest
Jul 31 2016 20:07
where is your glucose coming from?
bparrish0
@bparrish0
Jul 31 2016 20:07
enlite/pump
i've tried glucose, glucoseclean, and glucose-zoned
Ben West
@bewest
Jul 31 2016 20:08
the issue here seems to be that the glucose.json file is stale
Chris Oattes
@cjo20
Jul 31 2016 20:09
@bparrish0 You might need PR #181 from oref0/dev
Ben West
@bewest
Jul 31 2016 20:10
usually there's a few "raw" files, and some rezoning that happens to create the glucose.json
John Dodds
@johners97
Jul 31 2016 20:10
ok, so my glucose.json is stale?
Ben West
@bewest
Jul 31 2016 20:11
it looks to me like you are experiencing different problems
John Dodds
@johners97
Jul 31 2016 20:12
conundrum
Ben West
@bewest
Jul 31 2016 20:13
oh, actualy, yes, that error is clearly indicating that the glucose is stale
do you remember the big long invoke from yesterday?
John Dodds
@johners97
Jul 31 2016 20:15
openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json This one?
bparrish0
@bparrish0
Jul 31 2016 20:15
@cjo20 that was it, thanks!
Ben West
@bewest
Jul 31 2016 20:15
yeah
openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json
those three reports are all needed to update the glucose.json
after glucose.json has been updated by refreshing all of those, then you can try that use again with this file instead
openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json
if that works, you need to re-add the report with this updated specifiction
John Dodds
@johners97
Jul 31 2016 20:17
pi@john:~/my_openaps $ openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json Avgdelta lookback 25 minutes Two data point lookback 10 minutes BG data is too old, or clock set incorrectly. Your CGM time is Sun Jul 31 2016 21:24:00 GMT+0100 (BST) but your system time is Sun Jul 31 2016 21:17:02 GMT+0100 (BST) { "reason": "BG data is too old, or clock set incorrectly. Your CGM time is Sun Jul 31 2016 21:24:00 GMT+0100 (BST) but your system time is Sun Jul 31 2016 21:17:02 GMT+0100 (BST)"
What the hell
Ben West
@bewest
Jul 31 2016 20:18
you ran openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json first?
cat monitor/glucose.json | json -a dateString | head
date
John Dodds
@johners97
Jul 31 2016 20:19
}pi@john:~/my_openaps $ openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
pi@john:~/my_openaps $ cat monitor/glucose.json | json -a dateString | head
2016-07-31T21:24:00+01:00
2016-07-31T21:19:00+01:00
2016-07-31T21:14:00+01:00
2016-07-31T21:09:00+01:00
2016-07-31T21:04:00+01:00
2016-07-31T20:59:00+01:00
2016-07-31T20:59:00+01:00
2016-07-31T20:54:00+01:00
2016-07-31T20:49:00+01:00
2016-07-31T20:44:00+01:00
pi@john:~/my_openaps $ date Sun 31 Jul 21:20:04 BST 2016
pi@john:~/my_openaps $ openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json
Avgdelta lookback 25 minutes
Two data point lookback 10 minutes
{"netbasalinsulin":0.55,"activity":0.0086,"basaliob":-0.346,"time":"2016-07-31T21:20:15.000Z","hightempinsulin":1.1,"bolussnooze":0,"iob":-0.253}
{"delta":null,"avgdelta":null,"twodelta":null}
{"duration":6,"rate":0.1,"temp":"absolute"}
{"max_iob":10,"type":"current","max_daily_safety_multiplier":3,"current_basal_safety_multiplier":4,"autosens_max":1.5,"autosens_min":0.7,"autosens_adjust_targets":true,"override_high_target_with_low":false,"dia":3,"model":{},"current_basal":1.3,"max_daily_basal":1.4,"max_basal":35,"out_units":"mmol/L","min_bg":81,"max_bg":117,"sens":21.599999999999998}
Adjusting sens from 21.599999999999998 to 21.6
Error: could not calculate eventualBG
No JSON object could be decoded
Ben West
@bewest
Jul 31 2016 20:23
openaps use pump set_clock --to now
cat monitor/glucose.json | json -a dateString glucose | head
curious, might be a bug in determine-basal
John Dodds
@johners97
Jul 31 2016 20:25

pi@john:~/my_openaps $ openaps use insulin_pump set_clock --to now
{
  "raw": [],
  "requested": {
    "old": "2016-07-31T21:24:32",
    "params": [
      21,
      24,
      40,
      7,
      224,
      7,
      31
    ],
    "clock": "2016-07-31T21:24:40.549233"
  },
  "timestamp": "2016-07-31T21:24:45.295973",
  "clock": "2016-07-31T21:24:43"

pi@john:~/my_openaps $ cat monitor/glucose.json | json -a dateString glucose | headcat: monitor/glucose.json: No such file or directory
see enact/suggested.json should I change glucose-zoned to glucose.json
Ben West
@bewest
Jul 31 2016 20:26
once we get it working
the idea with this is that report automates all the uses
John Dodds
@johners97
Jul 31 2016 20:26
yeah
Ben West
@bewest
Jul 31 2016 20:26
so you can explore and get it right with the use and then make it automatic by saving the report
it's very useful to interactively get it right manually
it looks like @cjo20 has a patch to help with what is likely the issue here
one more:
cat monitor/glucose.json | json -a dateString date glucose | head
John Dodds
@johners97
Jul 31 2016 20:28
pi@john:~/my_openaps $ cat monitor/glucose.json | json -a dateString date glucose | head 2016-07-31T21:24:00+01:00 1469996640000 2016-07-31T21:19:00+01:00 1469996340000 80 2016-07-31T21:14:00+01:00 1469996040000 86 2016-07-31T21:09:00+01:00 1469995740000 88 2016-07-31T21:04:00+01:00 1469995440000 86 2016-07-31T20:59:00+01:00 1469995140000 2016-07-31T20:59:00+01:00 1469995140000 88 2016-07-31T20:54:00+01:00 1469994840000 94 2016-07-31T20:49:00+01:00 1469994540000 104 2016-07-31T20:44:00+01:00 1469994240000 112
pi@john:~/my_openaps $ cat monitor/glucose.json | json -a dateString date glucose | head
2016-07-31T21:24:00+01:00 1469996640000
2016-07-31T21:19:00+01:00 1469996340000 80
2016-07-31T21:14:00+01:00 1469996040000 86
2016-07-31T21:09:00+01:00 1469995740000 88
2016-07-31T21:04:00+01:00 1469995440000 86
2016-07-31T20:59:00+01:00 1469995140000
2016-07-31T20:59:00+01:00 1469995140000 88
2016-07-31T20:54:00+01:00 1469994840000 94
2016-07-31T20:49:00+01:00 1469994540000 104
2016-07-31T20:44:00+01:00 1469994240000 112
Chris Oattes
@cjo20
Jul 31 2016 20:28
I did point him at that PR about 8 hours ago
Ben West
@bewest
Jul 31 2016 20:28
ah ok
John Dodds
@johners97
Jul 31 2016 20:28
I know you did
Ben West
@bewest
Jul 31 2016 20:28
I'll merge it into dev
ok
now:
sudo npm install -g git://github.com/openaps/oref0.git#dev
John Dodds
@johners97
Jul 31 2016 20:29
updated
Ben West
@bewest
Jul 31 2016 20:30
try the long report invoke to update the monitor/glucose.json again, and then use determine-basal with monitor/glucose.json again
John Dodds
@johners97
Jul 31 2016 20:32
pi@john:~/my_openaps $ openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json
Avgdelta lookback 0 minutes
Two data point lookback 0 minutes
{"netbasalinsulin":0.4,"activity":0.0059,"basaliob":-0.433,"time":"2016-07-31T21:30:36.000Z","hightempinsulin":1,"bolussnooze":0,"iob":-0.372}
{"delta":null,"avgdelta":null,"twodelta":null}
{"duration":0,"rate":0.1,"temp":"absolute"}
{"max_iob":10,"type":"current","max_daily_safety_multiplier":3,"current_basal_safety_multiplier":4,"autosens_max":1.5,"autosens_min":0.7,"autosens_adjust_targets":true,"override_high_target_with_low":false,"dia":3,"model":{},"current_basal":1.3,"max_daily_basal":1.4,"max_basal":35,"out_units":"mmol/L","min_bg":81,"max_bg":117,"sens":21.599999999999998}
Adjusting sens from 21.599999999999998 to 21.6
Error: could not calculate eventualBG
No JSON object could be decoded
I used thelong invoke just before
Chris Oattes
@cjo20
Jul 31 2016 20:35
This message was deleted
John Dodds
@johners97
Jul 31 2016 20:37
pi@john:~/my_openaps $ openaps use determine-basal shell monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json
Avgdelta lookback -5 minutes
Two data point lookback 0 minutes
BG data is too old, or clock set incorrectly.  Your CGM time is Sun Jul 31 2016 21:24:00 GMT+0100 (BST) but your system time is Sun Jul 31 2016 21:36:24 GMT+0100 (BST)
{
  "reason": "BG data is too old, or clock set incorrectly.  Your CGM time is Sun Jul 31 2016 21:24:00 GMT+0100 (BST) but your system time is Sun Jul 31 2016 21:36:24 GMT+0100 (BST)"
hmm
Ben West
@bewest
Jul 31 2016 20:40
yeah, if it gets older than 5 minutes or so, that's eexpected
the previous one is more interesting
Error: could not calculate eventualBG
might ping @scottleibrand for that
John Dodds
@johners97
Jul 31 2016 20:41
openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json
Doing this 1.
Ben West
@bewest
Jul 31 2016 20:44
let's inspect the iob.json
cat monitor/iob.json
openaps report show monitor/iob.json --cli
that one also needs to be invoked
the last one, the glucose data is indeed old by ten minutes
it's possible that if iob is old, you could get an error like that about eventualBG
John Dodds
@johners97
Jul 31 2016 20:47
pi@john:~/my_openaps $ openaps report show monitor/iob.json --cli
openaps use calculate-iob shell monitor/pumphistory.json settings/profile.json monitor/clock.json
pi@john:~/my_openaps $ openaps use calculate-iob shell monitor/pumphistory.json settings/profile.json monitor/clock.json
[
  {
    "netbasalinsulin": 0.2,
    "activity": 0.0024,
    "basaliob": -0.452,
    "time": "2016-07-31T21:45:22.000Z",
    "hightempinsulin": 0.8,
    "bolussnooze": 0,
    "iob": -0.424
  },
  {
    "netbasalinsulin": 0.15,
    "activity": 0.0012,
    "basaliob": -0.45,
    "time": "2016-07-31T21:50:22.000Z",
    "hightempinsulin": 0.75,
    "bolussnooze": 0,
    "iob": -0.43
  },
  {
    "netbasalinsulin": 0.15,
    "activity": 0.0001,
    "basaliob": -0.443,
    "time": "2016-07-31T21:55:22.000Z",
    "hightempinsulin": 0.75,
    "bolussnooze": 0,
    "iob": -0.43
  },
Ben West
@bewest
Jul 31 2016 20:48
all those also need to be invoked/refreshed
John Dodds
@johners97
Jul 31 2016 20:49
ok
Ben West
@bewest
Jul 31 2016 20:49
you probably have some aliases set up to do that as a shortcut
that looks ok-ish
hmm
let's check cat monitor/pumphistory.json | json -a timestamp I think
John Dodds
@johners97
Jul 31 2016 20:50
updated them
Ben West
@bewest
Jul 31 2016 20:50
I want to see if it's zoned properly :-)
John Dodds
@johners97
Jul 31 2016 20:51
pi@john:~/my_openaps $ cat monitor/pumphistory.json | json -a timestamp
2016-07-31T21:43:13
2016-07-31T21:42:12
2016-07-31T21:42:12
2016-07-31T21:28:26
2016-07-31T21:28:23
2016-07-31T21:28:19
2016-07-31T21:28:19
2016-07-31T21:25:17
2016-07-31T21:24:40
2016-07-31T21:24:33
2016-07-31T21:23:56
2016-07-31T21:19:23
2016-07-31T20:55:10
2016-07-31T20:55:10
2016-07-31T20:48:12
2016-07-31T20:08:25
2016-07-31T19:47:16
2016-07-31T19:19:12
2016-07-31T19:19:12
2016-07-31T19:19:04
2016-07-31T19:17:15
2016-07-31T19:17:15
2016-07-31T19:00:00
2016-07-31T18:49:37
2016-07-31T18:19:37
2016-07-31T18:19:37
2016-07-31T18:18:28
Ben West
@bewest
Jul 31 2016 20:51
ah ok
John Dodds
@johners97
Jul 31 2016 20:51
but its 21:50
Ben West
@bewest
Jul 31 2016 20:52
we'll need to redefine that in similar fashion to what we did yesterday, first let's see what it is: openaps report show --cli monitor/pumphistory.json
John Dodds
@johners97
Jul 31 2016 20:52
pi@john:~/my_openaps $ openaps report show --cli monitor/pumphistory.json
openaps use insulin_pump iter_pump_hours 4.0
Ben West
@bewest
Jul 31 2016 20:53
ok first we set up a raw version: openaps report add raw-pump/pump-history.json JSON insulin_pump iter_pump_hours 4.0
John Dodds
@johners97
Jul 31 2016 20:53
ok
invoke it?
]pi@john:~/my_openaps $ openaps report add raw-pump/pump-history.json JSON insulin_ump iter_pump_hours 4.0
added insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
Ben West
@bewest
Jul 31 2016 20:55
then we set up zoned version: openaps report add monitor/pump-history.json JSON tz rezone --date created_at --date end_at --date start_at --date dateString --date timestamp raw-pump/pump-history.json
This message was deleted
John Dodds
@johners97
Jul 31 2016 20:55
?
Do that^
Ben West
@bewest
Jul 31 2016 20:56
that feeds it to rezone to create monitor/glucose.json
yes
John Dodds
@johners97
Jul 31 2016 20:56
pi@john:~/my_openaps $ openaps report add monitor/pump-history.json JSON tz rezone --date created_at --date end_at --date start_at --date dateString --date timestamp raw-pump/pump-history.json
added tz://JSON/rezone/monitor/pump-history.json
Ben West
@bewest
Jul 31 2016 20:56
yeah, this adds timezones to the file
ok, invoke that too
these two always need to be invoked together
so same concept as glucose.json, it takes several steps to first grab the raw data, then prepare it for other things to use
the final version is monitor/pump-history.json, but it needs raw-pump/pump-history.json first
so openaps report invoke raw-pump/pump-history.json monitor/pump-history.json will do them together
John Dodds
@johners97
Jul 31 2016 20:58
pi@john:~/my_openaps $ openaps report invoke raw-pump/pump-history.json monitor/pump-history.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
Ben West
@bewest
Jul 31 2016 20:59
let's see what aliases you've got
openaps alias show
dealing with all these reports individually is getting old
John Dodds
@johners97
Jul 31 2016 20:59
pi@john:~/my_openaps $ openaps alias show
rm-warmup ! bash -c "rm -f model.json monitor/clock.json > /dev/null"
warmup report invoke model.json raw-pump/clock-raw.json monitor/clock.json
fail-warmup ! bash -c "echo PREFLIGHT FAIL; exit 1"
preflight ! bash -c "rm -f monitor/clock.json && openaps report invoke monitor/clock.json 2>/dev/null && grep -q T monitor/clock.json && echo PREFLIGHT OK || (mm-stick warmup || sudo oref0-reset-usb; echo PREFLIGHT FAIL; sleep 120; exit 1)"
monitor-cgm report invoke monitor/glucose.json monitor/glucoseclean.json
monitor-pump-history report invoke raw-pump/pump-history-raw.json monitor/pumphistory.json
get-basal-status report invoke monitor/temp-basal-status.json
get-pump-details report invoke monitor/reservoir.json monitor/status.json monitor/battery.json
get-settings report invoke raw-pump/bg-targets-raw.json settings/bg-targets.json raw-pump/insulin-sensitivities-raw.json settings/insulin-sensitivities.json raw-pump/selected-basal-profile.json raw-pump/settings.json settings/selected-basal-profile.json settings/settings.json
gather-pump-data ! bash -c "openaps get-basal-status; openaps get-pump-details; openaps monitor-pump-history;  openaps get-settings"
gather-clean-data ! bash -c "openaps monitor-cgm && openaps gather-pump-data"
do-oref0 report invoke oref0-monitor/profile.json oref0-monitor/iob.json oref0-predict/oref0.json
enact-oref0 report invoke oref0-enacted/enacted-temp-basal.json
do-everything ! bash -c "(openaps preflight && openaps gather-clean-data && openaps do-oref0 && openaps enact-oref0);  openaps report-nightscout"
ping ! bash -c "echo PONG! $*" --
pong ! echo PONG
hello ! echo hello
okbar ! bash -c "echo $1" --
report-nightscout report invoke monitor/clock-zoned.json nightscout/preflight.json monitor/glucoseclean.json nightscout/uploaded.json  nightscout/uploaded-entries.json
gather ! bash -c "rm -f monitor/*; openaps get-profile && openaps monitor-cgm && openaps monitor-pump && openaps report invoke monitor/iob.json"
get-profile report invoke settings/settings.json settings/bg_targets_raw.json settings/bg-targets.json settings/insulin-sensitivities-raw.json settings/insulin-sensitivities.json settings/basal-profile.json settings/profile.json
monitor-pump report invoke monitor/clock.json monitor/temp_basal.json monitor/pumphistory.json monitor/iob.json
loop ! bash -c "( openaps preflight && openaps gather && openaps enact) || echo LOOP FAILED."
determine-basal report invoke enact/suggested.json
enact report invoke enact/suggested.json enact/enacted.json
retry-loop ! bash -c "openaps preflight && until( ! mm-stick warmup || openaps loop); do sleep 5; done"
backdate use ns shell get entries/sgv.json count=300 | openaps use tz lsgaps --date dateString --minutes 6 --before yesterday --after now - | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
Ben West
@bewest
Jul 31 2016 21:01
hmmm ok
openaps alias add monitor-pump-history report invoke raw-pump/pump-history.json monitor/pump-history.json
that redefines monitor-pump-history to do what we just did
John Dodds
@johners97
Jul 31 2016 21:03
pi@john:~/my_openaps $ openaps alias add monitor-pump-history "report invoke raw-pump/pump-history.json monitor/pump-history.json"
added monitor-pump-history report invoke raw-pump/pump-history.json monitor/pump-history.json
Ben West
@bewest
Jul 31 2016 21:03
openaps alias add monitor-cgm "report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json "
this one redefines monitor-cgm to do everything needed to prepare monitor/glucose.json
ok, now fingers crossed, we should be able to do openaps gather-clean-data and it should do both of those things
gah
This message was deleted
oh you fixed it
with the quotes is correct
John Dodds
@johners97
Jul 31 2016 21:07
pi@john:~/my_openaps $ openaps gather-clean-data
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 24, in main
    task = app.actions.commands['add'].usages.commands[device.name].method.commands[report.fields['use']]
KeyError: 'read_bg_targets'
Ben West
@bewest
Jul 31 2016 21:08
ah interesting
openaps report show | grep read_bg_targets
that's interesting
John Dodds
@johners97
Jul 31 2016 21:09
pi@john:~/my_openaps $ openaps report show | grep read_bg_targets
units://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
insulin_pump://JSON/read_bg_targets/settings/bg_targets_raw.json
Ben West
@bewest
Jul 31 2016 21:09
yeah
openaps report show settings/bg_targets_raw.json --cli
John Dodds
@johners97
Jul 31 2016 21:10
pi@john:~/my_openaps $ openaps report show settings/bg_targets_raw.json --cli
openaps use insulin_pump read_bg_targets
Ben West
@bewest
Jul 31 2016 21:11
openaps report add raw-pump/bg-targets.json JSON insulin_pump read_bg_targets
John Dodds
@johners97
Jul 31 2016 21:11
pi@john:~/my_openaps $ openaps report add raw-pump/bg-targets.json JSON insulin_pump read_bg_targets
added insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets.json
Ben West
@bewest
Jul 31 2016 21:12
actually
John Dodds
@johners97
Jul 31 2016 21:12
invoke? or
Ben West
@bewest
Jul 31 2016 21:13
oref0 template mint reports medtronic-pump --name insulin_pump | openaps import
John Dodds
@johners97
Jul 31 2016 21:14
pi@john:~/my_openaps $ oref0 template mint reports medtronic-pump --name insulin_pump | openaps import
insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
insulin_pump://JSON/read_clock/raw-pump/clock-raw.json
tz://JSON/clock/monitor/clock.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
determine-basal://text/shell/oref0-predict/oref0.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history-raw.json
tz://JSON/rezone/monitor/pump-history.json
insulin_pump://JSON/model/model.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
insulin_pump://JSON/set_temp_basal/oref0-enacted/enacted-temp-basal.json
oref0://JSON/shell/settings/settings.json
insulin_pump://JSON/read_settings/raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
insulin_pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
insulin_pump://JSON/read_temp_basal/raw-pump/temp-basal-status.json
insulin_pump://JSON/reservoir/raw-pump/reservoir.json
insulin_pump://JSON/read_status/raw-pump/status.json
insulin_pump://JSON/read_battery_status/raw-pump/battery.json
Ben West
@bewest
Jul 31 2016 21:15
ok, one more: openaps report add monitor/pump-history.json JSON tz rezone --date created_at --date end_at --date start_at --date dateString --date timestamp raw-pump/pump-history.json
it stomped on that one, so need that one again
looks like everything else should be fine
let's try openaps gather-clean-data again
John Dodds
@johners97
Jul 31 2016 21:16
pi@john:~/my_openaps $ openaps report add monitor/pump-history.json JSON tz rezone --date created_at --date end_at --date start_at --date dateString --date timestamp raw-pump/pump-history.json
added tz://JSON/rezone/monitor/pump-history.json
ok
Ben West
@bewest
Jul 31 2016 21:17
there might be errors, but I expect different errors
John Dodds
@johners97
Jul 31 2016 21:17
-bash: added: command not found
pi@john:~/my_openaps $ openaps gather-clean-data
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
reporting raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
reporting settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
reporting raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
reporting settings/insulin-sensitivities.json
insulin_pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
reporting raw-pump/selected-basal-profile.json
insulin_pump://JSON/read_settings/raw-pump/settings.json
reporting raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
reporting settings/selected-basal-profile.json
oref0://JSON/shell/settings/settings.json
reporting settings/settings.json
looking good
Ben West
@bewest
Jul 31 2016 21:18
openaps do-oref0
John Dodds
@johners97
Jul 31 2016 21:19
openaps do-oref0 ?
Ben West
@bewest
Jul 31 2016 21:19
yup
it's an alias that runs all the oref0 stuff
John Dodds
@johners97
Jul 31 2016 21:20
pi@john:~/my_openaps $ openaps do-oref0
usage: openaps-report invoke [-h]
                             {enact/enacted.json,enact/suggested.json,last_four_pump_hours.json,model.json,monitor/battery.json,monitor/clock-zoned.json,monitor/clock.json,monitor/glucose-zoned.json,monitor/glucose.json,monitor/glucoseclean.json,monitor/iob.json,monitor/pump-history.json,monitor/pumphistory.json,monitor/reservoir.json,monitor/status.json,monitor/temp-basal-status.json,monitor/temp_basal.json,nightscout/openaps-status.json,nightscout/preflight.json,nightscout/recent-missing-entries.json,nightscout/recent-treatments.json,nightscout/uploaded-entries.json,nightscout/uploaded.json,oref0-enacted/enacted-temp-basal.json,oref0-predict/oref0.json,raw-pump/battery.json,raw-pump/bg-targets-raw.json,raw-pump/bg-targets.json,raw-pump/clock-raw.json,raw-pump/insulin-sensitivities-raw.json,raw-pump/mm-glucose.json,raw-pump/ns-glucose.json,raw-pump/pump-history-raw.json,raw-pump/pump-history.json,raw-pump/reservoir.json,raw-pump/selected-basal-profile.json,raw-pump/settings.json,raw-pump/status.json,raw-pump/temp-basal-status.json,settings/basal-profile.json,settings/bg-targets.json,settings/bg_targets.json,settings/bg_targets_raw.json,settings/insulin-sensitivities-raw.json,settings/insulin-sensitivities.json,settings/insulin_sensitivities.json,settings/model.json,settings/profile.json,settings/selected-basal-profile.json,settings/settings.json}
                             [{enact/enacted.json,enact/suggested.json,last_four_pump_hours.json,model.json,monitor/battery.json,monitor/clock-zoned.json,monitor/clock.json,monitor/glucose-zoned.json,monitor/glucose.json,monitor/glucoseclean.json,monitor/iob.json,monitor/pump-history.json,monitor/pumphistory.json,monitor/reservoir.json,monitor/status.json,monitor/temp-basal-status.json,monitor/temp_basal.json,nightscout/openaps-status.json,nightscout/preflight.json,nightscout/recent-missing-entries.json,nightscout/recent-treatments.json,nightscout/uploaded-entries.json,nightscout/uploaded.json,oref0-enacted/enacted-temp-basal.json,oref0-predict/oref0.json,raw-pump/battery.json,raw-pump/bg-targets-raw.json,raw-pump/bg-targets.json,raw-pump/clock-raw.json,raw-pump/insulin-sensitivities-raw.json,raw-pump/mm-glucose.json,raw-pump/ns-glucose.json,raw-pump/pump-history-raw.json,raw-pump/pump-history.json,raw-pump/reservoir.json,raw-pump/selected-basal-profile.json,raw-pump/settings.json,raw-pump/status.json,raw-pump/temp-basal-status.json,settings/basal-profile.json,settings/bg-targets.json,settings/bg_targets.json,settings/bg_targets_raw.json,settings/insulin-sensitivities-raw.json,settings/insulin-sensitivities.json,settings/insulin_sensitivities.json,settings/model.json,settings/profile.json,settings/selected-basal-profile.json,settings/settings.json} ...]
openaps-report invoke: error: argument report: invalid choice: 'oref0-monitor/profile.json' (choose from u'enact/enacted.json', u'enact/suggested.json', u'last_four_pump_hours.json', u'model.json', u'monitor/battery.json', u'monitor/clock-zoned.json', u'monitor/clock.json', u'monitor/glucose-zoned.json', u'monitor/glucose.json', u'monitor/glucoseclean.json', u'monitor/iob.json', u'monitor/pump-history.json', u'monitor/pumphistory.json', u'monitor/reservoir.json', u'monitor/status.json', u'monitor/temp-basal-status.json', u'monitor/temp_basal.json', u'nightscout/openaps-status.json', u'nightscout/preflight.json', u'nightscout/recent-missing-entries.json', u'nightscout/recent-treatments.json', u'nightscout/uploaded-entries.json', u'nightscout/uploaded.json', u'oref0-enacted/enacted-temp-basal.json', u'oref0-predict/oref0.json', u'raw-pump/battery.json', u'raw-pump/bg-targets-raw.json', u'raw-pump/bg-targets.json', u'raw-pump/clock-raw.json', u'raw-pump/insulin-sensitivities-raw.json', u'raw-pump/mm-glucose.json', u'raw-pump/ns-glucose.json', u'raw-pump/pump-history-raw.json', u'raw-pump/pump-history.json', u'raw-pump/reservoir.json', u'raw-pump/selected-basal-profile.json', u'raw-pump/settings.json', u'raw-pump/status.json', u'raw-pump/temp-bas
Ben West
@bewest
Jul 31 2016 21:20
oh, hmm
John Dodds
@johners97
Jul 31 2016 21:20
i checked alias show do-oref0 is there,
maybe i made an error entering it in so it might not be loading
or
Ben West
@bewest
Jul 31 2016 21:21
oref0 template mint reports oref0-inputs | openaps import
John Dodds
@johners97
Jul 31 2016 21:22
pi@john:~/my_openaps $ oref0 template mint reports oref0-inputs | openaps import
get-profile://text/shell/oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json
determine-basal://text/shell/oref0-predict/oref0.json
Ben West
@bewest
Jul 31 2016 21:22
openaps do-oref0
John Dodds
@johners97
Jul 31 2016 21:22
What does that do oref0 template...
ok
Ben West
@bewest
Jul 31 2016 21:23
it generates a bunch of configuration from a template for common tasks
John Dodds
@johners97
Jul 31 2016 21:23
pi@john:~/my_openaps $ openaps do-oref0
get-profile://text/shell/oref0-monitor/profile.json
oref0-monitor/profile.json  raised  'Namespace' object has no attribute 'preferences'
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 40, in main
    output = task.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/process.py", line 91, in main
    params = self.get_params(args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/process.py", line 48, in get_params
    params[opt] = getattr(args, opt)
AttributeError: 'Namespace' object has no attribute 'preferences'
dayum
Ben West
@bewest
Jul 31 2016 21:23
heh
no problem
oref0 template mint device oref0 | openaps import
John Dodds
@johners97
Jul 31 2016 21:24
pi@john:~/my_openaps $ oref0 template mint device oref0 | openaps import
process://oref0/oref0/
process://detect-sensitivity/oref0/detect-sensitivity
process://get-profile/oref0/get-profile
process://calculate-iob/oref0/calculate-iob
process://determine-basal/oref0/determine-basal
Ben West
@bewest
Jul 31 2016 21:24
openaps do-oref0
John Dodds
@johners97
Jul 31 2016 21:24
`openaps do ... ok
pi@john:~/my_openaps $ openaps do-oref0
get-profile://text/shell/oref0-monitor/profile.json

module.js:340
    throw err;
          ^
Error: Cannot find module '/home/pi/my_openaps/max-iob.json'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/oref0/bin/oref0-get-profile.js:112:23)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
reporting oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json

module.js:340
    throw err;
          ^
Error: Cannot find module '/home/pi/my_openaps/monitor/pump-history.json'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/oref0/bin/oref0-calculate-iob.js:42:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
reporting oref0-monitor/iob.json
determine-basal://text/shell/oref0-predict/oref0.json
Could not parse input data:  { [Error: Cannot find module '/home/pi/my_openaps/monitor/temp-basal-status.json'] code: 'MODULE_NOT_FOUND' }
reporting oref0-predict/oref0.json
hahaha
could not parse. something i typed in is wrong?
Ben West
@bewest
Jul 31 2016 21:26
I see what happened, sort of
one thing at a time
you have a ls max*.json
it's called max-iob.json in my versions and max_iob.json in others
sometimes it's called preferences.json
John Dodds
@johners97
Jul 31 2016 21:27
yeah, i see what you mean
so i've been inconsistent when using it?
Ben West
@bewest
Jul 31 2016 21:27
hmm, well there's some inconsistencies that exist in general, these templates are intended to make things a bit more standardized
John Dodds
@johners97
Jul 31 2016 21:27
well hopefully i get my loop back on tonight, blood sugars have been a bit dodgy with it off
yeah
ok
Ben West
@bewest
Jul 31 2016 21:28
which do you have currently?
max_iob.json?
mv max_iob.json max-iob.json
John Dodds
@johners97
Jul 31 2016 21:28
preferences?
Ben West
@bewest
Jul 31 2016 21:29
hmm cat preferences.json
cat max_iob.json
ls should give some hints
John Dodds
@johners97
Jul 31 2016 21:29
pi@john:~/my_openaps $ cat preferences.json
{"max_iob": 10}
Ben West
@bewest
Jul 31 2016 21:29
ok
mv preferences.json max-iob.json
or cp preferences.json max-iob.json
either one
John Dodds
@johners97
Jul 31 2016 21:30
ok
deleted the file
Ben West
@bewest
Jul 31 2016 21:31
deleted?
John Dodds
@johners97
Jul 31 2016 21:31
pi@john:~/my_openaps $ mv preferences.json max-iob.json
pi@john:~/my_openaps $ cp preferences.json max-iob.json
cp: cannot stat ‘preferences.json’: No such file or directory
pi@john:~/my_openaps $ cat preferences.json
cat: preferences.json: No such file or directory
pi@john:~/my_openaps $
Ben West
@bewest
Jul 31 2016 21:31
oh, ok, that's fine
openaps do-oref0
it will at least complain about stale data again
John Dodds
@johners97
Jul 31 2016 21:32
pi@john:~/my_openaps $ openaps do-oref0
get-profile://text/shell/oref0-monitor/profile.json
Could not sort temptargets_data.  Optional feature temporary targets disabled.
reporting oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json

module.js:340
    throw err;
          ^
Error: Cannot find module '/home/pi/my_openaps/monitor/pump-history.json'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/oref0/bin/oref0-calculate-iob.js:42:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
reporting oref0-monitor/iob.json
determine-basal://text/shell/oref0-predict/oref0.json
Could not parse input data:  { [Error: Cannot find module '/home/pi/my_openaps/monitor/glucose.json'] code: 'MODULE_NOT_FOUND' }
reporting oref0-predict/oref0.json
Ben West
@bewest
Jul 31 2016 21:33
ok, great
John Dodds
@johners97
Jul 31 2016 21:33
yay?
Ben West
@bewest
Jul 31 2016 21:33
openaps gather-clean-data && openaps do-oref0
John Dodds
@johners97
Jul 31 2016 21:35
pi@john:~/my_openaps $ openaps gather-clean-data && openaps do-oref0
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
reporting raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
reporting settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
reporting raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
reporting settings/insulin-sensitivities.json
insulin_pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
reporting raw-pump/selected-basal-profile.json
insulin_pump://JSON/read_settings/raw-pump/settings.json
reporting raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
reporting settings/selected-basal-profile.json
oref0://JSON/shell/settings/settings.json
reporting settings/settings.json
get-profile://text/shell/oref0-monitor/profile.json
Could not sort temptargets_data.  Optional feature temporary targets disabled.
reporting oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json

module.js:340
    throw err;
          ^
Error: Cannot find module '/home/pi/my_openaps/monitor/clock.json'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/oref0/bin/oref0-calculate-iob.js:44:20)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
reporting oref0-monitor/iob.json
determine-basal://text/shell/oref0-predict/oref0.json
Could not parse input data:  [SyntaxError: /home/pi/my_openaps/oref0-monitor/iob.json: Unexpected end of input]
reporting oref0-predict/oref0.json
Ben West
@bewest
Jul 31 2016 21:35
good
ok
openaps warmup && openaps gather-clean-data && openaps do-oref0
John Dodds
@johners97
Jul 31 2016 21:38
pi@john:~/my_openaps $ openaps warmup && openaps gather-clean-data && openaps do-oref0
insulin_pump://JSON/model/model.json
reporting model.json
insulin_pump://JSON/read_clock/raw-pump/clock-raw.json
reporting raw-pump/clock-raw.json
tz://JSON/clock/monitor/clock.json
reporting monitor/clock.json
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
reporting raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
reporting settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
reporting raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
reporting settings/insulin-sensitivities.json
insulin_pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
reporting raw-pump/selected-basal-profile.json
insulin_pump://JSON/read_settings/raw-pump/settings.json
reporting raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
reporting settings/selected-basal-profile.json
oref0://JSON/shell/settings/settings.json
reporting settings/settings.json
get-profile://text/shell/oref0-monitor/profile.json
Could not sort temptargets_data.  Optional feature temporary targets disabled.
reporting oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json
reporting oref0-monitor/iob.json
determine-basal://text/shell/oref0-predict/oref0.json
Avgdelta lookback -53 minutes
Two data point lookback 0 minutes
BG data is too old, or clock set incorrectly.  Your CGM time is Sun Jul 31 2016 21:24:00 GMT+0100 (BST) but your system time is Sun Jul 31 2016 22:37:55 GMT+0100 (BST)
reporting oref0-predict/oref0.json
Ben West
@bewest
Jul 31 2016 21:39
cat monitor/clock.json
date -Iseconds
John Dodds
@johners97
Jul 31 2016 21:40
pi@john:~/my_openaps $ cat monitor/clock.json
"2016-07-31T22:37:12+01:00"
Ben West
@bewest
Jul 31 2016 21:40
hmm
John Dodds
@johners97
Jul 31 2016 21:40
pi@john:~/my_openaps $ date -Iseconds
2016-07-31T22:40:31+0100
Ben West
@bewest
Jul 31 2016 21:42
cat monitor/glucose.json | json -a dateString date glucose | head -n 3
John Dodds
@johners97
Jul 31 2016 21:43
pi@john:~/my_openaps $ cat monitor/glucose.json | json -a dateString date glucose | head -n 3
cat: monitor/glucose.json: No such file or directory
Ben West
@bewest
Jul 31 2016 21:44
ah, ok, you've got cron running at the same time and have it configured to delete stuff
John Dodds
@johners97
Jul 31 2016 21:44
ahhh
yes i do
Ben West
@bewest
Jul 31 2016 21:44
all that rm stuff in the aliases makes it very difficult to debug, I find
John Dodds
@johners97
Jul 31 2016 21:44
yeah
Ben West
@bewest
Jul 31 2016 21:45
maybe disable the cron temporarily
or modify the alias so it doesn't delete
John Dodds
@johners97
Jul 31 2016 21:45
ok
Ben West
@bewest
Jul 31 2016 21:45
probably easier to just comment out in crontab -e, put a # before the line with the job specification will comment it out
John Dodds
@johners97
Jul 31 2016 21:46
right cron is disabled
Ben West
@bewest
Jul 31 2016 21:46
openaps warmup && openaps gather-clean-data && openaps do-oref0
will probably complain that bg data is old, which is odd because it looks like it is pulling in fresh data
so if it gives same error, we want to look at the dates and times actually in the file and figure out what's happening
it looks like the clock on the pump is matching the system clock, so if there are new glucose readings being picked up by the cgm, we should be getting them
only way to verify is dig in and look at the data
that cat ... | json thing simplifies the output to just show those fields, separated by spaces
John Dodds
@johners97
Jul 31 2016 21:48
pi@john:~/my_openaps $ openaps warmup && openaps gather-clean-data && openaps do-oref0
insulin_pump://JSON/model/model.json
reporting model.json
insulin_pump://JSON/read_clock/raw-pump/clock-raw.json
reporting raw-pump/clock-raw.json
tz://JSON/clock/monitor/clock.json
reporting monitor/clock.json
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
reporting raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
reporting settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
reporting raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
reporting settings/insulin-sensitivities.json
insulin_pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
reporting raw-pump/selected-basal-profile.json
insulin_pump://JSON/read_settings/raw-pump/settings.json
reporting raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
reporting settings/selected-basal-profile.json
oref0://JSON/shell/settings/settings.json
reporting settings/settings.json
get-profile://text/shell/oref0-monitor/profile.json
Could not sort temptargets_data.  Optional feature temporary targets disabled.
reporting oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json
reporting oref0-monitor/iob.json
determine-basal://text/shell/oref0-predict/oref0.json
Avgdelta lookback -63 minutes
Two data point lookback 0 minutes
BG data is too old, or clock set incorrectly.  Your CGM time is Sun Jul 31 2016 21:24:00 GMT+0100 (BST) but your system time is Sun Jul 31 2016 22:48:03 GMT+0100 (BST)
reporting oref0-predict/oref0.json
Ben West
@bewest
Jul 31 2016 21:49
this is saying data is 60 minutes old
openaps report show --cli oref0-predict/oref0.json
where's that cat/json
cat monitor/glucose.json | json -a dateString date glucose | head -n 3
John Dodds
@johners97
Jul 31 2016 21:50
pi@john:~/my_openaps $ cat monitor/glucose.json | json -a dateString date glucose | head -n 3
2016-07-31T21:24:00+01:00 1469996640000
2016-07-31T21:24:00+01:00 1469996640000
2016-07-31T22:47:00+01:00 1470001620000
pi@john:~/my_openaps $ openaps report show --cli oref0-predict/oref0.json
openaps use determine-basal shell oref0-monitor/iob.json monitor/temp-basal-status.json monitor/glucose.json oref0-monitor/profile.json
Ben West
@bewest
Jul 31 2016 21:52
yeah, so for some reason...
the monitor/glucose.json is clearly old, the data that is there
is the cgm actually generating new data for last few minutes?
are you using carelink usb stick or something else?
John Dodds
@johners97
Jul 31 2016 21:53
yeah its generating recent data
carelink usb
Ben West
@bewest
Jul 31 2016 21:54
mm-send-comm.py --init --serial 123456 tweak WriteGlucoseHistoryTimestamp
replace 123456 with your serial number
hmmm
intersting
cat monitor/glucose.json | json -a dateString date glucose | tail -n 3
let's try this:
json -f monitor/glucose.json -A -e "this.reverse( )" > tmp-glucose.json
John Dodds
@johners97
Jul 31 2016 21:56
pi@john:~/my_openaps $ mm-send-comm.py --init --serial 346141 tweak WriteGlucoseHistoryTimestamp
## do stuff with an insulin pump over RF
using ` Namespace(autoinit=False, begin=None, bytesPerRecord=None, command='tweak', descr=None, dryrun=False, effectTime=None, end=None, init=True, maxRecords=None, name=None, no_postlude=False, no_prelude=False, no_rf_prelude=False, other='WriteGlucoseHistoryTimestamp', page=None, params=None, port='scan', postfix=None, prefix=None, prefix_path='', save=False, saveall=False, serial='346141', session_life=10, verbose=None) `
```
```
```javascript
{'radio': {'errors.crc': 0,
           'errors.naks': 0,
           'errors.sequence': 0,
           'errors.timeouts': 14,
           'packets.received': 1229L,
           'packets.transmit': 1326L},
 'usb': {'errors.crc': 0,
         'errors.naks': 0,
         'errors.sequence': 0,
         'errors.timeouts': 0,
         'packets.received': 3616L,
         'packets.transmit': 3616L}}

PUMP MODEL: ReadPumpModel:size[64]:data:'754'

<class 'decocare.commands.WriteGlucoseHistoryTimestamp'> {}
CRITICAL:decocare.session:this seems like a problem
response: WriteGlucoseHistoryTimestamp:size[64]:data:bytearray(b'\x00\x00')
hexdump:
0000   0x00 0x00                                  ..

decoded:

bytearray(b'\x00\x00')

end stats

```
```javascript
{'radio': {'errors.crc': 0,
           'errors.naks': 0,
           'errors.sequence': 0,
           'errors.timeouts': 14,
           'packets.received': 1234L,
           'packets.transmit': 1331L},
 'usb': {'errors.crc': 0,
         'errors.naks': 0,
         'errors.sequence': 0,
         'errors.timeouts': 0,
         'packets.received': 3630L,
         'packets.transmit': 3630L}}
Ben West
@bewest
Jul 31 2016 21:57
openaps use determine-basal shell oref0-monitor/iob.json monitor/temp-basal-status.json tmp-glucose.json oref0-monitor/profile.json
John Dodds
@johners97
Jul 31 2016 21:59
pi@john:~/my_openaps $  cat monitor/glucose.json | json -a dateString date glucose | tail -n 3
2016-07-31T03:09:00+01:00 1469930940000 0
2016-07-31T03:04:00+01:00 1469930640000 138
2016-07-31T02:59:00+01:00 1469930340000 136
Ben West
@bewest
Jul 31 2016 21:59
oh
hmm
there goes that theory
Eric Jensen
@elnjensen
Jul 31 2016 21:59
I need to repair some chips and cracks in my 523 pump - any suggestions? In particular, there is a chip missing from the rim of the battery area (so it is open through to the threads on the battery cap) and part of the rest of that rim is cracked, so I'm worried it will fail entirely if I don't do something to reinforce it. I was thinking of filling in the missing area with Sugru (with some light grease on the battery cap threads underneath so it doesn't bond there) and then maybe tape over the top of everything after that sets. Any thoughts?
John Dodds
@johners97
Jul 31 2016 22:00
damn
Is there anything i can do
Ben West
@bewest
Jul 31 2016 22:00
sugru sounds tempting, but I bet if you team up with a dentist or a jeweler you might be able to get better results
dentists are good at sealing things, it turns out
John Dodds
@johners97
Jul 31 2016 22:01
yeah they are ^
Ben West
@bewest
Jul 31 2016 22:01
lots of tools/materials to work with
similar for jewelers, they have lots of specialized tools/techniques for fastening things
John Dodds
@johners97
Jul 31 2016 22:01
@bewest Do you think its anything to do with tz? or
Ben West
@bewest
Jul 31 2016 22:01
no
it has to do with the data coming back from the pump
John Dodds
@johners97
Jul 31 2016 22:02
reset usb?
take it out and put it back in again?
Ben West
@bewest
Jul 31 2016 22:02
no, it's not the usb it has to do with the actual data coming back from the pump itself
the data just looks old, and when we ask for newer data we don't seem to be getting it
there's an issue like this
hmm bewest/decoding-carelink#173 maybe
that Write command put a new date in the log
let's try the whole thing again and see what shakes out
openaps gather-clean-data
run the cat/json/head thing again
John Dodds
@johners97
Jul 31 2016 22:05

openaps report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json nightscout/recent-missing-entries.json nightscout/uploaded-entries.json
I tried this and it successfully updated, although thats probs irrelevant
Ben West
@bewest
Jul 31 2016 22:05
that's recent
hmm
ok, some kind of issue with determine-basal, then, need to archive your monitor/glucose.json
just to confirm
do the cat/json/head one onagain
cat monitor/glucose.json | json -a dateString date glucose | head -n 3
John Dodds
@johners97
Jul 31 2016 22:06
pi@john:~/my_openaps $ openaps gather-clean-data
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
reporting raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
reporting settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
reporting raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
reporting settings/insulin-sensitivities.json
insulin_pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
reporting raw-pump/selected-basal-profile.json
insulin_pump://JSON/read_settings/raw-pump/settings.json
reporting raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
reporting settings/selected-basal-profile.json
oref0://JSON/shell/settings/settings.json
reporting settings/settings.json
pi@john:~/my_openaps $ cat monitor/glucose.json | json -a dateString date glucose | head -n 3
2016-07-31T23:08:00+01:00 1470002880000
2016-07-31T23:03:00+01:00 1470002580000 86
2016-07-31T22:58:00+01:00 1470002280000 88
jeeez
Ben West
@bewest
Jul 31 2016 22:07
openaps do-oref0
John Dodds
@johners97
Jul 31 2016 22:08
pi@john:~/my_openaps $ openaps do-oref0
get-profile://text/shell/oref0-monitor/profile.json
Could not sort temptargets_data.  Optional feature temporary targets disabled.
reporting oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json
reporting oref0-monitor/iob.json
determine-basal://text/shell/oref0-predict/oref0.json
Avgdelta lookback 10 minutes
Two data point lookback 10 minutes
{"iob":-0.202,"activity":-0.0052,"bolussnooze":0,"basaliob":-0.202,"netbasalinsulin":-0.6,"hightempinsulin":0,"time":"2016-07-31T21:47:05.000Z"}
{"delta":null,"avgdelta":null,"twodelta":null}
{"duration":0,"rate":0.1,"temp":"absolute"}
{"max_iob":10,"type":"current","max_daily_safety_multiplier":3,"current_basal_safety_multiplier":4,"autosens_max":1.5,"autosens_min":0.7,"autosens_adjust_targets":true,"override_high_target_with_low":false,"dia":3,"model":{},"current_basal":1.3,"max_daily_basal":1.4,"max_basal":35,"out_units":"mmol/L","min_bg":81,"max_bg":117,"sens":21.599999999999998}
Adjusting sens from 21.599999999999998 to 21.6
Error: could not calculate eventualBG
reporting oref0-predict/oref0.json
Ben West
@bewest
Jul 31 2016 22:09
it has to do with the non-glucose records in there
John Dodds
@johners97
Jul 31 2016 22:09
i kinda thought that
Ben West
@bewest
Jul 31 2016 22:10
it should really only look at the fields/types of objects it's told to look at, and ignore the other stuff
John Dodds
@johners97
Jul 31 2016 22:10
is it because of something i have done?
Ben West
@bewest
Jul 31 2016 22:10
no
John Dodds
@johners97
Jul 31 2016 22:10
hopefully we can fix it
Ben West
@bewest
Jul 31 2016 22:11
hmm
this is a little funny
let's try this:
Chris Oattes
@cjo20
Jul 31 2016 22:11
can you put your openaps.ini here: http://pastebin.com/
Ben West
@bewest
Jul 31 2016 22:12
if possible, the monitor/glucose.json file as well
^ openaps.ini
Chris Oattes
@cjo20
Jul 31 2016 22:17
The glucose data still isn't going through glucosetools
Ben West
@bewest
Jul 31 2016 22:17
that's true, is that what makes it ok for oref0?
John Dodds
@johners97
Jul 31 2016 22:18
ok
i thought i already added glucosetools
a few days ago
Chris Oattes
@cjo20
Jul 31 2016 22:19
you may have done, but your current flow of data doesn't go through it
Ben West
@bewest
Jul 31 2016 22:19
openaps use glucose clean monitor/glucose.json
you did before, but we took it out somewhere in the process of doing other stuff
John Dodds
@johners97
Jul 31 2016 22:20
ok a whole load of stuff came from that
listing everything
from earlier today
Ben West
@bewest
Jul 31 2016 22:20
ok let's try that
John Dodds
@johners97
Jul 31 2016 22:20
ok
Ben West
@bewest
Jul 31 2016 22:20
openaps report add oref0-monitor/glucose.json JSON glucose clean monitor/glucose.json
John Dodds
@johners97
Jul 31 2016 22:21
added
Ben West
@bewest
Jul 31 2016 22:21
now we adjust some alias again
John Dodds
@johners97
Jul 31 2016 22:21
pi@john:~/my_openaps $ openaps report add oref0-monitor/glucose.json JSON glucoe clean monitor/glucose.json
added glucose://JSON/clean/oref0-monitor/glucose.json
pi@john:~/my_openaps $ openaps alias show
rm-warmup ! bash -c "rm -f model.json monitor/clock.json > /dev/null"
warmup report invoke model.json raw-pump/clock-raw.json monitor/clock.json
fail-warmup ! bash -c "echo PREFLIGHT FAIL; exit 1"
preflight ! bash -c "rm -f monitor/clock.json && openaps report invoke monitor/clock.json 2>/dev/null && grep -q T monitor/clock.json && echo PREFLIGHT OK || (mm-stick warmup || sudo oref0-reset-usb; echo PREFLIGHT FAIL; sleep 120; exit 1)"
monitor-cgm report invoke raw-pump/mm-glucose.json raw-pump/ns-glucose.json monitor/glucose.json
monitor-pump-history report invoke raw-pump/pump-history.json monitor/pump-history.json
get-basal-status report invoke monitor/temp-basal-status.json
get-pump-details report invoke monitor/reservoir.json monitor/status.json monitor/battery.json
get-settings report invoke raw-pump/bg-targets-raw.json settings/bg-targets.json raw-pump/insulin-sensitivities-raw.json settings/insulin-sensitivities.json raw-pump/selected-basal-profile.json raw-pump/settings.json settings/selected-basal-profile.json settings/settings.json
gather-pump-data ! bash -c "openaps get-basal-status; openaps get-pump-details; openaps monitor-pump-history;  openaps get-settings"
gather-clean-data ! bash -c "openaps monitor-cgm && openaps gather-pump-data"
do-oref0 report invoke oref0-monitor/profile.json oref0-monitor/iob.json oref0-predict/oref0.json
enact-oref0 report invoke oref0-enacted/enacted-temp-basal.json
do-everything ! bash -c "(openaps preflight && openaps gather-clean-data && openaps do-oref0 && openaps enact-oref0);  openaps report-nightscout"
ping ! bash -c "echo PONG! $*" --
pong ! echo PONG
hello ! echo hello
okbar ! bash -c "echo $1" --
report-nightscout report invoke monitor/clock-zoned.json nightscout/preflight.json monitor/glucoseclean.json nightscout/uploaded.json  nightscout/uploaded-entries.json
gather ! bash -c "rm -f monitor/*; openaps get-profile && openaps monitor-cgm && openaps monitor-pump && openaps report invoke monitor/iob.json"
get-profile report invoke settings/settings.json settings/bg_targets_raw.json settings/bg-targets.json settings/insulin-sensitivities-raw.json settings/insulin-sensitivities.json settings/basal-profile.json settings/profile.json
monitor-pump report invoke monitor/clock.json monitor/temp_basal.json monitor/pumphistory.json monitor/iob.json
loop ! bash -c "( openaps preflight && openaps gather && openaps enact) || echo LOOP FAILED."
determine-basal report invoke enact/suggested.json
enact report invoke enact/suggested.json enact/enacted.json
retry-loop ! bash -c "openaps preflight && until( ! mm-stick warmup || openaps loop); do sleep 5; done"
backdate use ns shell get entries/sgv.json count=300 | openaps use tz lsgaps --date dateString --minutes 6 --before yesterday --after now - | openaps use tz select --current now --date dateString --gaps - monitor/glucose.json | openaps use ns shell upload entries.json -
Ben West
@bewest
Jul 31 2016 22:23
openaps report show --cli oref0-predict/oref0.json
John Dodds
@johners97
Jul 31 2016 22:23
pi@john:~/my_openaps $ openaps report show --cli oref0-predict/oref0.json
openaps use determine-basal shell oref0-monitor/iob.json monitor/temp-basal-status.json monitor/glucose.json oref0-monitor/profile.json
Ben West
@bewest
Jul 31 2016 22:24
openaps report add oref0-predict/oref0.json JSON determine-basal shell oref0-monitor/iob.json monitor/temp-basal-status.json oref0-monitor/glucose.json oref0-monitor/profile.json
points determine-basal at the "newer" report
John Dodds
@johners97
Jul 31 2016 22:25
pi@john:~/my_openaps $ openaps report add oref0-predict/oref0.json JSON determie-basal shell oref0-monitor/iob.json monitor/temp-basal-status.json oref0-monitor/glucose.json oref0-monitor/profile.json
added determine-basal://JSON/shell/oref0-predict/oref0.json
Ben West
@bewest
Jul 31 2016 22:25
ok, now finally for the alias:
openaps alias add do-oref0 "report invoke oref0-monitor/glucose.json oref0-monitor/profile.json oref0-monitor/iob.json oref0-predict/oref0.json"
now to kick the tires a bit
John Dodds
@johners97
Jul 31 2016 22:26
pi@john:~/my_openaps $ openaps alias add do-oref0 "report invoke oref0-monitor/glucose.json oref0-monitor/profile.json oref0-monitor/iob.json oref0-predict/oref0.json"
added do-oref0 report invoke oref0-monitor/glucose.json oref0-monitor/profile.json oref0-monitor/iob.json oref0-predict/oref0.json
Ben West
@bewest
Jul 31 2016 22:26
openaps warmup && openaps gather-clean-data && openaps do-oref0
John Dodds
@johners97
Jul 31 2016 22:28
pi@john:~/my_openaps $ openaps warmup && openaps gather-clean-data && openaps do-oref0
insulin_pump://JSON/model/model.json
reporting model.json
insulin_pump://JSON/read_clock/raw-pump/clock-raw.json
reporting raw-pump/clock-raw.json
tz://JSON/clock/monitor/clock.json
reporting monitor/clock.json
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
reporting raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
reporting settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
reporting raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
reporting settings/insulin-sensitivities.json
insulin_pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
reporting raw-pump/selected-basal-profile.json
insulin_pump://JSON/read_settings/raw-pump/settings.json
reporting raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
reporting settings/selected-basal-profile.json
oref0://JSON/shell/settings/settings.json
reporting settings/settings.json
glucose://JSON/clean/oref0-monitor/glucose.json
reporting oref0-monitor/glucose.json
get-profile://text/shell/oref0-monitor/profile.json
Could not sort temptargets_data.  Optional feature temporary targets disabled.
reporting oref0-monitor/profile.json
calculate-iob://text/shell/oref0-monitor/iob.json
reporting oref0-monitor/iob.json
determine-basal://JSON/shell/oref0-predict/oref0.json
Avgdelta lookback NaN minutes
Two data point lookback NaN minutes

/usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js:145
        bgTime = new Date(glucose_data[0].display_time.replace('T', ' '));
                                                       ^
TypeError: Object 1470003780000 has no method 'replace'
    at Object.<anonymous> (/usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js:145:56)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
No JSON object could be decoded

Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cl
reporting oref0-monitor/iob.json
determine-basal://JSON/shell/oref0-predict/oref0.json
Avgdelta lookback NaN minutes
Two data point lookback NaN minutes

/usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js:145
        bgTime = new Date(glucose_data[0].display_time.replace('T', ' '));
                                                       ^
TypeError: Object 1470003780000 has no method 'replace'
    at Object.<anonymous> (/usr/local/lib/node_modules/oref0/bin/oref0-determine-basal.js:145:56)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
No JSON object could be decoded
dammmmn
Ben West
@bewest
Jul 31 2016 22:30
what's in the file?
John Dodds
@johners97
Jul 31 2016 22:30
moniyot/iob?
Ben West
@bewest
Jul 31 2016 22:30
it'd be helpful to put your monitor/glucose.json and oref0-monitor/glucose.json in a gist or pastebin
the issue here remains with the glucose data
John Dodds
@johners97
Jul 31 2016 22:31
ok theres so many entries it doesn't display it all in the shell, can i get say the most recent 40 entries for each
Ben West
@bewest
Jul 31 2016 22:32
sure
are you on mac?
John Dodds
@johners97
Jul 31 2016 22:32
windows
on PuTTy
Ben West
@bewest
Jul 31 2016 22:32
ah, there's a tool that can be used to copy files over
scp, putty has a helper for it
Chris Oattes
@cjo20
Jul 31 2016 22:33
@bewest swap the order of clean and zoning
Ben West
@bewest
Jul 31 2016 22:33
oh?
hmm
ok
Chris Oattes
@cjo20
Jul 31 2016 22:34
and change the date parameter in the zoning to display_time
Ben West
@bewest
Jul 31 2016 22:34
openaps report add raw-pump/cleaned-glucose.json JSON glucose clean raw-pump/ns-glucose.json ?
Chris Oattes
@cjo20
Jul 31 2016 22:35
I don't use mm-format-glucose
Ben West
@bewest
Jul 31 2016 22:35
oh ok
John Dodds
@johners97
Jul 31 2016 22:35
? Having difficulty sending files over so im gonna cat it
Ben West
@bewest
Jul 31 2016 22:36
hold off on that, @johners97, @cjo20 gave us a clue
openaps report add raw-pump/cleaned-glucose.json JSON glucose clean raw-pump/mm-glucose.json then
Chris Oattes
@cjo20
Jul 31 2016 22:37
openaps warmup; openaps gather-clean-data; openaps use insulin_pump iter_glucose 288 > raw-pump/mm-glucose; openaps use glucose clean monitor/glucose.json > raw-pump/mm-glucose-cleaned.json; openaps use tz rezone --date display_time --timezone "BST" raw-pump/mm-glucose-cleaned.json > monitor/glucose.json;
Then call determine-basal with monitor/glucose.json
John Dodds
@johners97
Jul 31 2016 22:39
semi-colon marks?
Chris Oattes
@cjo20
Jul 31 2016 22:39
adding more reports right now probably isn't helpful
Yes John
openaps warmup; openaps gather-clean-data; openaps use insulin_pump iter_glucose 288 > raw-pump/mm-glucose.json; openaps use glucose clean raw-pump/mm-glucose.json > raw-pump/mm-glucose-cleaned.json; openaps use tz rezone --date display_time --timezone "BST" raw-pump/mm-glucose-cleaned.json > monitor/glucose.json;
Try that instead
Ben West
@bewest
Jul 31 2016 22:40
yeah, just need to see one example work right
John Dodds
@johners97
Jul 31 2016 22:42
pi@john:~/my_openaps $ openaps warmup; openaps gather-clean-data; openaps use insulin_pump iter_glucose 288 > raw-pump/mm-glucose.json; openaps use glucose clean raw-pump/mm-glucose.json > raw-pump/mm-glucose-cleaned.json; openaps use tz rezone --date display_time --timezone "BST" raw-pump/mm-glucose-cleaned.json > monitor/glucose.json;
insulin_pump://JSON/model/model.json
reporting model.json
insulin_pump://JSON/read_clock/raw-pump/clock-raw.json
reporting raw-pump/clock-raw.json
tz://JSON/clock/monitor/clock.json
reporting monitor/clock.json
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
reporting raw-pump/mm-glucose.json
mm-glucose-format://JSON/shell/raw-pump/ns-glucose.json
reporting raw-pump/ns-glucose.json
tz://JSON/rezone/monitor/glucose.json
reporting monitor/glucose.json
insulin_pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
insulin_pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
insulin_pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
insulin_pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
insulin_pump://JSON/iter_pump_hours/raw-pump/pump-history.json
reporting raw-pump/pump-history.json
tz://JSON/rezone/monitor/pump-history.json
reporting monitor/pump-history.json
insulin_pump://JSON/read_bg_targets/raw-pump/bg-targets-raw.json
reporting raw-pump/bg-targets-raw.json
units://JSON/bg_targets/settings/bg-targets.json
reporting settings/bg-targets.json
insulin_pump://JSON/read_insulin_sensitivities/raw-pump/insulin-sensitivities-raw.json
reporting raw-pump/insulin-sensitivities-raw.json
units://JSON/insulin_sensitivities/settings/insulin-sensitivities.json
reporting settings/insulin-sensitivities.json
insulin_pump://JSON/read_selected_basal_profile/raw-pump/selected-basal-profile.json
reporting raw-pump/selected-basal-profile.json
insulin_pump://JSON/read_settings/raw-pump/settings.json
reporting raw-pump/settings.json
oref0://JSON/shell/settings/selected-basal-profile.json
reporting settings/selected-basal-profile.json
oref0://JSON/shell/settings/settings.json
reporting settings/settings.json
Chris Oattes
@cjo20
Jul 31 2016 22:42
Then when that is done, openaps use determine-basal shell oref0-monitor/iob.json monitor/temp-basal-status.json monitor/glucose.json oref0-monitor/profile.json
preferably before the data gets out-of-date
John Dodds
@johners97
Jul 31 2016 22:45
pi@john:~/my_openaps $ openaps use determine-basal shell oref0-monitor/iob.json monitor/temp-basal-status.json monitor/glucose.json oref0-monitor/profile.json
Could not parse input data:  [SyntaxError: /home/pi/my_openaps/monitor/glucose.json: Unexpected end of input]
No JSON object could be decoded

Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 58, in run
    reporter(output)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 33, in __call__
    self.blob = self.serialize(data)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/reporters/__init__.py", line 31, in serialize
    return self.method.serialize(render(data), self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/process.py", line 56, in prerender_json
    return json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
i'll restart the long one with ?
*
>
Chris Oattes
@cjo20
Jul 31 2016 22:46
openaps use insulin_pump iter_glucose 288 > raw-pump/mm-glucose.json; openaps use glucose clean raw-pump/mm-glucose.json > raw-pump/mm-glucose-cleaned.json; openaps use tz rezone --date display_time --timezone "BST" raw-pump/mm-glucose-cleaned.json > monitor/glucose.json
followed by ls -lh raw-pump
John Dodds
@johners97
Jul 31 2016 22:48
pi@john:~/my_openaps $ ls -lh raw-pump
total 296K
-rw-r--r-- 1 pi pi  519 Jul 31 23:47 bg-targets-raw.json
-rw-r--r-- 1 pi pi   21 Jul 31 23:46 clock-raw.json
-rw-r--r-- 1 pi pi  540 Jul 31 23:47 insulin-sensitivities-raw.json
-rw-r--r-- 1 pi pi  53K Jul 31 23:40 mm-glucose
-rw-r--r-- 1 pi pi  47K Jul 31 23:48 mm-glucose-cleaned.json
-rw-r--r-- 1 pi pi  53K Jul 31 23:48 mm-glucose.json
-rw-r--r-- 1 pi pi  88K Jul 31 23:46 ns-glucose.json
-rw-r--r-- 1 pi pi 8.4K Jul 31 23:47 pump-history.json
-rw-r--r-- 1 pi pi  15K Jul 31 06:04 pump-history-raw.json
-rw-r--r-- 1 pi pi  623 Jul 31 23:47 selected-basal-profile.json
-rw-r--r-- 1 pi pi  598 Jul 31 23:47 settings.json
Chris Oattes
@cjo20
Jul 31 2016 22:48
ls -lh monitor
John Dodds
@johners97
Jul 31 2016 22:49
pi@john:~/my_openaps $ ls -lh monitor
total 80K
-rw-r--r-- 1 pi pi   43 Jul 31 23:47 battery.json
-rw-r--r-- 1 pi pi   27 Jul 31 23:46 clock.json
-rw-r--r-- 1 pi pi  48K Jul 31 23:48 glucose.json
-rw-r--r-- 1 pi pi 8.6K Jul 31 23:47 pump-history.json
-rw-r--r-- 1 pi pi    6 Jul 31 23:47 reservoir.json
-rw-r--r-- 1 pi pi   69 Jul 31 23:47 status.json
-rw-r--r-- 1 pi<