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

12th
Feb 2016
Scott Leibrand
@scottleibrand
Feb 12 2016 00:00
@jmatheson * * * * * cd /home/pi/openaps-mmeow && oref0-reset-git
it won't do anything if a git status succeeds
Jim Matheson
@jmatheson
Feb 12 2016 00:05
made the mistake of taking it for name value :)
Jason Curry
@mccgm
Feb 12 2016 00:06
So, I have manually run the aliases for upload of my zoned pump history to NS and got a successful vizualization on NS. Since then I cannot replicate it. I keep getting
errypi:~/ayeletssail $ openaps upload-recent-treatments
json: error: input is not JSON: Unexpected '<' at line 1, column 1:
        <head><title>Document Moved</title></head>
        ^
json: error: input is not JSON: Unexpected '<' at line 1, column 1:
        <head><title>Document Moved</title></head>
        ^
json: error: input is not JSON: Unexpected '<' at line 1, column 1:
        <head><title>Document Moved</title></head>
        ^
No recent treatments to upload
pi@raspberrypi:~/ayeletssail $ cd
Anyone have any idea what the deal is?
Jim Matheson
@jmatheson
Feb 12 2016 00:07
looks like your json has html in it
so when it gets to the < at the start of that document moved line it realizes something is wrong
so looks like the treatments file has an issue.
Jason Curry
@mccgm
Feb 12 2016 00:09
My zoned pump history is in my directory, so there ARE recent treatments to upload...I can see them. No html is present
Scott Leibrand
@scottleibrand
Feb 12 2016 00:09
it's the response from NS that has the html
you may not be passing your API secret or NIGHTSCOUT_HOST correctly?
Jason Curry
@mccgm
Feb 12 2016 00:10
Kills me that I did it once successfully, and nothing has changed
Scott Leibrand
@scottleibrand
Feb 12 2016 00:10
try running the command manually
the ns-upload-treatments or whatever it is that your openaps upload-recent-treatments alias runs
Jason Curry
@mccgm
Feb 12 2016 00:11
Running each one manually is what gives me that result.
Scott Leibrand
@scottleibrand
Feb 12 2016 00:12
I mean step another level in: do manually the thing that openaps upload-recent-treatments does
Jason Curry
@mccgm
Feb 12 2016 00:15
Hmm. The alias grabs the time, model and formats the treatments. All those aliases. When I manually run those aliases, I get the same error
I guess I was seeing if anyone had seen that error before and had some clue as to what it meant. If not, that's ok, I'll keep digging.
Jim Matheson
@jmatheson
Feb 12 2016 00:16
i have seen it before
i forget how i fixed it. I think it may be because i moved something. renamed a folder or path. also make sure your env vars are set both in .profile and your cron
Jason Curry
@mccgm
Feb 12 2016 00:18
usually I have seen a lack of inv vars return a different error.
Scott Leibrand
@scottleibrand
Feb 12 2016 00:28
I think we've all seen it at some point, and it was something simple, but without drilling down to the actual command it's hard to say what exactly
Jason Curry
@mccgm
Feb 12 2016 00:29
Got it
Jim Matheson
@jmatheson
Feb 12 2016 00:30
great
what was it?
I am in troubleshooting section of docs right now and can add it as a PR for when it comes up again.
Jason Curry
@mccgm
Feb 12 2016 00:33
Sorry, I meant "got it" like "OK, nobody has the quick and easy answer for me, so back to the shell"
Jim Matheson
@jmatheson
Feb 12 2016 00:33
damn
Jason Curry
@mccgm
Feb 12 2016 00:38
I'm thinking it's an issue with azure
Jim Matheson
@jmatheson
Feb 12 2016 00:40
agree. make sure all the places you reference your azure url have the url and api key correct (and hashed).
depending on your setup, they could live in several places in ~/.profile, top of cron or in any your .ini files
eyim
@eyim
Feb 12 2016 00:56
Try making sure you have https:// (do the secure not http). That stumped me for a while
Ben West
@bewest
Feb 12 2016 01:01
Jim Matheson
@jmatheson
Feb 12 2016 01:24
how do i try it out?
Ben West
@bewest
Feb 12 2016 01:24
hmm
if you clone it, it should install itself mostly-ishi from sudo python setup.py develop
then openaps-dbus --ini_home ./path/to/my/openaps
oh
hmmm
might run openaps schedule add do-everything "every 5 minutes" or similar
Jim Matheson
@jmatheson
Feb 12 2016 01:29
No module named recurrent
Ben West
@bewest
Feb 12 2016 01:29
ah thanks :-D
sudo easy_install -ZU recurrent till I get that
Jim Matheson
@jmatheson
Feb 12 2016 01:31
need $DISPLAY ?
tried export DISPLAY=:0
but getting erros after that
do i need to run that schedule first?
error is dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally without any error message
Ben West
@bewest
Feb 12 2016 01:36
hmm, interesting
Jim Matheson
@jmatheson
Feb 12 2016 01:37
thinking i must be missing something else as well
Ben West
@bewest
Feb 12 2016 01:37
dbus-launch --exit-with-session openaps-dbus --ini_home ./path/to/my/openaps
yeah, add schedule first or you'll have to stop/restart the daemon
Jim Matheson
@jmatheson
Feb 12 2016 01:46
need to install dbus-launch as well
Ben West
@bewest
Feb 12 2016 01:53
hmm
Jim Matheson
@jmatheson
Feb 12 2016 01:59
do i need to be connected via console?
Ben West
@bewest
Feb 12 2016 02:02
to launch it?
no, it expects to connect to d-bus' "session" bus
if you log in via ssh, and there's no desktop session, I'm not sure how to get it started on boot, I guess
Jim Matheson
@jmatheson
Feb 12 2016 02:10
yeah i am just sshing into my edison
Any SF / Bay Area folks that are not on the thread re the upcoming meetup and want to be this time or in the future….PM me
Dana Lewis
@danamlewis
Feb 12 2016 02:13
can you add me, just since i'll be down there periodically?
Ben West
@bewest
Feb 12 2016 02:19
dbus-launch on it's own errors?
Ben West
@bewest
Feb 12 2016 02:25
seems to work ok
hmm
well some errors
Jim Matheson
@jmatheson
Feb 12 2016 02:46
i don’t have dbus-launch at all. i tried to install dbus but i guess that did not include dbus-launch.
needed sudo apt-get install dbus-x11
Jason Calabrese
@jasoncalabrese
Feb 12 2016 02:53
x11?
Jim Matheson
@jmatheson
Feb 12 2016 02:53
no idea what that is, just read that is where dbus-launch is if you need it
Jason Calabrese
@jasoncalabrese
Feb 12 2016 02:54
is it a gui?
looks like there's a lot to dbus
Jim Matheson
@jmatheson
Feb 12 2016 02:59
@bewest seems like it is running now in the foreground
lots of skipped 2016-02-11 19:02:17 do-everything /org/openaps/Services/Instance/Schedule0
then occasionally some other things
Ben West
@bewest
Feb 12 2016 03:00
yeah
Jim Matheson
@jmatheson
Feb 12 2016 03:00
and some errors
Ben West
@bewest
Feb 12 2016 03:00
mostly working it sounds like
so do-everything, it should try to run openaps do-everything whatever your schedule set it at
Jim Matheson
@jmatheson
Feb 12 2016 03:02
what exactly does that do :smirk: ?
i used your example openaps schedule add do-everything "every 5 minutes” but i am not sure what this is. did it suck in everything from my openaps.ini and it’s just going to run everything?
Scott Leibrand
@scottleibrand
Feb 12 2016 03:05
I think he's assuming you would create an alias called do-everything that the schedule would run
so you could replace do-everything with whichever alias cron runs today
Jim Matheson
@jmatheson
Feb 12 2016 03:09
i see
how do you review what you’ve scheduled?
Jim Matheson
@jmatheson
Feb 12 2016 03:15
I don’t think i have it quite working, but here’s the steps I took on the way to get this far. In case we need a consolidated list. Some items may not be required in the end
cd ~/src
git clone https://github.com/openaps/oacids
sudo python setup.py develop
sudo easy_install -ZU recurrent
sudo apt-get install dbus-x11
export DISPLAY=:0
openaps schedule add do-everything "every 5 minutes"
dbus-launch --exit-with-session openaps-dbus --ini_home .
running them one at a time
does it have the ability do run at particular clock minutes? I tend to use things 1-59/5 so i can time things after I know a bg is avail to grab from NS, etc
not sure it is easier once you know cron, but certainly will be easier for folks without experience and easier to include in documentation
Ben West
@bewest
Feb 12 2016 03:39
that's coming but will handled differently
for now I'm strongly recommending we keep things simple and run a bunch of commands in serial
to handle that kind of thing, oacids will start introducing signals and events
Dana Lewis
@danamlewis
Feb 12 2016 03:45
@bewest What does o-acids stand for?
Ben West
@bewest
Feb 12 2016 03:45
I think
$ openaps schedule add -n foobar "every 5 minutes at 1am"
No handlers could be found for logger "recurrent"
added schedule://foobar/RRULE:BYMINUTE=0;FREQ=MINUTELY;BYHOUR=1;INTERVAL=5
might do what you want
I haven't decided, but there's no dash
something like openaps continuous insulin delivery system maybe
or continuous information decentralized system
something along those lines
that should align it to whole minutes, rather than at the top of the second
Dana Lewis
@danamlewis
Feb 12 2016 03:46
The dash is my illustration of my current pronunciation :)
Ben West
@bewest
Feb 12 2016 03:47
hehe
this is the daemon
new openaps schedule tool allows managing schedule in openaps directly
Dana Lewis
@danamlewis
Feb 12 2016 03:47
Ya. Appreciated that explanation earlier :)
Ben West
@bewest
Feb 12 2016 03:48
also, this design opens bunch of doors... ble, gui, etc
this system can be queried to ask what's running right now, what's scheduled to run soon, etc
Jason Calabrese
@jasoncalabrese
Feb 12 2016 03:58
It's a single process? 1 thread?
Ben West
@bewest
Feb 12 2016 04:04
hmm, no, sort of
python itself has a global interpreter lock, so only one piece of python code can be managed at time, technically
I'm using glib's bindings to dbus, which itself is threaded using gnome's toolkit
on top of that, I use an additional spare worker thread managed by python which consumes jobs off a queue
so anything can use the Do interface, and it won't interfere with already running commands
when the scheduler finds a schedule with an event in the upcoming window, it schedules them, which puts on them on dbus for inspection
that basically arms a trigger, and puts the trigger up on dbus
a timeout fires, which fires the trigger
when the trigger fires, it uses the new Do interface to add operations to the queue
right now it's important that no operations interrupt others, I think that's a likely source of git corruption
so using glib, I'm setting up various timeouts, a heartbeat (default every second) that scans for events to be scheduled inside the upcoming window (hearbeat_interval * 5)
glib must be using threads to manage that as well
Ben West
@bewest
Feb 12 2016 05:31
hehe
blob
this technique allows doing openaps stuff in browser with right tools :-D
Aaron Michelson
@Aaybob
Feb 12 2016 07:02
@danamlewis Hi, yes I did go a smidge low. I didn't know really if it was running but when I got home checked the log files and it ran until the battery died and also my upload command errors I think when out of internet range. I think I'd want to learn grep tools to implement that formatting of output. Right? @scottleibrand thanks for the tip. I had tried that without success but knowing that that can work helps.
Jason Calabrese
@jasoncalabrese
Feb 12 2016 07:09
I got rawbg hooked up on my edison rig, so it will be ready for the next ??? or warmup
if anyone is interested in it let me know, takes a little setup to get the cal entry from NS and use oref0-raw
Dana Lewis
@danamlewis
Feb 12 2016 07:15
Sounds like it went well though @Aaybob ! Congrats
Ben West
@bewest
Feb 12 2016 09:00
@jmatheson thanks for trying out oacids earlier
there's a ton of rough edges on that thing
need to round out number of things, it's really proof of concept, super-alpha
really excited about this though, it'll pave way for easy to use GUIs, as well as all kinds of apps
several more fairly big steps
each device needs to be converted to it's own daemon to work on dbus in order to maximize the systems/signal-event stuff
I also stumbled on this thing
it's old but should work just fine, the apis it used are stabled
diabeticgonewild
@diabeticgonewild
Feb 12 2016 09:32

