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

15th
Sep 2015
eszcloud
@eszcloud
Sep 15 2015 00:44
This message was deleted
Hey! I'm just getting started here. I have RPi up and running, can query both pump (Medtronic 522) and dexcom. I currently interface with pi using putty via wifi. Any suggestions on what program to use to code esp so that it's compatible with what others have done? How do I figure out what components others have written (e.g. iob calculations etc.) that are available? I see many files on github but can't make heads or tales of what's there...
Dana Lewis
@danamlewis
Sep 15 2015 00:49
Have you installed the oOpenAPS tools yet?
eszcloud
@eszcloud
Sep 15 2015 00:51
yes
Ben West
@bewest
Sep 15 2015 00:51
check out the book
you might look at the discussions in the issues and things here https://github.com/openaps/docs as well, that's where the book comes from, and there's active, ongoing work to make it better
the basic idea is that openaps provides you with nice toolbox, so everything can be done the same way
eszcloud
@eszcloud
Sep 15 2015 00:55
Gotcha. Book was super helpful in getting to this point. There seem to be some leaps at this point that I'm not quite following for making the next step.
Chris Hannemann
@channemann
Sep 15 2015 00:58
Correct, you are at the point where we are getting those steps streamlined and ready for general use
I'm assuming you are talking with your 522 with openaps use commands, correct?
eszcloud
@eszcloud
Sep 15 2015 00:59
Yep, using openaps use commands to communicate with 522 and dexcom
Chris Hannemann
@channemann
Sep 15 2015 01:00
Wonderful; the next thing to do is start running reports
Very similar to use, but you will be generating output JSON files
eszcloud
@eszcloud
Sep 15 2015 01:00
ok
Chris Hannemann
@channemann
Sep 15 2015 01:02
reports are added and then invoked
generating those JSON files will be the core of your loop
eszcloud
@eszcloud
Sep 15 2015 01:04
I seem to be able to generate them. [report add pump-history.json JSON pump iter_pump 100] for example works.
Chris Hannemann
@channemann
Sep 15 2015 01:05
Awesome
And you can see / open that file that was generated?
(and more importantly, that file makes sense compared to your pump history)
Ben West
@bewest
Sep 15 2015 01:22
right, use allows you to practice with getting data and stuff
report allows you to save what you did, for scripting purposes... idea to to "teach" your openaps how to do things by building up a kind of list of recipes/reports, and then running them all in order
the last bit sounds hard, but with a cron job and simple shell script, it's pretty easy, the hard part is getting all the right pieces in place, and that's where a lot of the effort is going
we've been learning all about the kinds of error checking and data preparation that needs to happen
Ben West
@bewest
Sep 15 2015 01:30
report saves your work, use lets your practice getting it right
report add ./path/to/report.json <format> <device> ... the <device> ... part is exact same as openaps use <device> ...
but instead of running the use, it saves the config as a kind of recipe for how to create that file, using the specified format, we tend to like JSON
Ben West
@bewest
Sep 15 2015 01:35
then running the report with openaps report invoke ./path/to/report.json will use the config you specified earlier, this allows running lots of them in sequence very easily
eszcloud
@eszcloud
Sep 15 2015 01:39
gotcha. will work on it! thanks!
Ben West
@bewest
Sep 15 2015 01:40
it's safe to practice towards a "monitoring" loop, that can monitor data from all devices
maybe send it to NS, etc...
you can see how I started building an example one here: https://github.com/bewest/openaps-example
Chris Hannemann
@channemann
Sep 15 2015 01:40
Hey Ben, thoughts on this error:
pi@raspberrypi ~/myopenaps $ openaps iter_pump 1
Traceback (most recent call last):
  File "/usr/local/bin/openaps", line 5, in <module>
    pkg_resources.run_script('openaps==0.0.6', 'openaps')
  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", line 158, 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", line 152, in run
    exit(call(['openaps-%s' % args.command ] + args.args))
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
Ben West
@bewest
Sep 15 2015 01:40
I use the ./monitor/ subdirectory to aggregate all the basic raw info
Chris Hannemann
@channemann
Sep 15 2015 01:40
Oh, nevermind
found it
Ben West
@bewest
Sep 15 2015 01:40
install?
Chris Hannemann
@channemann
Sep 15 2015 01:41
Nah, look at the call
Skipped two important things ... namely, use and pump
flying a bit too fast ;-)
Ben West
@bewest
Sep 15 2015 01:42
hehehe
I see
hmm
hmm
should do what git does
Chris Hannemann
@channemann
Sep 15 2015 01:42
sometimes you run out the door without underwear on ...
Ben West
@bewest
Sep 15 2015 01:42
$ git foobar
git: 'foobar' is not a git command. See 'git --help'.
bewest@hither:~/src/nightscout/cgm-remote-monitor$
Chris Hannemann
@channemann
Sep 15 2015 01:43
Oh yeah, that'd be nice
Icing on the cake that is openaps, but nice
Ben West
@bewest
Sep 15 2015 01:49
done
bewest@hither:~/Documents/foo$ openaps use munge reconcile bad
usage: openaps-use munge reconcile [-h] infile
openaps-use munge reconcile: error: argument infile: can't open 'bad': [Errno 2] No such file or directory: 'bad'
bewest@hither:~/Documents/foo$ openaps snafu
openaps: 'snafu' is not an openaps command. See 'openaps --help'.
Chris Hannemann
@channemann
Sep 15 2015 01:49
Do you have this stuff already completed, just waiting for someone to present it as an issue?
Ben West
@bewest
Sep 15 2015 01:50
no, long practice of trading time for bugs
years of experience knowing which bug fixes can be conflated with features
delay fixing bugs until it's a feature
Chris Hannemann
@channemann
Sep 15 2015 01:50
Haha
Ben West
@bewest
Sep 15 2015 01:51
I just did that after you mentioned it
been thinking about the fuser thing too
Chris Hannemann
@channemann
Sep 15 2015 01:54
I need to find some other "bugs" that I want turned into "features"
Ben West
@bewest
Sep 15 2015 01:55
I have similar tricks planned for the core loop[s]
using openaps itself to generate/maintain the loop, similar to reports
Chris Hannemann
@channemann
Sep 15 2015 01:55
Can't wait to see 'em
Ben West
@bewest
Sep 15 2015 01:55
you'll add reports to phases in a loop
want to add fuser built into the medtronic vendor
Chris Hannemann
@channemann
Sep 15 2015 01:56
intriguing ...
Ben West
@bewest
Sep 15 2015 01:56
maybe even decocare itself
that'd be the best
Ali Mazaheri
@amazaheri
Sep 15 2015 01:56
Sexy!
Ben West
@bewest
Sep 15 2015 01:57
oh... shouldn't do it without similar thing on windows
Ali Mazaheri
@amazaheri
Sep 15 2015 01:57
we are there
Ben West
@bewest
Sep 15 2015 01:57
need to review windows stuff before I get there, too
Ali Mazaheri
@amazaheri
Sep 15 2015 01:57
Windows stuff are easy not much extra code
Ben West
@bewest
Sep 15 2015 01:57
yeah, that was the hope :-)
Ali Mazaheri
@amazaheri
Sep 15 2015 01:57
he he
Friday is hack day
Ben West
@bewest
Sep 15 2015 02:13
looks like @eszcloud took advantage, I regret saying anything, @channemann ;-) openaps/openaps#43
Chris Hannemann
@channemann
Sep 15 2015 02:15
I told him to start filing away!
So many "features" for us to squeeze out of you!
Ben West
@bewest
Sep 15 2015 02:15
lol
can you help him get the raw data?
her?
Chris Hannemann
@channemann
Sep 15 2015 02:16
Gotta get into decocare, don't I?
Ben West
@bewest
Sep 15 2015 02:17
you just did it so well before...
maybe openaps should have a way
Chris Hannemann
@channemann
Sep 15 2015 02:17
Yeah, but now I have to remember something I did?
A week ago!
What am I, magic?
:-)
Ben West
@bewest
Sep 15 2015 02:17
lol
Ben West
@bewest
Sep 15 2015 03:45
wrong link, bewest/decoding-carelink#130
Chris Hannemann
@channemann
Sep 15 2015 03:46
Question for you, @bewest, regarding that raw data
Now that we've changed a bunch of pump settings, it no longer errors on iter_pump 100 because there are a bunch of new records, pushing it over 100
Ben West
@bewest
Sep 15 2015 03:47
hmm, 1000?
Chris Hannemann
@channemann
Sep 15 2015 03:47
If we do the status_quo.sh in decocare, I assume it will run a record pull of 100 (iter_pump defaults to 100)
Ben West
@bewest
Sep 15 2015 03:47
doubtful
Chris Hannemann
@channemann
Sep 15 2015 03:48
Doesn't it say that in the help?
iter_pump Read latest 100 pump records
Ben West
@bewest
Sep 15 2015 03:48
right
but status_quo.sh doesn't do iter_pump at all
I'd go with mm-send-comm.py tweak ReadHistoryPage --save --page $x
Chris Hannemann
@channemann
Sep 15 2015 03:49
How many pages will that read?
Ben West
@bewest
Sep 15 2015 03:49
only the one page, page $x
Chris Hannemann
@channemann
Sep 15 2015 03:50
Ah, so try it on the "last" page then
Is a page some fixed number of records or bytes?
Ben West
@bewest
Sep 15 2015 03:50
think ReadCurPage or something tells how many pages there are supposed to be
yeah, it's 1024 bytes per page
Chris Hannemann
@channemann
Sep 15 2015 03:50
Max is 36 or something
Ben West
@bewest
Sep 15 2015 03:51
yeah, something
Chris Hannemann
@channemann
Sep 15 2015 03:53
ReadHistoryData
Ben West
@bewest
Sep 15 2015 04:14
yes...
yes, that would help... that's what tab completion is for though ;-)
Chris Hannemann
@channemann
Sep 15 2015 04:14
So what we are looking for then is the page where the records end, correct?
Ben West
@bewest
Sep 15 2015 04:14
right
my suspicion is that the original assumption isn't true...
Chris Hannemann
@channemann
Sep 15 2015 04:15
Ah
Ben West
@bewest
Sep 15 2015 04:15
that there's actually a new record or something
Chris Hannemann
@channemann
Sep 15 2015 04:15
How so?
Ben West
@bewest
Sep 15 2015 04:15
the way the history is encoded, the decoding algorithm will still "decode" stuff even if it's wrong, potentially
potentially... as in sometimes you'll wind up with errors
sometimes, errors like the one in the bug
Chris Hannemann
@channemann
Sep 15 2015 04:16
Gotcha
Ben West
@bewest
Sep 15 2015 04:16
it's possible for the parser, when looking up the next record
to be "wrong" in thinking where it "thinks it is"
Chris Hannemann
@channemann
Sep 15 2015 04:16
That's like the problem I had with the exercise marker throwing things off
Ben West
@bewest
Sep 15 2015 04:16
exactly
yeah, sort of
yeah, new record types can be itneresting :-0
Chris Hannemann
@channemann
Sep 15 2015 04:18
Ok, so we should get the full history and the CL CSV to match for ya
What's the easiest way to get the full history? Just leave the --page off?
Ben West
@bewest
Sep 15 2015 04:18
no, easiest way is with like openaps use pump iter_pump 100000 or something
or
Chris Hannemann
@channemann
Sep 15 2015 04:19
But will that spit out the raw somewhere?
Ben West
@bewest
Sep 15 2015 04:19
for x in $(seq 0 32); do mm-send-comm.py tweak ReadHistoryData --save --page $x; done
that'll save each page
assuming you have SERIAL and --init before
or have used openaps recently
Chris Hannemann
@channemann
Sep 15 2015 04:20
Yeah
good there
Ben West
@bewest
Sep 15 2015 04:20
:-)
Chris Hannemann
@channemann
Sep 15 2015 04:20
can we change where it saves?
Ben West
@bewest
Sep 15 2015 04:20
maybe
try --name
or
hmm
Chris Hannemann
@channemann
Sep 15 2015 04:20
trying to make it easy to move 32 pages somewhere
Ben West
@bewest
Sep 15 2015 04:21
--prefix-path
:-)
or mkdir pages; cd pages; for ....
Chris Hannemann
@channemann
Sep 15 2015 04:21
Oh, so it will simply dump them locally
I thought it was saving them somewhere in the decocare path
Ben West
@bewest
Sep 15 2015 04:22
ah, wherever you happen to be
./
decocare is dumb
openaps is smart
sort of
Chris Hannemann
@channemann
Sep 15 2015 04:23
relatively speaking ;-)
Ed Raskin
@msrcgm
Sep 15 2015 04:28
I'm back, and I am currently installing raspbian via usb keyboard and mouse + hdmi cable and my TV
Chris Hannemann
@channemann
Sep 15 2015 04:29
That sounds like the best TV program available right now
I bet folks are lining up outside to watch
Ed Raskin
@msrcgm
Sep 15 2015 04:30
must see TV at my house right now
Ed Raskin
@msrcgm
Sep 15 2015 04:37
boom, raspbian installed. Haha, now what? I guess I move on to config wifi ...
Ben West
@bewest
Sep 15 2015 04:38
nice
Chris Hannemann
@channemann
Sep 15 2015 04:38
Bingo
Ben West
@bewest
Sep 15 2015 04:39
yeah, try to get wifi going so you can ssh to it without the extra stuff
nice job
Ali Mazaheri
@amazaheri
Sep 15 2015 04:39
nice!
should I cancel our meeting :) you rocking it already
Ed Raskin
@msrcgm
Sep 15 2015 04:42
nope -- need major help, part 2 is written in a different language so I'll take the help if you are offering it
Ali Mazaheri
@amazaheri
Sep 15 2015 04:42
I am kidding, we are set for Friday
Ed Raskin
@msrcgm
Sep 15 2015 04:44
Well, at least wifi is set up on my pi right now, but I have no idea how to find it using terminal
Ben West
@bewest
Sep 15 2015 04:44
aha, great
if you're using mac, you can use apple-space and type "Terminal"
Ed Raskin
@msrcgm
Sep 15 2015 04:45
haha! it worked!
do I need to always leave the sd card in the pi?
Ali Mazaheri
@amazaheri
Sep 15 2015 04:46
yes
Ed Raskin
@msrcgm
Sep 15 2015 04:46
or am i done with it now that raspberian is loaded?
got it
Ben West
@bewest
Sep 15 2015 04:46
the whole thing lives on that little sd card
Ali Mazaheri
@amazaheri
Sep 15 2015 04:47
we make a copy of ur sd on second sd as backup
Friday
Ben West
@bewest
Sep 15 2015 04:48
ssh pi@raspberrypi.local
Ed Raskin
@msrcgm
Sep 15 2015 04:53
@bewest yep -- that command all of a sudden worked.
I'm in
Ed Raskin
@msrcgm
Sep 15 2015 05:00
now it won't work ... I think I know the problem. I have one network at home but powered by 1 router and three extenders. Right now the Pi is connecting through the extender downstairs (via wifi) and I am upstairs (also via wifi), is that my problem?
Edwards-MacBook-Air:~ ebraskin$ ssh pi@raspberrypi.local
ssh: connect to host raspberrypi.local port 22: Operation timed out
Chris Hannemann
@channemann
Sep 15 2015 05:08
Could be; can you get on the same network?
Ben West
@bewest
Sep 15 2015 05:08
extender should be ok
is it on?
you have no idea how many times I've tried to use a device that's off
Ali Mazaheri
@amazaheri
Sep 15 2015 05:09
the other thing is sd card may be pushed out by accident
Ed Raskin
@msrcgm
Sep 15 2015 05:12
I'm on the same network and can see an ip address of 10.0.1.21 through airport utility.
on and running
Ed Raskin
@msrcgm
Sep 15 2015 05:18
Is the problem that I left the pi running in the graphical user interface mode?
Ben West
@bewest
Sep 15 2015 05:25
hmmm, shouldn't be
ssh command was working a while ago or no?
Ed Raskin
@msrcgm
Sep 15 2015 05:26
Seemed like it worked. Then moved upstairs ....
Ben West
@bewest
Sep 15 2015 05:32
hmm, not sure, depending on how the wifi is setup it's conceivable there could be an issue
not sure how airport works
ah, if there's an option for "bridge" networking vs "host only" or similar options, that might help
sometimes there's a few options for "bridge" vs "host" vs NAT
Jason Calabrese
@jasoncalabrese
Sep 15 2015 07:12
Monitor, Predict, Control.png
@bewest, @amazaheri, some ideas for a CWD slide
Chris Hannemann
@channemann
Sep 15 2015 07:13
Classy
You could take that slide to a black tie only event
Jason Calabrese
@jasoncalabrese
Sep 15 2015 07:15
:)
Ben West
@bewest
Sep 15 2015 07:31
:heart: it
Scott Leibrand
@scottleibrand
Sep 15 2015 07:39
Also, if you have trouble connecting via raspberrypi.local, try the IP address instead. I have had no end of issues with mDNS.
^^ @msrcgm
Ben West
@bewest
Sep 15 2015 08:24
interesting, resin.io is looking really really compelling
blob
might allow treating embedded linux like NS style installs
could really ease full-bore monitoring -> diyps -> openaps step-wise progression
Jason Calabrese
@jasoncalabrese
Sep 15 2015 08:27
thats for the edison?
Ben West
@bewest
Sep 15 2015 08:28
AND rpi
and few others, too
enter your wifi password on their dashboard
they give you download with it burned into config
it's instantly reporting to their dashboard, shows up
wish we had this instead, when we were doing NS early on
could have saved a lot of batteries flashing image with root support
I think once it's reporting to resin.io, they can do OTA updates
looks like they support Dockerfile apps
so, stuff openaps in Dockerfile, mount the openaps.ini in a "volume", and good to go :-)
Nathan Racklyeft
@loudnate
Sep 15 2015 14:19
I wrote a dockerfile for openaps a while back... It needs to handle installing dependencies, mounting the USB interfaces, and mapping /var/log
Ed Raskin
@msrcgm
Sep 15 2015 16:25
@bewest @amazaheri and anyone else that is curious, as soon as I moved downstairs, ssh pi@raspberrypi.local worked. Looks like it cares which router my macbook and my pi are connecting to even though it is one extended network.
Ali Mazaheri
@amazaheri
Sep 15 2015 16:54
good to hear! but I suggest figure out the issue so that you can connect to pi for troubleshooting regardless of your location.
Great progress @msrcgm see now you should buy yourself a macallan 18 :) btw please update the document with your feedback (Remember your assignment :smile: )
also there are plenty of apps allowing you to SSH to Pi from iPhone
handy for troubleshooting
I use my phone to manage and troubleshoot Pi %99 of the time
Ed Raskin
@msrcgm
Sep 15 2015 16:58
Screen Shot 2015-09-15 at 9.42.23 AM.png
ok, now on the watchdog setup. Stuck here
Ed Raskin
@msrcgm
Sep 15 2015 16:59
Mac18 is better shared with friends
I have no idea how to edit the document
Ali Mazaheri
@amazaheri
Sep 15 2015 16:59
I dont have the watchdog installed myself, lets see if anyone can chime in,
oh
use nano
Ed Raskin
@msrcgm
Sep 15 2015 17:00
What's nano
Ali Mazaheri
@amazaheri
Sep 15 2015 17:00
simple editor
oh
u mean the github
docs
just submit a PR
Ed Raskin
@msrcgm
Sep 15 2015 17:01
I have no idea how to submit a PR
Ali Mazaheri
@amazaheri
Sep 15 2015 17:01
@danamlewis how do you want @msrcgm to update, provide feedback
need to jump on a call will be back
Ed Raskin
@msrcgm
Sep 15 2015 17:02
maybe you can show me on Friday -- I think I just need a little bit of basic tutoring
Dana Lewis
@danamlewis
Sep 15 2015 17:03
Forget macallen whatever. @msrcgm Is going to get charged a cold diet coke every time he says "I don't know how to ". :) need to change mindset to "how do I"?
Walking to work but if no one beats me to it, will share some basics on PRs
Ed Raskin
@msrcgm
Sep 15 2015 17:28
A YouTube video would work too. @danamlewis, just to clarify, I didn't say "I don't know how to", I said "I have no idea how to" ... huge difference :smile:
@danamlewis "How do I .... fix this problem I am getting when trying step 2 of the watchdog setup? : pi@raspberrypi ~ $ sudo modprobe bcm2708_wdog
libkmod: ERROR ../libkmod/libkmod.c:554 kmod_search_moddep: could not open moddep file '/lib/modules/3.18.11-v7+/modules.dep.bin'
Dana Lewis
@danamlewis
Sep 15 2015 17:44
yea, I'm a reader so I tend to go for written guides but YT would work if you find one :) This is the good writeup on PR: https://help.github.com/articles/creating-a-pull-request/ but first you need to fork the docs.
So go here: https://github.com/openaps/docs and look for the fork button in the top right corner. That will enable you to 'fork' or create your own copy
(And touche :) on what you said) I haven't seen that error before, going to flag @channemann or @bewest on that one
You could also try googling on installing watchdog to see if you find anything before they show up with ideas
Re: forking copy. After you fork, go to your repository and view your copy of the docs (should stay "docs"). Start clicking in until you find the file you want to edit. (so like docs, setup, rPi.md) Once you open the correct page, there's an edit button in the almost top right that will enable you to make edits. Make all of your edits, and then scroll to the bottom and hit merge. That will just merge them/save them to your docs. So you can keep doing that (editing as you work through the setup) and merging with yourself so you don't lose any changes.
Dana Lewis
@danamlewis
Sep 15 2015 17:50
Once you're done and ready to say "hey world! come review my changes and possibly incorporate them", that's when you do a PR back to the main openaps/docs and use the PR guide I linked above (following the trail of green buttons when you do it, as @bewest likes to say). That will flag those changes for us to review (we usually have 2+ people review a set of changes before accepting, or otherwise suggesting or making additional edits) and incorporate them back to the master doc file
And my favorite thing that @bewest told me is that it's hard to break things - so when you're done making your edits, try tdoing a full PR and see if you can do it w/out help, because you won't be able to break anything :) so it's a good testground without fear of anything going wrong
hey @jasoncalabrese , I really like that slide visualization!
Ed Raskin
@msrcgm
Sep 15 2015 18:20
@danamlewis @bewest , I may or may not have created a PR to the hardware portion of the document. Please let me know how I did.
Dana Lewis
@danamlewis
Sep 15 2015 18:36
Hm, I don't see that. you might have done a PR to yourself. Send a screenshot of what you see?
Ben West
@bewest
Sep 15 2015 20:18
@loudnate not sure what this does https://hub.docker.com/r/resin/edison-python/, there's similar for rpi as well
Chris Hannemann
@channemann
Sep 15 2015 23:39
re: watchdog, I actually don't know a ton about that; it was part of @diabeticgonewild's write up. I don't have it running on my system at the moment.
Ali Mazaheri
@amazaheri
Sep 15 2015 23:41
agree at this point I wouldnt worry about watchdog. Its a goodto have option but I am not running it either.
Dana Lewis
@danamlewis
Sep 15 2015 23:48
Ok. I'll pr and note as optional, and maybe Ben will fix my formatting on this too ;)
Dana Lewis
@danamlewis
Sep 15 2015 23:53
So @msrcgm Watchdog is not a requirement and you can move on to trying installing openAPS tools :)
but it didn't see your pr in hardware come throufh
Ed Raskin
@msrcgm
Sep 15 2015 23:56
I think I figured out how to do it via to compare forks method. Can you see my changes to hardware now?
Dana Lewis
@danamlewis
Sep 15 2015 23:58
Just came through! Congrats on your first PR @msrcgm :) will review now