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

20th
Sep 2015
diabeticgonewild
@diabeticgonewild
Sep 20 2015 03:33
It has to do with UART. The USB driver problem on Yocto Linux. It's not a full Linux kernel on the Edison.
John Males
@johnmales
Sep 20 2015 04:29

Hi guys having some trouble generating some reports and not others.
I have previously added:
openaps report add recent_glucose.json JSON pump iter_glucose_hours 6
and then this command:
openaps report invoke recent_glucose.json outputs to a file as expected

However, other reports e.g.
openaps report add recent_history.json JSON pump iter_pump_hours 6
and then the report
openaps report invoke recent_history.json gives errors finishing in:
AttributeError: 'Pump' object has no attribute 'model'

If I do:
openaps use pump item_pump_hours 6
i.e. the same command but not generating a .json file
the json output gets created correctly (as far as I can tell) with no errors.

I have rebooted, no change. Any thoughts?

diabeticgonewild
@diabeticgonewild
Sep 20 2015 07:14
I just found out that we shouldn't be recommending access points for SSHing into the Raspberry Pi 2 with no presumed mobile or Ethernet connection—we should be using ad hoc configurations. Much cleaner and easier to configure plus no interference with other configurations such as with etc/network/interfaces . Plus only certain USB adapters/dongles can be access points which is a problem. Will be updating writeup soon...hopefully
@johnmales you have to do the invoke command to "set it up" once before doing it routine
Scott Leibrand
@scottleibrand
Sep 20 2015 07:41
Monica: not all phones and computers will connect to ad hoc wifi networks. If you want to go down that route, please test it and let us know what it works with.
diabeticgonewild
@diabeticgonewild
Sep 20 2015 07:43
Wow I didn't know that. It was recommended in a book I was looking at breifly (not hardcore reading—just scanning through)
Scott Leibrand
@scottleibrand
Sep 20 2015 07:47
yeah, book knowledge is good, but for sharing with others, nothing beats practical first-hand experience with getting something set up and working (and working with it enough to know and be able to share its limitations)
diabeticgonewild
@diabeticgonewild
Sep 20 2015 07:48
Yeah I'm writing stuff up now. I was just taking a last look before I make recommendations. I did find something interesting for rapid deployment that applies to us that will work well, just has to be tested for our needs and tailored: https://m.reddit.com/r/raspberry_pi/comments/1xj6f6/rapid_deployment_installing/
This pretty much is it here: http://pastebin.com/kFAxvpEr
Scott Leibrand
@scottleibrand
Sep 20 2015 07:49
yeah. the testing and tailoring is always the hard part, so getting that done and documented is the biggest contribution
Ed Raskin
@msrcgm
Sep 20 2015 07:53
running my determine basal recommendation process and issuing temp basal commands manually to t:slim and documenting results in excel file (obviously not issuing any commands I deem unreasonable). Question, though, right now temp should be set to 1u /hr. I issued that temp on the medtronic. Why does the output state that there is currently "no temp to cancel". Is it saying "I've calculated and you shouldn't cancel" or is it not seeing the temp I issued to the detached medtronic pump?
pi@raspberrypi ~/myopenaps $ openaps magic
cgm://JSON/iter_glucose/recent-glucose.json
reporting recent-glucose.json
pump://JSON/read_clock/clock.json
reporting clock.json
get-profile://text/shell/profile.json
reporting profile.json
calculate-iob://text/shell/calculate-iob.json
reporting calculate-iob.json
determine-basal://text/shell/determine-basal-suggestion.json
IOB: 0.00, Bolus IOB: 0.00
Avg. Delta: -5.7, BGI: 0.0
15m deviation: -17
BG: 205-1 -> 188-188 (Unadjusted: 205-205)
-1; no temp to cancel
reporting determine-basal-suggestion.json
pi@raspberrypi ~/myopenaps $ cat determine-basal-suggestion.json
{"temp":"absolute","bg":205,"tick":-1,"eventualBG":188,"snoozeBG":188,"reason":"-1; no temp to cancel"}
pi@raspberrypi ~/myopenaps $
Scott Leibrand
@scottleibrand
Sep 20 2015 07:56
"no temp to cancel" means "I do not see any temp basal running in currenttemp.json"
John Males
@johnmales
Sep 20 2015 07:56
@diabeticgonewild so if the invoke is run once what command do you use to run the report again?
Scott Leibrand
@scottleibrand
Sep 20 2015 07:56
@msrcgm: are you running the currenttemp.json report before running determine-basal?
@johnmales openaps report invoke something.json is how you run a report, whether it's the first time or subsequent.
can you tell us again what you're seeing? I didn't see anything in your earlier post that jumped out to me as far as what's different between the working and non-working one
John Males
@johnmales
Sep 20 2015 08:02

