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

8th
Sep 2016
Eric Jensen
@elnjensen
Sep 08 2016 00:17
So I was on the verge of ordering a real-time clock (small battery-powered clock chip) for my Raspberry Pi, so that it could preserve time across reboots and wouldn't be out of sync with the pump and CGM time in the event that the Pi was booted without network access. But then it occurred to me that this is really unnecessary - we are all carrying around at least two battery-powered clocks with us at all times (pump and CGM). So it would be simple to set the Pi's clock from the pump's clock, in the event that the Pi gets behind. And there would still be the safety check of the pump/Pi and CGM times needing to be in sync with each other (which openaps wisely checks on). I've determined that it's easy to set the system clock from the pump (really just a few lines of code), but now I'm trying to think about the circumstances under which to invoke this - safety/sanity checks that I can wrap around it in a script. In my initial thinking, it strikes me that you would want the following conditions to be met:
Paul Martin
@Spazholio
Sep 08 2016 00:19
:thumbsup:
Eric Jensen
@elnjensen
Sep 08 2016 00:20
Ha! Let me take a look at that script.
Eric Jensen
@elnjensen
Sep 08 2016 00:25
Interesting approach - I like the first bit, where it checks on ntp. I had wondered how to do that.
I confess that I don't understand why the last seven lines of the script set the clock from the pump, and then set the clock from the CGM. Doesn't look like there's an exit/die if the first one is successful - just goes ahead with the second one.

The last part could be simplified quite a bit:

sudo date -s `json -f monitor/clock.json`

is enough to set the system clock from the pump, since date is quite flexible in reading different time formats.

But cool to see that there is a solution already in place.
lmaguire
@lmaguire
Sep 08 2016 01:01
@elnjensen How would I fix the problem of the reports being empty? I know that I do have them, but I'm not sure what to do. Also, I believe that I have the report because when I invoke (openaps report invoke settings/model.json) it outputs '723'
garykidd
@garykidd
Sep 08 2016 01:06
@Spazholio So, will take you up on your offer from last rfegarding switching input from receiver to NS. I tried just adding and invoking an ns get entries.sjon report, that I figure I need to "process" in order to convert that the oref0-monitor/glucose.json ?
^last night
Eric Jensen
@elnjensen
Sep 08 2016 01:12
@lmaguire OK, let's look at openaps report invoke nightscout/recent-treatments.json
Do you have that file? Is there anything in it?
And what do you get when you run openaps report show nightscout/recent-treatments.json --cli ?
lmaguire
@lmaguire
Sep 08 2016 01:15
When I invoke, I get: openaps report invoke nightscout/recent-treatments.json
ns://JSON/shell/nightscout/recent-treatments.json
json: error: could not read "model.json": Error: ENOENT, no such file or directory 'model.json'
reporting nightscout/recent-treatments.json
Eric Jensen
@elnjensen
Sep 08 2016 01:15
OK, run that last report show command I typed above.
lmaguire
@lmaguire
Sep 08 2016 01:16
Ok. Using the show, I get: openaps report show nightscout/recent-treatments.json
ns://JSON/shell/nightscout/recent-treatments.json
Eric Jensen
@elnjensen
Sep 08 2016 01:16
Put the --cli after it and run again.
That will show you what command(s) it actually runs to make the report.
lmaguire
@lmaguire
Sep 08 2016 01:17
Oh, okay. Makes sense! I get: openaps report show nightscout/recent-treatments.json --cli
openaps use ns shell format-recent-history-treatments monitor/pump-history.json model.json
Eric Jensen
@elnjensen
Sep 08 2016 01:18
Right! So it is looking for model.json (i.e. that file in your current directory) and you have settings/model.json output from your report.
So you either need to redefine your report for the format-recent-history-treatments or you need to redefine your report for model.json.
David
@davidkeddydb
Sep 08 2016 01:20

I am testing openaps do everything and getting an error regarding missing-entries json: 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 "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 744, in run_script
File "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 1499, 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 332, in includes
if self.prev <= when and when <= self.curr:
TypeError: can't compare offset-naive and offset-aware datetimes
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 "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 744, in run_script
File "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 1499, 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

