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

7th
Nov 2015
Ben West
@bewest
Nov 07 2015 01:02
things work better when openaps is working, and with a good sensor
blob
and when pump is not accidentally suspended for 2+ hours
Ben West
@bewest
Nov 07 2015 02:49
if anyone could give rileylink for a spin, I'd appreciate it :-)
openaps add vendor mmblelink.vendors.mmblelink
the use commands are same as medtronic
Jason Calabrese
@jasoncalabrese
Nov 07 2015 03:23
Would need a ble dongle for the pi?
Or maybe Linux vm on osx?
Ben West
@bewest
Nov 07 2015 03:28
should work on osx native
osx has python 2.7 on it I think
should work just fine
if you can get ble driver installed
if gatttlib installs, you're great
for pi, it needs a ble dongle I think :-(
Milos Kozak
@MilosKozak
Nov 07 2015 09:25
@danamlewis happy you like it
Oskar Pearson
@oskarpearson
Nov 07 2015 10:01
@bewest I'm making our rileylink today. If all goes well with it, I'll test out the mmblelink stuff tonight! Seems like great stuff to me.
Was looking through the git code a moment ago
Have you tried it from an Edison? I'm interested as to whether the Bluetooth stack there includes everything
Lori
@LoriLori
Nov 07 2015 12:11
report look so good I might need to setup NS :+1:
Tim Howard
@tghoward
Nov 07 2015 12:21
Don't understand why this openaps use works but not the 'openaps report' Must be missing something
pi@betacb ~/bcb-s $ openaps use tz clock monitor/clock.json
"2015-11-07T05:51:00-05:00"pi@betacb ~/bcb-s $ 
pi@betacb ~/bcb-s $ openaps report add monitor/clock-zoned.json JSON tz clock monitor/clock.json
added tz://JSON/clock/monitor/clock-zoned.json
pi@betacb ~/bcb-s $ openaps report invoke monitor/clock-zoned.json
tz://JSON/clock/monitor/clock-zoned.json
monitor/clock-zoned.json  raised  tzinfo argument must be None or of a tzinfo subclass, not type 'str'
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.0.7', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-18.4-py2.7.egg/pkg_resources/__init__.py", line 735, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-18.4-py2.7.egg/pkg_resources/__init__.py", line 1652, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.7-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.7-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.7-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.7-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.7-py2.7.egg/openaps/uses/use.py", line 39, in __call__
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.5-py2.7.egg/openapscontrib/timezones/__init__.py", line 82, in main
    results = self.convert(inputs)
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.5-py2.7.egg/openapscontrib/timezones/__init__.py", line 94, in convert
    program = self.rezone(parse(program)).isoformat( )
  File "/usr/local/lib/python2.7/dist-packages/openaps_contrib-0.0.5-py2.7.egg/openapscontrib/timezones/__init__.py", line 64, in rezone
    dt = dt.replace(tzinfo=self.timezone) # .astimezone(self.timezone)
TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'str'
pi@betacb ~/bcb-s $
Tim Howard
@tghoward
Nov 07 2015 12:31
ugly hack
openaps alias add zone-clock '! bash -c "(openaps use tz clock monitor/clock.json) > monitor/clock-zoned.json"'
Ali Mazaheri
@amazaheri
Nov 07 2015 13:25
@tghoward had the same issue, install openaps from dev and it will fix that @bewest time to release hehe
Tim Howard
@tghoward
Nov 07 2015 13:27
@amazaheri thanks. Will try.
@amazaheri are you currently pushing to NS from oref0?
Tim Howard
@tghoward
Nov 07 2015 13:40
woohoo! Installling openaps from dev did the trick. Thanks @amazaheri Don't need my hack alias anymore
Ali Mazaheri
@amazaheri
Nov 07 2015 18:31
I do
but I use Azure :)
@tghoward this explains what I have http://blogs.msdn.com/b/alimaz/archive/2015/08/23/azure-logic-apps-azure-sql-and-openaps-better-together.aspx in a nutshell I post information to a webapi feeding Azure SQL and NS Mongo in one shot and I use the Azure SQL for Power BI reporting and push notification to my phone and MS Band. Same process update the treatments and Basal visualization on NS. This way if CRM is down I still have a plan B to get notification
@tghoward we owe @bewest a beer, he saved me yesterday :)
Mark Wilson
@mddub
Nov 07 2015 18:37
@danamlewis awesome post! nice treatment of why people need to customize their tools to fit their life. don't mind at all if you include my watchface teaser
Scott Leibrand
@scottleibrand
Nov 07 2015 18:38
Does she have the link to the teaser already? Don't recall if I ever saw it.
Mark Wilson
@mddub
Nov 07 2015 18:42
oh, there's no link other than that image
it does live at https://github.com/mddub/nightscout-graph-pebble for now but i wouldn't consider that published yet, may change the name
assumed she was asking if the image is public as an illustration of customizing; the code being public as an actual product makes more sense...
Scott Leibrand
@scottleibrand
Nov 07 2015 18:44
no, I think she was asking about the image
I just haven't seen it yet I don't think
Ben West
@bewest
Nov 07 2015 18:46
yeah, time to cut releases
Tim Howard
@tghoward
Nov 07 2015 18:46
@amazaheri yep, we definitely owe people beer. Many.
Ali Mazaheri
@amazaheri
Nov 07 2015 18:47
@mddub slick!
Scott Leibrand
@scottleibrand
Nov 07 2015 18:50
nice!
Mark Wilson
@mddub
Nov 07 2015 18:50
thanks :)
if anyone is particularly eager, you can replace the iob line on the bottom with whatever you want here https://github.com/mddub/nightscout-graph-pebble/blob/master/src/js/main.js#L24
Scott Leibrand
@scottleibrand
Nov 07 2015 18:51
if we could get some openaps info on there, that could easily replace all our current text-heavy watchfaces
Mark Wilson
@mddub
Nov 07 2015 18:51
@scottleibrand that's the kind of use case i have in mind
Scott Leibrand
@scottleibrand
Nov 07 2015 18:51
I would probably want to make the time tiny and put some more text in
heck, it looks like you have the resolution to do the NS city skyline / icicle basal display
I thought that would take an Apple Watch
Mark Wilson
@mddub
Nov 07 2015 18:52
yeah, a decent basal vis would only require a few vertical pixels, graph also doesn't really need to be that tall
Scott Leibrand
@scottleibrand
Nov 07 2015 18:53
or it can be tall, but have text overlaid (if Pebble supports that)
Mark Wilson
@mddub
Nov 07 2015 18:53
yeah, anything can draw on anything
Scott Leibrand
@scottleibrand
Nov 07 2015 18:53
nice
Ali Mazaheri
@amazaheri
Nov 07 2015 18:54