@scottleibrand for example:

openaps report invoke read_clock.json
pump://JSON/read_clock/read_clock.json
read_clock.json raised 'Pump' object has no attribute 'model'
Traceback (most recent call last):
File "/usr/local/bin/openaps-report", line 5, in <module>
pkg_resources.run_script('openaps==0.0.6', 'openaps-report')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)0.run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.6-py2.7.egg/EGG-INFO/scripts/openaps-report";, line 82, in <module>
app( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.6-py2.7.egg/openaps/cli/init.py", line 44, in call
self.run(self.args)
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.6-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.0.6-py2.7.egg/openaps/cli/subcommand.py";, line 50, in call
return self.method.main(args, app)
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.6-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.0.6-py2.7.egg/openaps/uses/use.py";, line 26, in call
output = self.main(args, app)
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.6-py2.7.egg/openaps/vendors/medtronic.py";, line 188, in main
return self.pump.model.read_clock( )
AttributeError: 'Pump' object has no attribute 'model'

whereas:
openaps report invoke recent_glucose.json
pump://JSON/iter_glucose_hours/recent_glucose.json
reporting recent_glucose.json

This one worked fine.

Any thoughts?

Scott Leibrand
@scottleibrand
Sep 20 2015 08:02
I'll be right back to look at that.
Ed Raskin
@msrcgm
Sep 20 2015 08:03
no, I run 1) inter_glucose.json, 2) read_clock.json 3) profile.json (which I thought includes temp?) 4) calculate-iob.json 5) then determine-basal-reccomendation.json
do I need to add currenttemp.json (and if so where) and if so, is there anything else I need to add? Its pointless to test tonight and not sleep if the calculation is totally incorrect :(
John Males
@johnmales
Sep 20 2015 08:04
Perhaps the errors are related to specific model numbers of pumps?
Scott Leibrand
@scottleibrand
Sep 20 2015 08:09
@msrcgm: the inputs to determine-basal are: <iob.json> <currenttemp.json> <glucose.json> <profile.json>
the inputs to calculate-iob are: <pumphistory.json> <profile.json> <clock.json>
if your profile isn't expected to change, you don't have to worry about the inputs to get-profile
but all those others need to be fresh each run
@johnmales is that a dexcom or medtronic cgm?
John Males
@johnmales
Sep 20 2015 08:12
@scottleibrand medtronic cgm
Scott Leibrand
@scottleibrand
Sep 20 2015 08:12
does openaps use pump read_clock work?
John Males
@johnmales
Sep 20 2015 08:14
let me try
Ed Raskin
@msrcgm
Sep 20 2015 08:15
Yes, determine-basal contains currenttemp.json (I now realize what I previously aid above about including it in my magic command was stupid because its already there ...., Ha! So, what else could be going wrong here?
Scott Leibrand
@scottleibrand
Sep 20 2015 08:16
do an ls -la currenttemp.json and cat currenttemp.json and let's see what you have
Ed Raskin
@msrcgm
Sep 20 2015 08:18
correct data (i.e. my temp just turned off a second ago): it shows:
pi@raspberrypi ~/myopenaps $ ls current_temp.json
current_temp.json
pi@raspberrypi ~/myopenaps $ cat current_temp.json
{
"duration": 0,
"rate": 0.0,
"temp": "absolute"
}pi@raspberrypi ~/myopenaps $
Scott Leibrand
@scottleibrand
Sep 20 2015 08:19
I asked for ls -la, as the -l gives us full file info. I particularly wanted to see the timestamp of currenttemp.json.
copy and paste are your friend. :)
John Males
@johnmales
Sep 20 2015 08:20
@scottleibrand yes it works:
openaps use pump read_clock
"2015-09-20T18:19:39"
Ed Raskin
@msrcgm
Sep 20 2015 08:21
sorry, trying again
Scott Leibrand
@scottleibrand
Sep 20 2015 08:21
@johnmales do any other non-CGM pump reports work?
Ed Raskin
@msrcgm
Sep 20 2015 08:22
pi@raspberrypi ~/myopenaps $ ls -la current_temp.json
-rw-r--r-- 1 pi pi 58 Sep 18 11:16 current_temp.json
pi@raspberrypi ~/myopenaps $ cat current_temp.json
{
"duration": 0,
"rate": 0.0,
"temp": "absolute"
}pi@raspberrypi ~/myopenaps $
Scott Leibrand
@scottleibrand
Sep 20 2015 08:22
@johnmales not sure what the requirements for CGM communications are, or if they use the same device config in openaps.ini
but it sounds like your openaps pump device might be misconfigured (maybe missing or incorrect serial number or something)
@msrcgm you see the problem?
Ed Raskin
@msrcgm
Sep 20 2015 08:23
I do, Sept 18 11:16
Scott Leibrand
@scottleibrand
Sep 20 2015 08:23
yep. you know what that means?
Ed Raskin
@msrcgm
Sep 20 2015 08:24
But I admit, I don't totally understand
Scott Leibrand
@scottleibrand
Sep 20 2015 08:24
it means you haven't refreshed that file, by running the report of the same name, in 2 days.
Ed Raskin
@msrcgm
Sep 20 2015 08:25
The last time it gathered this data was Sept 18?
yet ...
Scott Leibrand
@scottleibrand
Sep 20 2015 08:25
correct. you should be able to do something like openaps report invoke current_temp.json to refresh it
Ed Raskin
@msrcgm
Sep 20 2015 08:26
Right, by I don't understand why? If I have that report saved and if I have a process that invokes the report as part of determine-basal, shouldn't it have refreshed that report every time I run magic?
Scott Leibrand
@scottleibrand
Sep 20 2015 08:26
I don't think you "have a process that invokes the report as part of determine-basal"
you most likely just pass the result file (current_temp.json) as an input to determine-basal
for all the others, you have stuff like:
cgm://JSON/iter_glucose/recent-glucose.json
reporting recent-glucose.json
pump://JSON/read_clock/clock.json
reporting clock.json
get-profile://text/shell/profile.json
reporting profile.json
that reporting X.json means it refreshed that particular report
the output you pasted does not show that for current_temp.json, nor does it show the preceding line where it attempts to refresh it
Ed Raskin
@msrcgm
Sep 20 2015 08:30
I see -- now let me think about how to fix that.
John Males
@johnmales
Sep 20 2015 08:30
@scottleibrand openaps use pump model returns "554", so there is some communication with the pump. I presume that with the medtronic cgm all the glucose readings are being taken from the pump, as the medtronic cgm transmitter transmits its data to the pump
The serial number is correct for the pump
Scott Leibrand
@scottleibrand
Sep 20 2015 08:33
hmm, strange
John Males
@johnmales
Sep 20 2015 08:34
@scottleibrand openaps use pump status
{
"status": "normal",
"bolusing": false,
"suspended": false
}
Scott Leibrand
@scottleibrand
Sep 20 2015 08:34
can you paste the stanza from openaps.ini for the failing report?
the fact that you can do the use command manually, but the report is failing, indicates a misconfiguration of some sort
John Males
@johnmales
Sep 20 2015 08:35
[report "read_clock.json"]
device = pump
use = read_clock
reporter = JSON
Scott Leibrand
@scottleibrand
Sep 20 2015 08:36
might also be worthwhile to compare the openaps.ini stanza to that of a working report
John Males
@johnmales
Sep 20 2015 08:36

[report "recent_glucose.json"]
device = pump
hours = 6.0
use = iter_glucose_hours
reporter = JSON

This one works, read_clock.json doesn't

Scott Leibrand
@scottleibrand
Sep 20 2015 08:37
my clock one is the same:
[report "clock.json.new"]
device = pump
use = read_clock
reporter = JSON
(that formatting is from doing three backticks (```) on a line by themselves before and after the text)
just for kicks, add another report for model if you haven't already, and make sure that works
and that it looks the same in openaps.ini
John Males
@johnmales
Sep 20 2015 08:38
I just looked up how to do the formatting as you posted :) If there is nothing immediate that comes to mind I'll keep playing with it and see what I can figure out
Scott Leibrand
@scottleibrand
Sep 20 2015 08:40
I'd still like to see a working report for something other than glucose (something I have configured on my side)
if you have the same problem with reports for model or similar, it might be a problem with your device config in openaps.ini
John Males
@johnmales
Sep 20 2015 08:41
ok hang on
@scottleibrand
pi@raspberrypi ~/luka-openaps $ openaps report invoke read_battery_status.json
pump://JSON/read_battery_status/read_battery_status.json
reporting read_battery_status.json
pi@raspberrypi ~/luka-openaps $ ls
openaps.ini  read_battery_status.json  recent_glucose.json
pi@raspberrypi ~/luka-openaps $ cat read_battery_status.json 
{
  "status": "normal", 
  "voltage": 1.22
}pi@raspberrypi ~/luka-openaps $
Scott Leibrand
@scottleibrand
Sep 20 2015 08:47
hmm, odd. not sure. if you don't figure out how to fix it by random trial and error, might need @bewest or @loudnate or someone else to take a closer look
Ed Raskin
@msrcgm
Sep 20 2015 08:49
can you help me see what I am not seeing?
pi@raspberrypi ~/myopenaps $ openaps report add determine-basal-suggestion.json text determine-basal shell calculate-iob.json current_temp.json glucose.json profile.json
added determine-basal://text/shell/determine-basal-suggestion.json
Scott Leibrand
@scottleibrand
Sep 20 2015 08:50
that report does one, and only one thing: runs determine-basal calculate-iob.json current_temp.json glucose.json profile.json
you can run that yourself manually to see how it works
determine-basal is the command you're running
John Males
@johnmales
Sep 20 2015 08:51
@scottleibrand All of a sudden the reports all seem to be working, which is great, except that I don't know why it wasn't working before...
Scott Leibrand
@scottleibrand
Sep 20 2015 08:51
all the other files are arguments (inputs in this case) to determine-basal
@johnmales could be something as stupid as the openaps.ini indicating that it didn't need to init the pump, but in fact the pump not being already in listen mode
if it happens again in future, you might try deleting the expires line in the device section of openaps.ini
John Males
@johnmales
Sep 20 2015 08:53
OK. is the expires line required for any reason?
cat
Scott Leibrand
@scottleibrand
Sep 20 2015 08:53
@msrcgm so you need a separate step, before running determine-basal via the determine-basal-suggestion.json report, to invoke the current_temp.json report
@johnmales no, it's just an optimization
every time openaps "wakes up" the pump, it indicates how long the pump should remain awake for
Ed Raskin
@msrcgm
Sep 20 2015 08:54
Right, so I'm back to my (clearly incorrect conclusion) that current_temp.son should be running everytime determine-basal runs, which -- in turn -- runs every time I run magic. So, I am still hung up with why has openaps not run current-temp since Friday
Scott Leibrand
@scottleibrand
Sep 20 2015 08:54
so it doesn't have to go through the 17 second wakeup process again every time you run a report.
John Males
@johnmales
Sep 20 2015 08:54
I see
Scott Leibrand
@scottleibrand
Sep 20 2015 08:55
@msrcgm it should be, yes. but you haven't configured it to run yet.
Ed Raskin
@msrcgm
Sep 20 2015 08:55
So, are you saying that I need a separate current-temp.json in my magic process?
Scott Leibrand
@scottleibrand
Sep 20 2015 08:55
yes
Ed Raskin
@msrcgm
Sep 20 2015 08:56
Where in the progression? after recent glucose.json? before?
elsewhere?
Scott Leibrand
@scottleibrand
Sep 20 2015 08:57
I think either would be fine
it just needs to run before it's needed
as do all of those others
I have a bunch of complicated logic for deciding what to refresh when, but at your stage you just need to refresh them all every time.
Ed Raskin
@msrcgm
Sep 20 2015 09:00
got it. I'm sorry, can you please remind me the command to see what is inside my magic alias?
Scott Leibrand
@scottleibrand
Sep 20 2015 09:00
I'll remind you of the command to figure out the command: openaps alias -h, or if you don't remember it's alias you want, then just openaps -h
you can always just start with what you remember, and then add a -h to the end to show the options at that point
John Males
@johnmales
Sep 20 2015 09:02
@scottleibrand All reports working. I'll keep up my conversation with @eszcloud to move forward
Scott Leibrand
@scottleibrand
Sep 20 2015 09:02
cool. good luck. :)
Ed Raskin
@msrcgm
Sep 20 2015 09:03
boom! did it!
Scott Leibrand
@scottleibrand
Sep 20 2015 09:03
:)
Ed Raskin
@msrcgm
Sep 20 2015 09:04
pi@raspberrypi ~/myopenaps $ openaps magic
cgm://JSON/iter_glucose/recent-glucose.json
reporting recent-glucose.json
pump://JSON/read_temp_basal/current_temp.json
reporting current_temp.json
pump://JSON/read_clock/clock.json
reporting clock.json
get-profile://text/shell/profile.json
reporting profile.json
calculate-iob://text/shell/calculate-iob.json
reporting calculate-iob.json
determine-basal://text/shell/determine-basal-suggestion.json
IOB: 0.00, Bolus IOB: 0.00
Avg. Delta: 4.0, BGI: 0.0
15m deviation: 12
BG: 217-3 -> 229-229 (Unadjusted: 217-217)
-3; no temp to cancel
reporting determine-basal-suggestion.json
Better yet -- I now understand why it wasn't invoked as part of the determine basal process
Scott Leibrand
@scottleibrand
Sep 20 2015 09:05
yeah. feels good to figure things out for yourself, doesn't it? :)
does its suggestion make sense this time?
Ed Raskin
@msrcgm
Sep 20 2015 09:05
Its not pulling the data at that point in determine basal -- it just wants to use the output, which it never had because it was not within magic.
Scott Leibrand
@scottleibrand
Sep 20 2015 09:05
exactly
Ed Raskin
@msrcgm
Sep 20 2015 09:06
boom boom
thank you
Scott Leibrand
@scottleibrand
Sep 20 2015 09:06
no problemo. have a good night! :)
Ed Raskin
@msrcgm
Sep 20 2015 09:06
Ok, now I need to catch the system up because I became frustrated with bg and did the recommended pump bolus
time to cat my determine basal and see what we see, plus do a fake bolus on my medtronic to catch everything up.
good night -- I will definitely be chatting with you soon.
Scott Leibrand
@scottleibrand
Sep 20 2015 09:07
I might be up a few more minutes on my phone if you run into any questions about why it's doing what it's doing.
diabeticgonewild
@diabeticgonewild
Sep 20 2015 09:09
Like honestly guys, the write up that we have has way too much going on. Unless you were really involved with hardware in the first place and knew Linux basics or were just super nerdy in general you wouldn't know what to do with it.
Ed Raskin
@msrcgm
Sep 20 2015 09:09
Thanks! and now I have ??? on my sensor. I think that's the openaps gods telling me to just go to sleep to night and save it for another night
diabeticgonewild
@diabeticgonewild
Sep 20 2015 09:10
That's why I'm going to try to do a bash shell script and make it copy and paste...(of course I am going to explain what is going on)
Scott Leibrand
@scottleibrand
Sep 20 2015 09:18
@diabeticgonewild you might want to make your criticism a bit more constructive. That write-up has been used by several people now (including Ed, who's a lawyer with zero technical background) to get to the point of running reports and making basal suggestions. It is being continuously improved as each person goes through the process and identifies areas where it was unclear. If you go through the install process and have more improvements to suggest, please do so. But insulting people's work like that isn't constructive.
And g'nite all!
diabeticgonewild
@diabeticgonewild
Sep 20 2015 09:22
Not insulting
Working on improving it realistically with an install script
Oskar Pearson
@oskarpearson
Sep 20 2015 11:12
Heya all. Which writeup is being referred to above?
Tim Howard
@tghoward
Sep 20 2015 11:23
@oskarpearson I think It is this one:
... particularly the two setup sections, which look very thorough now and which @diabeticgonewild wrote an early draft
Oskar Pearson
@oskarpearson
Sep 20 2015 11:36
BTW: Siobhan and I ran our first closed loop attempt yesterday. (yay!) It wasn't without it's problems (due to the data issue getting some info from the 722), but it was certainly an interesting experiment. We're going to be repeating today, now that I've moved the pump onto the next data page.
I'm a long way from running it unattended though!
diabeticgonewild
@diabeticgonewild
Sep 20 2015 14:47
I guess realistically what I am trying to point out that structurally it needs a convention for formatting both structurally and for the delivery of information. I am a big fan of polishing work.
Convention is the key word there.
Yes I can do the edits. But polishing does make a big difference with respect to getting more people on board and avoiding confusion, even with respect to aesthetic presentation. Even appearance can make it seem less intimidating for n00bs
Chris Oattes
@cjo20
Sep 20 2015 15:12
@diabeticgonewild At the point he responded, all you had said was "what people have done so far is terrible", which is insulting rather than constructive. What you posted just then is more constructive.
diabeticgonewild
@diabeticgonewild
Sep 20 2015 15:22
I did not say it was terrible. Apparently there is a misunderstanding. Plus I did work on this too so that would logically not make sense. I think you are making assumptions through written text.
@cjo20 you really jumped to conclusions
diabeticgonewild
@diabeticgonewild
Sep 20 2015 15:29
I have been very involved in the setup portion of the writeup overall so clearly whatever those previous posts and whatever you interpreted them to be was certainly a misunderstanding
Chris Oattes
@cjo20
Sep 20 2015 15:45
I'm not the one that called it insulting, but ok
Scott Leibrand
@scottleibrand
Sep 20 2015 17:58
@oskarpearson great to hear!
Rachel Sandlain
@audiefile
Sep 20 2015 18:05
exciting to hear @oskarpearson !
Oskar Pearson
@oskarpearson
Sep 20 2015 18:35
I agree! ;)
Dana Lewis
@danamlewis
Sep 20 2015 19:08
Yay @oskarpearson ! :) awesome to hear!
Ali Mazaheri
@amazaheri
Sep 20 2015 22:15
@msrcgm as discussed today please send me you latest json files so I can look into your issue with bolus and IOB calcs. before sending the json make sure the output of pump history has bolus records
Ali Mazaheri
@amazaheri
Sep 20 2015 22:37
Congratulations @oskarpearson