garykidd
@garykidd
Sep 08 2016 01:20
@lmaguire you might've been following an already out of date rtd..because there was a fairly recent pull request relating to invoking that report in the guide...text was missing "setting"
David
@davidkeddydb
Sep 08 2016 01:21
Is this all because of a timezone issue with zones or am i missing something else?
Eric Jensen
@elnjensen
Sep 08 2016 01:21
@lmaguire If you've recently defined the nightscout/recent-treatments.json report, find the command definition and change model.json to settings/model.json.
garykidd
@garykidd
Sep 08 2016 01:21
@davidkeddydb do you have units device?
lmaguire
@lmaguire
Sep 08 2016 01:21
Thank you so much! I'll get right on that.
Eric Jensen
@elnjensen
Sep 08 2016 01:22
OK - off to work on my Edison setup but will check back in a bit.
garykidd
@garykidd
Sep 08 2016 01:22
@elnjensen have fun, Eric.
lmaguire
@lmaguire
Sep 08 2016 01:22
And @garykidd, is there a way to update the rtd?
garykidd
@garykidd
Sep 08 2016 01:24
I actually did already. just work form latest Master...do you know how to select that?
@davidkeddydb what does it show if you openaps device show
@lmaguire there should be a little drop down box in the lower right hand side of the rtd for you to select version.
I've learned recently that most changes on the docs are getting folded directly into Master..so I think its the most up-to-date.
lmaguire
@lmaguire
Sep 08 2016 01:27
Oh, okay perfect I see. Thank you! Just a quick question, if I'm using Nightscout and the OpenAPS plugin needs the dev version, would it mess up my Nightscout site if I now used the master version?
Heidi Pell
@HeidiRPell_twitter
Sep 08 2016 01:28
I have a couple questions about which medtronic pumps work for openAPS. Does anyone have a minute to answer?
garykidd
@garykidd
Sep 08 2016 01:28
I think for establishing your initial setup the Master docs are best. So I believe you do need dev version of openaps--but thats distinct from the dev doc template
David
@davidkeddydb
Sep 08 2016 01:30
@garykidd it shows: timezones://tz
dexcom://cgm
medtronic://pump
process://ns/nightscout/ns https://dkebs13.herokuapp.com b4659cb2244576de789c197449c17646b6f14404
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
units://units
lmaguire
@lmaguire
Sep 08 2016 01:31
Ok, I think I understand. I'm sorry, but would you mind giving me a brief walkthrough of how I should be changing it?
garykidd
@garykidd
Sep 08 2016 01:33
@lmaguire openaps --version
enter that^
Heidi Pell
@HeidiRPell_twitter
Sep 08 2016 01:37
Thanks, that link answered my question
garykidd
@garykidd
Sep 08 2016 01:37
@lmaguire slecting the master version of rtd wont change what version of openaps you have installed
@HeidiRPell_twitter NP.
lmaguire
@lmaguire
Sep 08 2016 01:39
Ok, my version is 0.1.5
garykidd
@garykidd
Sep 08 2016 01:41
not sure what features you want/need.... I have 0.1.6-dev
I think it's pretty easy to change/update.
lmaguire
@lmaguire
Sep 08 2016 01:43
Ok. I'm not exactly sure if its the features that I need, because when I invoked recent-treatments, I didn't get the same error. It is just the uploaded.json, which gives me: openaps report invoke nightscout/uploaded.jsonns://JSON/shell/nightscout/uploaded.json
No JSON object could be decoded
Cannot POST /api/v1/treatments.json
garykidd
@garykidd
Sep 08 2016 01:44
I think you may need to change to dev version...not certain though.
lmaguire
@lmaguire
Sep 08 2016 01:49
Ok, that does make sense. Thank you!
David
@davidkeddydb
Sep 08 2016 01:49
when invoking missing-entries: openaps report invoke nightscout/recent-missing-entries.json
ns://JSON/shell/nightscout/recent-missing-entries.json
I am getting this error: TypeError: can't compare offset-naive and offset-aware datetimes
No JSON object could be decoded
what did I miss in set up?
garykidd
@garykidd
Sep 08 2016 01:50
@lmaguire I think you can just sudo pip install -U git+git://github.com/openaps/openaps.git@dev
@davidkeddydb something appears to be wrong with your dates...
@davidkeddydb figuring youdont get anything when you try to cat nightscout/recent-missing-entries.json
@davidkeddydb what about....openaps report show nightscout/recent-missing-entries.json --cli
David
@davidkeddydb
Sep 08 2016 01:55
when I cat I get nothing. when I show, I get ns://JSON/shell/nightscout/recent-missing-entries.json
garykidd
@garykidd
Sep 08 2016 01:56
@davidkeddydb did you inlcude the --cli at the end?
David
@davidkeddydb
Sep 08 2016 01:56
no, let me redo
openaps use ns shell format-recent-type tz entries monitor/glucose.json
garykidd
@garykidd
Sep 08 2016 01:59
@davidkeddydb just a quick question...are all the times set to same time?
on cgm and pump?
David
@davidkeddydb
Sep 08 2016 02:00
yes, I checked that yesterday and just now. dates and times are same there and I believe on the pi and nightscout
garykidd
@garykidd
Sep 08 2016 02:00
and you have pi time zone stuff all done too?
David
@davidkeddydb
Sep 08 2016 02:00
yes and I have that set to NY
garykidd
@garykidd
Sep 08 2016 02:02
I would maybe try to continue to peel back each layer of the reporting, to see if you can identify the source issue...and not the result of a result [of a result] etc.
David
@davidkeddydb
Sep 08 2016 02:04
I have just been trying to chip away at the errors I am getting from openaps report-nightscout
they are at least different than the first time I tried to get openaps set up
I was excited to get units worked out yesterday, now that error is gone
garykidd
@garykidd
Sep 08 2016 02:07
@davidkeddydb try openaps vendor add openapscontrib.timezones
and openaps device add tz timezones
David
@davidkeddydb
Sep 08 2016 02:09
addding the device says already exists
garykidd
@garykidd
Sep 08 2016 02:09
for both?
David
@davidkeddydb
Sep 08 2016 02:10
no, just for openaps device add tz timezones
I did the vendor add and that took
Still giving me the timezone error for the missing entries
still this error: TypeError: can't compare offset-naive and offset-aware datetimes
No JSON object could be decoded
Jarred Yaw
@jyaw
Sep 08 2016 02:13
@Pazoles looks like the random reboots I was having may be a pi thing after all. The replacement receiver eventually threw out the call tech support error. Just wanted to let you know I'm still unsure on this one. Doesn't seem to be a receiver thing.
garykidd
@garykidd
Sep 08 2016 02:18
@davidkeddydb did you get my private message?
David
@davidkeddydb
Sep 08 2016 02:19
I did but it wont let me do it. Tried
dont know if it was too long or what
garykidd
@garykidd
Sep 08 2016 02:19
You probably want to delete your post at 21:30.
@davidkeddydb
David
@davidkeddydb
Sep 08 2016 02:22
yeah, it will only allow me to quote or reply. I am not sweating it
garykidd
@garykidd
Sep 08 2016 02:27
I wouldn't either really...plus you can always change it.
@davidkeddydb what type of cgm are you using?
David
@davidkeddydb
Sep 08 2016 02:27
dex
garykidd
@garykidd
Sep 08 2016 02:27
g4 or g5?
David
@davidkeddydb
Sep 08 2016 02:27
g4
my whole ns into openaps isnt working, and my g4 is plugged in to the pi
garykidd
@garykidd
Sep 08 2016 02:29
and can you openaps use cgm oref0_glucose --hours 2
David
@davidkeddydb
Sep 08 2016 02:31
I can but perhaps this is my problem: "trend_arrow": "FLAT",
"system_time": "2016-09-08T02:34:02",
"direction": "Flat",
"sgv": 212,
"display_time": "2016-09-07T20:33:00",
"date": 1473294780000.0,
"dateString": "2016-09-07T20:33:00",
"unfiltered": 237184,
"filtered": 234464,
"device": "openaps://cgm",
"rssi": 162,
"type": "sgv",
"glucose": 212
should the display time and system time be the same? where is it pulling the system time and how can I change it, or is that a non-issue?
this is where my date issue is I am guessing
Eric Jensen
@elnjensen
Sep 08 2016 02:35
Photo Sep 07, 10 32 04 PM.jpg
garykidd
@garykidd
Sep 08 2016 02:35
dont worry about system time--can't change it
Eric Jensen
@elnjensen
Sep 08 2016 02:35
Woohoo! Just got my Edison talking to my pump via TI stick over serial! I need to get the wiring a little better organized, though. :smiley_cat:
@eluhrs time for me to print one of your cases for this. Will need to modify a little bit for the slightly different model of charger, though.
David
@davidkeddydb
Sep 08 2016 02:36
the system time though is also a different date
garykidd
@garykidd
Sep 08 2016 02:36
@elnjensen nice. I'm jealous...
@davidkeddydb yeah---I don' think it matters though---
Eric Jensen
@elnjensen
Sep 08 2016 02:37
Still need to figure out how to pull glucose from NS, but I think I'm pretty close.
garykidd
@garykidd
Sep 08 2016 02:37
@elnjensen that's exactly what I was working on right now.
David
@davidkeddydb
Sep 08 2016 02:37
I am jealous of anyone who has their loop running. I am in awe of Eric Jenson
garykidd
@garykidd
Sep 08 2016 02:38
@davidkeddydb hang in there. You probably have just a couple of small things to address before you can close loop and start testing
@elnjensen I don' tthink you need to run cgm data through tz rezone like raw cgm data...right?
David
@davidkeddydb
Sep 08 2016 02:40
I am nothing if not pig headed to get it done. I am slowly getting the errors worked out.
garykidd
@garykidd
Sep 08 2016 02:41
I dont think anyone has been at this for as long with as little progress as I have made. It'll be awesome when you getting it working.
@davidkeddydb what part of NY are you in?
David
@davidkeddydb
Sep 08 2016 02:46
I am actually up in NH. Just needed to use est
looking forward to closing the loop. cant say I am looking forward to leaving the omnipod to go back to my old medtronic pump
garykidd
@garykidd
Sep 08 2016 02:47
@davidkeddydb OK well hopefully you're a Pats fan then.
David
@davidkeddydb
Sep 08 2016 02:47
have to be. they kick you out of new england if you are not
garykidd
@garykidd
Sep 08 2016 02:48
right.
David
@davidkeddydb
Sep 08 2016 02:49
are you with me on the east coast?
garykidd
@garykidd
Sep 08 2016 02:49
in NE too....CT..people around me have no idea CT is part of NE though
David
@davidkeddydb
Sep 08 2016 02:50
you might as well be a new yorker.
so I literally error out here:

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 "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 744, in run_script
File "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 1499, 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 332, in includes
if self.prev <= when and when <= self.curr:
TypeError: can't compare offset-naive and offset-aware datetimes
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 "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 744, in run_script
File "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 1499, 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