@bewest You can use IRC bridges for both Gitter and Slack

Hope this helps!

Ben West
@bewest
Feb 12 2016 09:32
thanks, I'm testing both
diabeticgonewild
@diabeticgonewild
Feb 12 2016 09:32
You may need to get @danamlewis to adjust the Slack settings to enable IRC all of the time...
Have you been using it recently?
Ben West
@bewest
Feb 12 2016 09:33
testing both currently
diabeticgonewild
@diabeticgonewild
Feb 12 2016 09:33
Oh, so you already knew about it?!
Ben West
@bewest
Feb 12 2016 09:34
yeah, I tried gitter via irc a through months ago
diabeticgonewild
@diabeticgonewild
Feb 12 2016 09:35
After I got kicked off of that diabetes Reddit IRC chat by that jerk awaxa after I attempted suicide (I really don't care what anybody thinks of that...I have a lot to deal with...depression plus 4 autoimmune diseases, two of them rare and neurological...which means less treatments and limited options), I never really got back into IRC....
But anyway, I hope you can enjoy it...
I may enable an IRC Cloud account now since I like that better than Gitter...now that I know about the IRC bridge...
But the other 2 autoimmune diseases are endocrine. T1D and hypothyroidism.
But it's a whole different ball game having rare diseases. It's not like T1D at all where you get to call the shots. You really do get to call the shots with T1D too, believe it or not.
diabeticgonewild
@diabeticgonewild
Feb 12 2016 09:41
This is how my doctors believe my autoimmune diseases are linked. http://www.google.com/patents/US20140377883
Anyway, back to studying. I have a test for school on Sunday...
Chris Oattes
@cjo20
Feb 12 2016 10:47
heh, I see someone procrastinating :P
diabeticgonewild
@diabeticgonewild
Feb 12 2016 12:50
Hahahaha!
;)
Matthias
@ceben80
Feb 12 2016 13:33
@all I am currently working in chapter "Visualization and Monitoring". Please advice with this while running "ns-upload $NIGHTSCOUT_HOST $API_SECRET devicestatus.json monitor/upload-status.json"
a.JPG
Matthias
@ceben80
Feb 12 2016 14:25
Additional information when running "openaps report invoke monitor/upload-status.json" manually
a.JPG
Matthias
@ceben80
Feb 12 2016 14:30
"openaps report invoke monitor/clock-zoned.json" just running generated "2016-02-12T15:20:14+01:00" (the json file in the screenshot above being missed)
a.JPG
Matthias
@ceben80
Feb 12 2016 15:06
monitor/status.json is also missing. What is the report to get status.json?
Matthias
@ceben80
Feb 12 2016 15:14
....I had pump_status.json
solved :+1:
a.JPG
a.JPG
yes :smile:
a.JPG
Dragan Maksimovic
@dm61
Feb 12 2016 16:01
:+1:
Jim Matheson
@jmatheson
Feb 12 2016 16:27
@bewest no problem. happy to take another pass testing during each dev cycle.
Matteo Neri
@francescaneri
Feb 12 2016 17:12
@ceben80
great
:smile:
marius a. eriksen
@mariusae
Feb 12 2016 18:35
we were discussing hte other day the effect of infusion site age and insulin action profile. here’s an interesting paper: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2628686/
Screen Shot 2016-02-12 at 10.35.05 AM.png
(day 1 v day 4)
JaysonEwer
@JaysonEwer
Feb 12 2016 18:37
@jasoncalabrese I'm interested in the rawbg setup on the Edison, but I don't have the Edison in production yet, I hope to get it mostly together this weekend though.
Matthias Granberry
@mgranberry
Feb 12 2016 18:38
that's interesting. There are some insulin mixes undergoing testing that eliminate some of the day-1 variability there and speed overall absorption.
Jason Calabrese
@jasoncalabrese
Feb 12 2016 18:40
just found a major bug with the rawbg stuff, was overwriting EGV with raw
marius a. eriksen
@mariusae
Feb 12 2016 18:40
(that’s a glucose clamp study, so lower values = more sensitive)
Jason Calabrese
@jasoncalabrese
Feb 12 2016 18:41
good thing tunnel is up, just pulled it from the loop at school
had a test for that, not sure what happened
Jason Calabrese
@jasoncalabrese
Feb 12 2016 18:47
that was a little scary, but ran with raw all last night on a 3 week old sensor
saw some weird low temps
then noticed the the bg in the openaps tooltip
Screenshot 2016-02-12 10.48.34.png
raw seemed to track pretty close so wasn't a big deal
Jason Calabrese
@jasoncalabrese
Feb 12 2016 19:43
fix for that bug, going to merge, but should have waited on the initial PR
openaps/oref0#72
was caused by not handling the sgv field we get from NS, since we fall back to it if there isn't a glucose field
Ali Mazaheri
@amazaheri
Feb 12 2016 20:58
@jasoncalabrese just to make sure this is an optional add-on correct? havent got a chance to look at it. But this is important ensure this wont cause issues for folks using G5 like us with no access to RAW.
Dana Lewis
@danamlewis
Feb 12 2016 21:04
Correct. You'd have to configure it.
Ali Mazaheri
@amazaheri
Feb 12 2016 21:06
:+1:
Jason Calabrese
@jasoncalabrese
Feb 12 2016 21:11
yeah you setup a new device and use the output of that instead
like zoning, etc
found a bug in my enact alias, I have a retry, but the check isn't right so it does each enact 2 or 3 times, glad they're temps...
others might have a similar bug
main effect is a slower loop and more treatments in ns
Jason Calabrese
@jasoncalabrese
Feb 12 2016 21:27
and 2 or 3 times more treatments in NS
for days
Jim Matheson
@jmatheson
Feb 12 2016 21:30
that’s not good. i think it is easy to have a sub-optimal loop with all of the complexities of ordering, ailases and and/ors. I am sure i have some problems in mine that i dont know about
i like the idea of recipes that can change and be optimized and others doing the same thing can get those updates.
Jason Calabrese
@jasoncalabrese
Feb 12 2016 21:35
yeah, now we're sharing bugs, but not fixes
Dragan Maksimovic
@dm61
Feb 12 2016 21:42
I'am glad I've never had any retries in enact; it's going to try to do all in 5 min anyway; have not observed any anomalies so far
Jason Calabrese
@jasoncalabrese
Feb 12 2016 21:44
thought I had it fixed, but the fix didn't work
might go back to no retry
I have a retry for history too
Ali Mazaheri
@amazaheri
Feb 12 2016 22:16
I only have retry for History.
Jason Calabrese
@jasoncalabrese
Feb 12 2016 22:43
I took out the enact retry, tried getting it to work but was getting too complicated for a single alias and splitting it up could introduce some other effect
diabeticgonewild
@diabeticgonewild
Feb 12 2016 23:30
Can you use Wixel/xDrip/xBridge2 with OpenAPS?
Scott Leibrand
@scottleibrand
Feb 12 2016 23:32
if it uploads to NS you can pull the BG down from there... or if you can somehow get it to write to a file on the Pi/Edison
not sure how they expose BG data
diabeticgonewild
@diabeticgonewild
Feb 12 2016 23:40
Cool!
You have to check out this site! This dude came up with a way to use our old raspberry pis so we don't have to carry a receiver around the house!
Scott Leibrand
@scottleibrand
Feb 12 2016 23:43
yeah, parakeet sounds interesting
diabeticgonewild
@diabeticgonewild
Feb 12 2016 23:45
Look under "whole house receiver coverage"
Also I wonder how he can do automatic BG calibrations using Freestyle Insulinx