IoMT :)

Mark Wilson
@mddub
Nov 07 2015 18:54
i was going to just use tick marks along the bottom x axis to indicate positive changes in iob
from my connect
Jason Calabrese
@jasoncalabrese
Nov 07 2015 19:26
think I really made a mess of my pi trying to get things updated
Nov 7 19:26:28 raspberrypi Stick transmit[TransmitPacket:ReadPumpModel:size[64]:data:''] reader[ReadRadio:size:14] download_i[6] status[<LinkStatus:0x03:status:size=??LinkStatus:error:True:reason:[]:size(0)>] poll_size[0] poll_i[False] command[<LinkStatus:0x03:status:size=??LinkStatus:error:True:reason:[]:size(0)>]:download(attempts[6],expect[0],results[0]:data[0]):BAD AILING
was trying to update setuptools, but don't know the python dev tools
Ben West
@bewest
Nov 07 2015 19:28
try unplug/replug stick
or distance to pump
Dana Lewis
@danamlewis
Nov 07 2015 19:31
Thanks @mddub ! Yes, was just going to link text to the image :) so will do that!
Jason Calabrese
@jasoncalabrese
Nov 07 2015 19:33
oh, think the battery was just really low
John Males
@johnmales
Nov 07 2015 19:49
Can you specify which branch to install when installing from pypi? Or do you have to install from source if you want the Dev branch?
Ben West
@bewest
Nov 07 2015 19:49
yes
there's a hint recorded in the setup.py's
right now, it's : sudo easy_install -ZU https://github.com/openaps/openaps/tarball/wip/pass-stdin#egg=openaps-0.0.8-dev-1
it'd be super nice if someone made a tool that printed the right magic url
query github api for branches, format the url, print the results, pypi depends on specially formatted url
the # stuff is significant
Jason Calabrese
@jasoncalabrese
Nov 07 2015 19:51
running sudo python setup.py develop from a clone in the right branch works too right?
Ben West
@bewest
Nov 07 2015 19:52
yes
Jason Calabrese
@jasoncalabrese
Nov 07 2015 19:52
think it worked for me, says I have 0.0.8 now
Ben West
@bewest
Nov 07 2015 19:52
from source/git, it's just python setup.py develop
right
openaps --version should report 0.0.8 regardless
Jason Calabrese
@jasoncalabrese
Nov 07 2015 19:53
I'm probably making things hard on myself, had it setup using forks, then cloned those to the pi
Ben West
@bewest
Nov 07 2015 19:53
lot more HEADs to juggle
github's UI doesn't make the social part of this all that easy
would be really nice to say "every month, make sure my fork is up to date with the author"
Jason Calabrese
@jasoncalabrese
Nov 07 2015 19:55
I just do a pull, like git pull git@github.com:openaps/openaps.git dev
John Males
@johnmales
Nov 07 2015 19:55
Ok thanks. That url doesn't seem intuitive, I have been doing what @jasoncalabrese has been doing
Ben West
@bewest
Nov 07 2015 19:56
@johnmales @amazaheri used that command yesterday to get his up to date without using clones/forks
yeah the git commandline makes it relatively easy
assuming you find git easy to begin with
Jason Calabrese
@jasoncalabrese
Nov 07 2015 19:57
easy for the things I do often
John Males
@johnmales
Nov 07 2015 19:58
I'm more in the camp from xkcd cartoon someone one showed a while back
Ben West
@bewest
Nov 07 2015 20:00
git came along right when I was super frustrated with cvs, svn and perforce (p4)
bzr looked odd/unpopular, mercurial/hg looked good, but then git just did everything the way my brain actually worked instead of some weird awful way
without lots of plugins, just by default
John Males
@johnmales
Nov 07 2015 20:09
It's just a lack of familiarity on my part. Clearly it is a very powerful tool. In my day job I do a lot of presentations, often they are similar but get incrementally improved or changed for different groups. I would love to have a tool like git to be able to manage the different versions of my talks, would be so useful. I have tried using markdown or similar text files and then generating the talks but pretty limiting in terms of the presentations you can make. Anyway my long way of saying git is a tool that has really opened my eyes to a way of managing incremental changes in files, very powerful.
Ben West
@bewest
Nov 07 2015 20:12
you need some custom pandoc templates with makefile for that
Ben West
@bewest
Nov 07 2015 20:20
if there was a tool to print the magic urls of various kinds, that would make typing a lot easier
git clone $(oref0-config clone openaps dev) vs easy_install -ZU $(oref0-config ghpypi openaps dev)
John Males
@johnmales
Nov 07 2015 20:23
Pandoc looks interesting I'll have a look at it
eyim
@eyim
Nov 07 2015 20:43