garykidd
@garykidd
Sep 08 2016 02:54
@davidkeddydb yeah, not sure bud. I'm gonna be shot tomorrow..I fell asleep on train ride home tonight. so f'in tired. Will try to be back tomorrrow.
David
@davidkeddydb
Sep 08 2016 02:55
no worries. Thanks for everything. I am tapping out here shortly as well unless any of our diabetes programming brethren can set me straight
David
@davidkeddydb
Sep 08 2016 03:00

getting a similar error on upload-entries. 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 "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 744, in run_script
File "build/bdist.linux-armv7l/egg/pkg_resources/init.py", line 1499, 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

diabeticgonewild
@diabeticgonewild
Sep 08 2016 04:54
Dying for opium tincture to kick in. It sucks cause I have had diarrhea all day, and it's not helping enough. I'm already on a higher dose than the recommended dose, so it really sucks that I still have gut problems. It's reserved for severe and fulminant diarrhea, too.
I'm going to Florida via car ride tomorrow and I don't want to be taking rest stops like every 15 minutes...
I guess I shouldn't be complaining too much. The diarrhea went untreated for years, like around 10 years. It wasn't high on my GI doctor's priority list in terms of treating. I would drink 4-6 liters of fluids a day to prevent getting dehydrated.
diabeticgonewild
@diabeticgonewild
Sep 08 2016 05:00
My GI Doctor didn't treat it until about 1.5 years ago when I ended up in the emergency room with blood potassium levels that were flagged as critically low. There were other electrolytes and labs that were off too. But I got admitted over that and I had to spend the night. So, my GI Doctor didn't treat that issue until she absolutely had to...
diabeticgonewild
@diabeticgonewild
Sep 08 2016 05:07
All of this crap, cause of autonomic neuropathy (surprisingly—NOT due to my diabetes). It's a lot to endure.
Dana Lewis
@danamlewis
Sep 08 2016 05:09
@Tetheredexpat_twitter ah good you jumped in here, too. Most people get help here online, so if you're interested in building a rig start asking questions here, and people can point you to the right places, regardless of geography!
Scott Leibrand
@scottleibrand
Sep 08 2016 05:39
@elnjensen the script is only setting the time to match the pump/CGM if those are more recent than the current system time. That's why it doesn't care if the first one is successful, and also the reason for much of the complexity in setting the time with date (if fake-hwclock is not installed). Would be happy to see some simplification that still accomplishes those goals though. Just need to test it thoroughly in an offline situation: I've been doing most of my dev when offline in Europe. :-)
John Sjolund
@sjolundjohn
Sep 08 2016 09:13

Working on some last tweaks to AMA. Getting problems with carbhistory.json.

I created a blank file using nano

And using:
openaps alias add ns-meal-carbs '! bash -c "egrep -q carbs.:0, monitor/meal.json && curl -m 30 -s \"$NIGHTSCOUT_HOST/api/v1/treatments.json?find\[created_at\]\[\$gte\]=`date -d \"3 hours ago\" -Iminutes`&find\[carbs\]\[\$exists\]=true\" > monitor/carbhistory.json && oref0-meal monitor/pumphistory-zoned.json settings/profile.json monitor/clock-zoned.json monitor/carbhistory.json > monitor/meal.json; exit 0"'
Not getting anything to work
Scott Leibrand
@scottleibrand
Sep 08 2016 09:17
Maybe run the different parts individually to see what is failing?
diabeticgonewild
@diabeticgonewild
Sep 08 2016 09:22
FML, seriously! This is so depressing! Due to chronic inflammatory demyelinating polyneuropathy, I have significant balance and muscle weakness problems. I was doing some final packing up for my trip like 15 minutes ago. My feet sometimes drop due to the neuropathy (and don't pick themselves up fully) when taking steps and walking. My foot dropped when taking a step and I tripped on the carpet and I fell over.
The worst part is the muscle weakness. And it shows itself (and I feel it the worst) in my upper legs and my thighs. In the neuro exam, for my thighs, I get 3/5 for strength usually. Other parts of my body are better. Unfortunately you REALLY need that particular muscle group to walk.
John Sjolund
@sjolundjohn
Sep 08 2016 09:25
@scottleibrand
edison@edison2:~/openaps$ openaps report invoke monitor/meal.json
meal://text/shell/monitor/meal.json
Warning: could not parse monitor/carbhistory.json
35 0 Thu Sep 08 2016 07:22:13 GMT+0200 (CEST)
>>++>>->>->----=>=->-----=->=->==------+--=++++>=->+>+->->-->>>>+++++>+->=++++=+++=++==+>-->-+>>>>++-=->>>>>>++--->>->>+++>-->>-->->+>>->>>->>-++---+++-+>>->>-->>>>->>>->>>>>>>>=>+>>->>->>->->>->>->--> 32% of non-meal deviations negative (target 45%-50%)
Excess insulin resistance detected: ISF adjusted from 32.4 to 31
NaN
reporting monitor/meal.json
diabeticgonewild
@diabeticgonewild
Sep 08 2016 09:25
Anyway, I couldn't get myself back up off of the floor because my thigh muscles were so weak. It took me like 5 minutes to get up off of the floor and it was exhausting. I'm so screwed.
John Sjolund
@sjolundjohn
Sep 08 2016 09:26
Sorry to hear @diabeticgonewild !
diabeticgonewild
@diabeticgonewild
Sep 08 2016 09:26
I can't believe this is happening to me, already.
John Sjolund
@sjolundjohn
Sep 08 2016 09:26
@scottleibrand when I run openaps ns-meal-carbs - nothing seems to happen at all
diabeticgonewild
@diabeticgonewild
Sep 08 2016 09:26
Thanks @sjolundjohn
Scott Leibrand
@scottleibrand
Sep 08 2016 09:27
@sjolundjohn looks like monitor/carbhistory.json is problematic. What does it look like?
John Sjolund
@sjolundjohn
Sep 08 2016 09:27
@scottleibrand I just created a blank file using nano
Scott Leibrand
@scottleibrand
Sep 08 2016 09:28
I think it's expecting valid json.
diabeticgonewild
@diabeticgonewild
Sep 08 2016 09:28
So seriously, FML
John Sjolund
@sjolundjohn
Sep 08 2016 09:29
hmm, as I could see the way to create carbhistory.json was via ns-meal-carbs
Is there a standard report I should create for it`?
Scott Leibrand
@scottleibrand
Sep 08 2016 09:31
Does the curl work?
John Sjolund
@sjolundjohn
Sep 08 2016 09:31
Nothing seems to happen run I run it
edison@edison2:~/openaps$ openaps ns-meal-carbs
edison@edison2:~/openaps$
Scott Leibrand
@scottleibrand
Sep 08 2016 09:32
Check your NS API via the URL it's using.
John Sjolund
@sjolundjohn
Sep 08 2016 09:32
I have it uploading to NS ok, but with that said, how do I test to confirm here?
Scott Leibrand
@scottleibrand
Sep 08 2016 09:33
curl -m 30 -s "$NIGHTSCOUT_HOST/api/v1/treatments.json?find[created_at][$gte]=date -d "3 hours ago" -Iminutes&find[carbs][$exists]=true" is what the alias is doing.
You can hit that URL yourself with curl or your web browser.
John Sjolund
@sjolundjohn
Sep 08 2016 09:39
If hit this URL in browser, I just get brackets with no data
I am not getting curl to work right
edison@edison2:~/openaps$ curl -m 30 -s "$NIGHTSCOUT_HOST/api/v1/treatments.json?find[created_at][$gte]=date -d "3 hours ago" -Iminutes&find[carbs][$exists]=true
>
Scott Leibrand
@scottleibrand
Sep 08 2016 09:45
Try it in your browser first?
Chris Oattes
@cjo20
Sep 08 2016 09:53
you're missing some `
Which gives mismatched ", hence the >
John Sjolund
@sjolundjohn
Sep 08 2016 09:54
@scottleibrand I just sent you the URL I am using in a private chat
Chris Oattes
@cjo20
Sep 08 2016 09:58
@sjolundjohn You need to fix the quoting the curl command to get it to work
John Sjolund
@sjolundjohn
Sep 08 2016 10:01
@cjo20 do you see the issue?
Scott Leibrand
@scottleibrand
Sep 08 2016 10:01
https://<your site>/api/v1/treatments.json?find%5Bcarbs%5D%5B$exists%5D=true would bypass that.
Chris Oattes
@cjo20
Sep 08 2016 10:01
sjolundjohn: You didn't type out what Scott said properly, you missed out a poair of `
Matt Pazoles
@Pazoles
Sep 08 2016 11:01
@jyaw I haven't seen an error on the receiver side yet, I'm still suspicious of the USB cable. Noticed the pi would shut off if there was a little downward pressure on the microusb. Trying one of those right-angle cables to see if that helps. So far, haven't seen that issue come back yet.
Jarred Yaw
@jyaw
Sep 08 2016 12:55
Hmm... Honestly didn't check that. Good idea, would be an easy fix.
Dave Ewall
@daveewall
Sep 08 2016 13:06
@scottleibrand Is there any way to get the ISIG off of the pump for medtronic sensors? I was thinking it would be nice to show on NS whether it's okay to calibrate, based on the BG / ISIG = Calibration Factor range.
Dana Lewis
@danamlewis
Sep 08 2016 13:11
@daveewall might ask someone with Medtronic sensor, we don't have one to explore with
Dave Ewall
@daveewall
Sep 08 2016 13:13
Is that a decocare question for Ben?
Dana Lewis
@danamlewis
Sep 08 2016 13:14
Probably!
@sjolundjohn from other channel, plugging receiver into Pi also an option for looping offline (sounds like you're pursuing xDrip but wanted to make sure you knew that would work, too)
John Sjolund
@sjolundjohn
Sep 08 2016 13:17
@danamlewis indeed thanks. I want to get it working on the Edison which is my current hobby
Dana Lewis
@danamlewis
Sep 08 2016 13:18
:+1:
Russell Gardner
@RussGG
Sep 08 2016 13:41
I am accessing my RP3 via ssh on my Mac. What is the best way to shut it down?
Dana Lewis
@danamlewis
Sep 08 2016 13:45
Google is good for general rPi Qs
Russell Gardner
@RussGG
Sep 08 2016 13:49
You would think......
Chris Oattes
@cjo20
Sep 08 2016 13:54
@daveewall Not sure about isig, you get the cal factor when you calibrate though
if you find the latest cal factor, you can work out what the new one might be based on current CGM BG and finger prick
Dave Ewall
@daveewall
Sep 08 2016 14:09
@cjo20 Where do you get the latest cal factor? Don't think I've ever seen it.
Chris Oattes
@cjo20
Sep 08 2016 14:09
you'd have to parse the pump history
Dave Ewall
@daveewall
Sep 08 2016 14:10
Oh, I see. I'll see what I can find.
Chris Oattes
@cjo20
Sep 08 2016 14:11
  {
  "packet_size": 6,
    "name": "SensorCalFactor",
    "raw": "8a-46-06-10-25-ab",
    "date": 1473152760000,
    "factor": 9.643,
    "date_type": "minSpecific",
    "_tell": 23,
    "op": "0x0f",
    "dateString": "2016-09-06T10:06:00+0100",
    "type": "pumpdata",
    "device": "openaps://medtronic/pump/cgm"
}
Something like that
Dave Ewall
@daveewall
Sep 08 2016 14:12
This message was deleted
I guess what I was looking for is the current factor before calibrating. According to Medtronic (just got off the phone with them), the ISIG / BG (what they're calling the cal factor) should be between 3 and 8.33 in order for it to not give you a Calibration Error.
So if you knew what the CF was before doing the calibration (instead of afterwards), you can avoid calibrating at the wrong times.
I'm thinking it would be a nice addition to the Pump pillbox.
But in order to do that, you'd need to know what the ISIG is whenever you get a BG reading from the sensor.
Chris Oattes
@cjo20
Sep 08 2016 14:16
So the cal factor is constant between calibrations afaik
so if you calibrate at 6am and the cal factor is 8, it'll be 8 at 4pm
The thing that gives you the cal error is when the new cal factor is gonig to be outside of a good range
Dave Ewall
@daveewall
Sep 08 2016 14:16
Not according to them. Perhaps their using the term differently. If they're calibrating the CF from the BG, it can't be the same.
Chris Oattes
@cjo20
Sep 08 2016 14:17
If you know the current cal factor, and the current sensor BG, you can work out the current isig
Dave Ewall
@daveewall
Sep 08 2016 14:17
Right, but they're saying the cal factor can be determined before you even do it, and you can compare it to the good range to know whether or not you'll get an error.
Chris Oattes
@cjo20
Sep 08 2016 14:17
CGM_BG/CAL_FACTOR = ISIG
NEW_BG/ISIG = NEW_CAL_FACTOR
you get a cal error if the NEW_CAL_FACTOR is out of range
you have the information you need to (sort of) work out what it is going to be, if you parse pump history
Dave Ewall
@daveewall
Sep 08 2016 14:20
Sorry, I had the equation backwards. You have it right that BG/ISIG = CF. But that means that it inherently changes over time, no?
Chris Oattes
@cjo20
Sep 08 2016 14:20
The pump doesn't re-calculate it continuously. It re-calculates when you tell it to calibrate
When you calibrate your CGM, you say "Here is a new BG. Use that plus the ISIG (plus the old cal factor) to work out the new cal factor"
Dave Ewall
@daveewall
Sep 08 2016 14:21
That's my point, that we have the information, and we can display it. If we have the isig, we can calculate it from the bg, which we already have.
Chris Oattes
@cjo20
Sep 08 2016 14:21
And I'm saying you can calculate the current isig from the current CGM reading and the old cal factor
Dave Ewall
@daveewall
Sep 08 2016 14:23
Oh... I think I finally got your point... so using the old cal factor, we can get the isig, use that with the bg, and get the new factor and show that as to whether it's safe to calibrate? Or am I way off?
Chris Oattes
@cjo20
Sep 08 2016 14:24
Yes, like I said
ISIG = CGM_BG / CAL_FACTOR
NEW_CAL_FACTOR = NEW_BG/ISIG
Dave Ewall
@daveewall
Sep 08 2016 14:25
Sorry, I guess I'm slow today. I didn't see it before. So is the factor getting pushed to NS currently?
Chris Oattes
@cjo20
Sep 08 2016 14:25
It's in the mlab database
I'm not sure I'd try and displaying the ISIG constantly, nor the new cal factor. It only makes sense to display the new cal factor for a finger prick reading, which isn't valid after 15 minutes or so
What you might be able to do is write an auto-calibration procedure
As openaps knows when you last ate, and knows the CGM trend. You could set it up to say that if your BG has been flat for the last 20 minutes (no fast-movement arrows) and the new cal factor would be in range, do a calibration. I don't know for sure, but I wouldn't be surprised if there was a carelink command to tell the pump to calibrate
You might want to say that if the last CGM reading was 'flat', there is < 1u IOB, food > 2 hours ago and new factor is in range, calibrate
Dave Ewall
@daveewall
Sep 08 2016 14:30
Okay, maybe I'll play with it and see if I can get it working. I was thinking of just having the new cal factor displayed in the pump pill as red or green... nothing that would tell the pump to calibrate, as I would just be interested in seeing if it's safe to do so from the NS side.
Chris Oattes
@cjo20
Sep 08 2016 14:31
I'm not sure it's worth having a pill for it. The data only makes sense for about 15 minutes after a proper finger prick test
Dave Ewall
@daveewall
Sep 08 2016 14:33
I think we're disagreeing on something here. I'll do some playing around and see how it behaves. I'm guessing I'll be proved wrong in the end, and that'll be it.
Chris Oattes
@cjo20
Sep 08 2016 14:36
To calculate the new cal factor, you need to have a source of data other than the CGM BG
You need to have results of a blood test.
Dave Ewall
@daveewall
Sep 08 2016 14:37
Maybe that's where my issue is. According to Medtronic, that's not the case... at least, from what they just told me, and what I've been told by other trainers.
Chris Oattes
@cjo20
Sep 08 2016 14:38
How do you think you can work out a new calibration factor from just ISIG?
Dave Ewall
@daveewall
Sep 08 2016 14:38
Maybe you don't know what the new factor will be, but you know whether or not it would be in a good range for what the system thinks it should be.
Chris Oattes
@cjo20
Sep 08 2016 14:38
What do you think you can calculate given just an ISIG?
or ISIG + current CGM BG
Dave Ewall
@daveewall
Sep 08 2016 14:40
Okay, I see your point. I just had the a-ha moment. And now the rest of what you said makes more sense.
Thanks for the knowledge.
Chris Oattes
@cjo20
Sep 08 2016 14:41
Hope that helped
Brandon Faloona
@bfaloona
Sep 08 2016 15:45
@diabeticgonewild Your edison videos helped me visualize/execute a few tasks (even though I used a Pi + Mac). Thanks for sharing them!! :clap: :heart:
@RussGG Did you get your Pi shutdown? I ssh to it and execute sudo halt
Russell Gardner
@RussGG
Sep 08 2016 16:27
@bfaloona I used shutdown now I wanted to bring to my office and if time allowed, do some work on it. Hopefully no issues. Thanks!
garykidd
@garykidd
Sep 08 2016 16:46
@scottleibrand Hi Scott, what would you say is the easiest approach to change pulling BG from NS as opposed to pulling from dex receiver via usb?
Scott Leibrand
@scottleibrand
Sep 08 2016 17:05
I believe there is a method written up in the docs you can follow.
Eric Jensen
@elnjensen
Sep 08 2016 17:13
@scottleibrand Thanks for clarification on the clock setting. Will read the existing code more closely, and play around a bit with some possible other options to see if I can make it more straightforward.
Scott Leibrand
@scottleibrand
Sep 08 2016 17:15
Thanks, appreciated.
garykidd
@garykidd
Sep 08 2016 18:03
I can clearly see how to obtain the entries.json from ns shell....but do those entries need to be reformatted through tz or anything?
Tim Street
@tim2000s
Sep 08 2016 18:26
@garykidd My monitor/glucose.json is set up to run the nightscout/entries.json. It outputs the data to the correct file and openAPS runs happily off it.
Brandon Faloona
@bfaloona
Sep 08 2016 18:37

I use weaved with the Raspberry Pi and love it (I paid to upgrade to 2 hour ssh sessions).
I hit the systemctl installation errors when installing it on the edison.
http://forum.weaved.com/t/problems-installing-on-debian-ubilinux-on-the-edison/886/5

What do people use to remotely connect to their edisons? Dataplicity?

Jason Calabrese
@jasoncalabrese
Sep 08 2016 18:39
I couldn't get it to work with an edision, and use ssh tunnels to my server instead
Scott Leibrand
@scottleibrand
Sep 08 2016 18:40
same. basically that's a roll-your-own-weaved setup.
garykidd
@garykidd
Sep 08 2016 18:41
@tim2000s thanks, tim.
Brandon Faloona
@bfaloona
Sep 08 2016 18:44
@jasoncalabrese @scottleibrand Thanks. Do you have a link that might help set something like that up?
but now have a script that I run via a cron to restart autossh, since even though it tries to keep the tunnel up it's not always enough
#!/bin/bash

killall -g --older-than 30m ssh
killall -g --older-than 15m autossh

if ! /bin/ps -ef | /bin/grep autossh | /bin/grep 2221 | /bin/grep -v grep > /dev/null; then
  echo no autossh process, opening new tunnel
  autossh -M 0 -N -f -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -R 2221:localhost:22 remote-user@remote-host &
fi
I think others use ssh directly, and since I need this script maybe autossh isn't worth using
Brandon Faloona
@bfaloona
Sep 08 2016 18:59
Interesting. Thanks for the info.
garykidd
@garykidd
Sep 08 2016 22:58
@elnjensen Hope all is well. Were you able to obtain entries from NS as opposed to cgm?
Need a little help with switching BG source from cgm to NS...can anyone help me?
garykidd
@garykidd
Sep 08 2016 23:16
I think i got it actually.
not quite...bummer
garykidd
@garykidd
Sep 08 2016 23:23
sort of working. OpenAPS pil isnt updating but temp basals are being set....thoughts?
garykidd
@garykidd
Sep 08 2016 23:29
nor is PUMP...
Matthew Williams
@mwilliams
Sep 08 2016 23:41
I too am now onto troubleshooting NS, got my OpenAPS kit running on a battery powered RPiZero today - working great and fits in the same pocket my pump is clipped to! https://twitter.com/mwilliams/status/774000516795858944
Still can't get data into NS though, stepping through each report in my alias now... Anyone have a set of alias's to share, or is bewest's the way to go? Using my MM enlite for CGM data (which is where I think I'm failing, I'm not massaging the data right, despite using the proper tool).
diabeticgonewild
@diabeticgonewild
Sep 08 2016 23:50
@bfaloona You're welcome! I'm on vacation in Florida now! :D