I'm trying to implement the oref0 stuff. I know I need to add virtual devices for the oref0 tools but can't find the commands on how to do so. I see this in some people's openaps.ini file but not sure how to get it done

[device "iob"]
fields = history profile clock
cmd = /usr/local/bin/oref0
vendor = openaps.vendors.process
args = calculate-iob

any help would be appreciated

Ben West
@bewest
Nov 07 2015 20:51
openaps add device iob process --require 'history profile clock' oref0 calculate-iob
Jason Calabrese
@jasoncalabrese
Nov 07 2015 21:07
ok, updated openaps and switched to oref0
now to reorganize things
Ali Mazaheri
@amazaheri
Nov 07 2015 21:13
I personally rather use git for oref0 and use easy_install for openaps and deco stuff on PI. I use hit only cause I usually make changes to js stuff and update that with repo but rarely change python stuff and let @bewest deal with them 😊
Scott Leibrand
@scottleibrand
Nov 07 2015 21:27
@eyim we have lots more examples of syntax if you get stuck on any of the others.
eyim
@eyim
Nov 07 2015 21:33
thank you!
John Males
@johnmales
Nov 07 2015 21:34
How does the --require 'history profile clock' oref0 part of the statement work? Will this call oref0 and look for the files history.json etc? Or am I way off?
Jason Calabrese
@jasoncalabrese
Nov 07 2015 21:37
Screen Shot 2015-11-07 at 1.36.59 PM.png
reorganized my repo
eyim
@eyim
Nov 07 2015 21:37
Just for the record looks like the command needed is openaps device add iob process --require 'history profile clock' oref0 calculate-iob rather than openaps add device
Jason Calabrese
@jasoncalabrese
Nov 07 2015 21:42
@johnmales the --require sets the fields the device needs, then you set those to the file paths when you define the report
John Males
@johnmales
Nov 07 2015 21:43
@jasoncalabrese ahh of course device then report
Jason Calabrese
@jasoncalabrese
Nov 07 2015 21:44
I have this
[report "02.predict/iob.json"]
profile = 02.predict/profile.json
use = shell
clock = 01.monitor/clock.json
reporter = text
device = calculate-iob
history = 01.monitor/pump-history.json
with the device
[device "calculate-iob"]
fields = history profile clock
cmd = oref0-calculate-iob
vendor = openaps.vendors.process
args =
in the command above I think it might be missing a - between oref0 and calculate-iob
eyim
@eyim
Nov 07 2015 21:46
@jasoncalabrese hi Jason - what is the cmd that you used to create the 02.predict/iob.json report?
Jason Calabrese
@jasoncalabrese
Nov 07 2015 21:46
think I've got into a bad habit of only editing the ini instead of using the tool
think it's openaps device add iob process --require 'history profile clock' oref0-calculate-iob
eyim
@eyim
Nov 07 2015 21:47
i've starting do that as well - almost easier but since I am just starting out I want to be sure I understand how I am suppose to do it. Thank you
that is the command for adding the device. I was trying to figure out how to add that report where we define the inputs like where to go find clock reporter history etc
Jason Calabrese
@jasoncalabrese
Nov 07 2015 21:49
those are the output of running a report
can be just a file name, I was basing mine off of Ben's example, but changed the name of the directories
to fit the monitor-predict-control
I'm not running for real yet, so be extra careful copying me
Scott Leibrand
@scottleibrand
Nov 07 2015 21:57
openaps device add iob process --require "pumphistory profile clock" oref0 calculate-iob
You can calculate IOB using the oref0 calculate-iob command (which you defined in the iob device earlier) to update monitor/iob.json based on the updated pump history, profile, and pump clock. That report would look something like openaps report add monitor/iob.json text iob shell monitor/pumphistory.json settings/profile.json monitor/clock.json.
Jason Calabrese
@jasoncalabrese
Nov 07 2015 22:00
I thought the last option was the cmd thats used in the device
that sets use to oref0 instead of shell?
eyim
@eyim
Nov 07 2015 22:02
got it. so basically the required inputs of (history clock profile) are at the end of the add report command and you put the inputs in the order that they are listed in the ini file.
Scott Leibrand
@scottleibrand
Nov 07 2015 22:02
Yaup
eyim
@eyim
Nov 07 2015 22:03
:)
John Males
@johnmales
Nov 07 2015 22:38
Is there a script / command to change my read_bg_targets.json from mmol/L to mg/dL? oref0 understandbly threw an error about this.
Tim Howard
@tghoward
Nov 07 2015 22:40
Hi all. I'm working on posting to nightscout. I've managed to get glucose data up.
My attempt at treatment data is failing
nightscout cull-latest-openaps-treatments monitor/pumphistory-zoned.json settings/model.json "2015-11-07T10:25:00-0500" > upload/test.json
pi@betacb ~/bcb-s $ ns-upload $NIGHTSCOUT_HOST $API_SECRET treatments.json upload/test.json
Cannot POST /api/v1/treatments.json
Maybe I'll try to break it down to only one or two records next
Jason Calabrese
@jasoncalabrese
Nov 07 2015 22:49
my first openaps PR openaps/oref0#19
@tghoward maybe you're hostname isn't getting included
Tim Howard
@tghoward
Nov 07 2015 22:52
@jasoncalabrese is that the typical problem with "Cannot POST"?
records were missing "_id":
But that didn't seem to do it.
Jason Calabrese
@jasoncalabrese
Nov 07 2015 23:03
The _id would be added on the server
Tim Howard
@tghoward
Nov 07 2015 23:04
are there any required fields? Can't tell from ...api-docs.html
Jason Calabrese
@jasoncalabrese
Nov 07 2015 23:05
Try doing it without the env vars, and just hard code the host and secret
You have the api secret set on your server?
Tim Howard
@tghoward
Nov 07 2015 23:06
I am uploading profile data and glucose data ok (not perfectly, but at least the data are going up)
so I think that means the env vars are ok. But, good Idea, I'll try hard coding
Scott Leibrand
@scottleibrand
Nov 07 2015 23:14
Also try the curl manually
the one ns-upload does
Tim Howard
@tghoward
Nov 07 2015 23:28
Ah, ok.