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

3rd
Jan 2016
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 00:00
I think api_secret hash thing is much harder to find/debug
Scott Leibrand
@scottleibrand
Jan 03 2016 00:01
I think the script asks for hashed API secret already.
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 00:02
yes, but where do you het it from? :)
Scott Leibrand
@scottleibrand
Jan 03 2016 00:02
Or converts it, I don't recall.
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 00:02
let me see, but as I remember it doesn't convert anything
read -p "Hashed API secret? "
but I really don't know where can I get hashed secret without logging it on heroku side
Jason Calabrese
@jasoncalabrese
Jan 03 2016 00:10
Thought the tool did conversion to hashed, maybe b not working or not getting called right
Scott Leibrand
@scottleibrand
Jan 03 2016 00:45
I may be confusing it with another tool.
Ben West
@bewest
Jan 03 2016 00:46
the --config swirrch helps
Scott Leibrand
@scottleibrand
Jan 03 2016 00:47
We really need to get that documented. It's not obvious how to use it.
Ben West
@bewest
Jan 03 2016 00:47
--config :smile:
$ ns-upload --config
Usage: ns-upload <NIGHTSCOUT_HOST|localhost:1337> <API_SECRET> [API-TYPE|entries.json] <monitor/entries-to-upload.json> [stdout|-]

ns-upload --config <NIGHTSCOUT_HOST> <PLAIN_API_SECRET> <API-TYPE|entries.json> <monitor/entries-to-upload.json> output-report.json

ns-upload help - This message.
bewest@bewest-MacBookPro:~/Documents/openaps$
Scott Leibrand
@scottleibrand
Jan 03 2016 00:48
I mean for people following instructions, not trying random commands looking for help output. :-p
Ben West
@bewest
Jan 03 2016 00:48
s$ ns-upload --config abc.azurewebsites.net mylonglonglongsecretplainsecret
openaps device add ns-upload process --require "type report" ns-upload "ns-upload-NIGHTSCOUT" "ns-upload-APIKEY"
sed -i -e "s/ns-upload-NIGHTSCOUT/abc.azurewebsites.net/g" ns-upload.ini
sed -i -e "s/ns-upload-APIKEY/8ab426882e77cc46df5929c971d4cb5a68bfed56/g" ns-upload.ini
openaps report add  text ns-upload shell "" ""
bewest@bewest-MacBookPro:~/Documents/openaps$
been considering moving this to a separate tool, maybe something like tutorial tool
it can also assist in prepping the report/alias whatever is needed:
$ ns-upload --config abc.azurewebsites.net mylonglonglongsecretplainsecret treatments.json cleaned/pump-ns-history-zoned.json
openaps device add ns-upload process --require "type report" ns-upload "ns-upload-NIGHTSCOUT" "ns-upload-APIKEY"
sed -i -e "s/ns-upload-NIGHTSCOUT/abc.azurewebsites.net/g" ns-upload.ini
sed -i -e "s/ns-upload-APIKEY/8ab426882e77cc46df5929c971d4cb5a68bfed56/g" ns-upload.ini
openaps report add  text ns-upload shell "treatments.json" "cleaned/pump-ns-history-zoned.json"
bewest@bewest-MacBookPro:~/Documents/openaps$
can pipe that into bash or exec it
Jason Calabrese
@jasoncalabrese
Jan 03 2016 00:58
Think we can combine several of the steps for NS upload
Tony Zarro
@tzarro
Jan 03 2016 01:04
I'm so excited, I've been testing some manual iterations of the loop command with my pump connected to me, and its performing very well...issued my first temp basal 15 minutes ago, and just manually re-looped and its brought the temp basal down to adjust for a softer landing...I'll keep doing these manual tests before I implement the Cron schedule...
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 01:07
is there any trace option in openaps?
actually my problem is as follows:
in openaps.ini I have an alias:upload-recent-treatments = ! bash -c "openaps format-latest-nightscout-treatments && test $(json -f upload/latest-treatments.json -a created_at eventType | wc -l ) -gt 0 && (ns-upload $NIGHTSCOUT_HOST $API_SECRET treatments.json upload/latest-treatments.json ) || echo \"No recent treatments to upload\""
got exactly from ns-upload-setup
when I run it as openaps upload-recent-treatments
I receive pi@raspberrypi:~/dyps $ openaps upload-recent-treatments
cat: entries.json: No such file or directory
and that's it, nothing happens, it doesn't exit
but when I run from shell:
bash -c "openaps format-latest-nightscout-treatments && test $(json -f upload/latest-treatments.json -a created_at eventType | wc -l ) -gt 0 && (ns-upload $NIGHTSCOUT_HOST $API_SECRET treatments.json upload/latest-treatments.json ) || echo \"No recent treatments to upload\""
which is exactly the command bihind the alias - all works normally
Dana Lewis
@danamlewis
Jan 03 2016 01:17
Woot @tzarro ! :)
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 01:21
aha, so the reason is more or less simple, in scipt context I don't have environment variables
Tony Zarro
@tzarro
Jan 03 2016 01:24
Does anyone have recommendations on how often I should loop? I'm about to start working with Cron, and was thinking about every 10 minutes or so...does that make sense?
Dana Lewis
@danamlewis
Jan 03 2016 01:25
Think about how often you get new BG data, for example
Tony Zarro
@tzarro
Jan 03 2016 01:26
right, I thought about 5 minutes, but then was wondering about the synchronization...if the loop kicks off right before the latest BG reading comes in...is that where the wait-for-bg alias comes in handy?
Dana Lewis
@danamlewis
Jan 03 2016 01:27
If you're worried about that, you could do 4 for example. Or make it a little longer than it takes your loop to run OR do every minute but check to see if one is already running
Tony Zarro
@tzarro
Jan 03 2016 01:28
not really worried...that's why I thought about doing it every 10, because you're always going to have a BG reading that is at most 5 minutes old...what is the limit for what OpenAPS considers an "old" reading, though?
Dana Lewis
@danamlewis
Jan 03 2016 01:29
Well, think about scenarios where you are out of range and missing a data point, too - could be older than 5 then
Tony Zarro
@tzarro
Jan 03 2016 01:32
ah, ok...so you would want to do a more recent check in that instance...is there a practical limit to how often you could/should run it? Like every 2 minutes or something? Seems like overkill, but not sure...
Dana Lewis
@danamlewis
Jan 03 2016 01:34
Keep in mind all the failure points - missing cgm data; your pump gets out of range of Carelink; you sneeze wrong and Carelink stops reading; etc. ;)
Everyone does it differently, but we tend to run more frequently because of Carelink issues and just check to see if one is already running
(Same idea is helpful if you end up with multiple Pis running loops)
See above idea about running frequently but adding check to see if one is already running
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 01:36
and what is your average pump battery life when connecting to it each minute?
Dana Lewis
@danamlewis
Jan 03 2016 01:38
Heh. There's that. With frequent connectivity, the pump battery goes a lot faster than when not looping. On standard energizer batteries, went from a month stand to ~3 days. Switched to lithium and those last over a week.
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 01:38
a week is ok, I was afraid of less than 24h
Dana Lewis
@danamlewis
Jan 03 2016 01:39
Oh no. I kill batteries fastest out of the group and worst case was 2.5 days I think
That's for it to hit low battery and kill the RF - you still have time Before the pump dies for normal ops
But it matters because if it goes to low battery overnight, no loop
Lithium is much better and battery.json can be uploaded to NS now
So you can also build some alerts (that's on my to-do list)
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 01:41
:) it is better than hearing "battery fail" sound during plane take-off :)
Dana Lewis
@danamlewis
Jan 03 2016 01:41
Lol
Scott Leibrand
@scottleibrand
Jan 03 2016 01:45
@tzarro my cron runs every minute (or 30s) and checks if openaps is running. If not, it collects CGM and pump data, enacts, and uploads, then waits for next CGM data point, enacts, and uploads again.
But that is complicated. Simpler is just to run it every few minutes, just long enough between runs so that the last loop is finished first.
Tony Zarro
@tzarro
Jan 03 2016 01:47
@scottleibrand yeah, for my first try I'm going with the simpler option, and monitor the heck out of it...
Scott Leibrand
@scottleibrand
Jan 03 2016 01:47
:+1:
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 01:53
finally it started uploading on cron basis, time to go to next step
Dana Lewis
@danamlewis
Jan 03 2016 02:11
Awesome @ktomy
Tony Zarro
@tzarro
Jan 03 2016 02:14
I've created a Cron file, but of course it isn't working yet :)
  • /20 * /home/pi/openaps/openaps loop
  • /20 * /home/pi/openaps/openaps loop
" /20 /home/pi/openaps/openaps loop"
dang, it won't let me use asterisks in gitter, lol
anyway, its configured to run openaps loop every 3 minutes
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:15
as I know in crontab you should have more "stars" like this:
/5 * command
ah, ok :) I see, it is gitter syntax
Tony Zarro
@tzarro
Jan 03 2016 02:15
yep, I've got the stars in the right places in the file, it's just gitter :)
but nothing is actually happening, my suggested.json isn't updating every 3 minutes, nor is enacted.json
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:16
best practice is to use crontab -e
and not just creating /etc/crontab or something
Tony Zarro
@tzarro
Jan 03 2016 02:17
yep, I'm editing the file using crontab -e, but I imagine there's more to it than just adding my one line citing the loop alias
Scott Leibrand
@scottleibrand
Jan 03 2016 02:17
For Gitter, put ``` on its own line before and after the cron paste
Dana Lewis
@danamlewis
Jan 03 2016 02:17
(By the way, bonus points for using the buddy system and already paying it forward :))
Tony Zarro
@tzarro
Jan 03 2016 02:18
'''
  • /20 *
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:18
''' * command
so, crontab, does it at least executes something? you can try something like:
Jason Calabrese
@jasoncalabrese
Jan 03 2016 02:19
Try doing a cd into the directory, then running the command
All in 1 line in the cron
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:19
5 stars) date >> /var/log/something
Tony Zarro
@tzarro
Jan 03 2016 02:20
yep, the loop command works fine in the openaps directory
Scott Leibrand
@scottleibrand
Jan 03 2016 02:21
* * * * * cd $directory && ( ps aux | grep -v grep | grep -q 'openaps retry-loop' || openaps retry-loop ) 2>&1 | tee -a /var/log/openaps/loop.log
Tony Zarro
@tzarro
Jan 03 2016 02:21
I'll test cron with a simple command to make sure its working
Scott Leibrand
@scottleibrand
Jan 03 2016 02:21
backticks, not single wiotes
heh quotes
` not '
and on a separate line if you're doing three of them.
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:21
* * * * works
Scott Leibrand
@scottleibrand
Jan 03 2016 02:22
Make sure your env vars are set in cron too
And path:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:22
...my version was to set and export variables in /etc/profile , it is more dirty but as it is a single-user system it is ok for me
Tony Zarro
@tzarro
Jan 03 2016 02:23
(trying again) :)
Tony Zarro
@tzarro
Jan 03 2016 02:44
How do I navigate to the /var/log/openaps directory? Bash keeps telling me that there is no such directory
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:45
it means it waqs not created :)
ls /var/log
Scott Leibrand
@scottleibrand
Jan 03 2016 02:45
mkdir
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:46
or, much better, you can install a file manager, in case you are working thru ssh - mc is the best
Tony Zarro
@tzarro
Jan 03 2016 02:46
get a "permission denied" error when trying mkdir
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:46
sudo mkdit /var/log/openaps
sudo chmot 0777 /var/log/openaps
Tony Zarro
@tzarro
Jan 03 2016 02:46
that did it :)
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:47
but much better with mc :)
sudo apt-get install mc
Scott Leibrand
@scottleibrand
Jan 03 2016 02:47
what does mc do?
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:47
and after it is installed just type mc
file manager
Scott Leibrand
@scottleibrand
Jan 03 2016 02:47
ah
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:47
like norton commander, total commander
Tony Zarro
@tzarro
Jan 03 2016 02:48
the chmot command didn't work, said it was not found
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:48
mc = midnight commander
sorry, typo
it should be sudo chmod 0777 /var/log/openaps
it gives permission to write to this directory to everybody
Tony Zarro
@tzarro
Jan 03 2016 02:49
ah, awesome
oh, I like mc, thanks :)
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 02:50
to get full permissions you can type sudo mc
but don't do openaps things in that mode as you'll loose permissions afterwards
Tony Zarro
@tzarro
Jan 03 2016 02:53
@scottleibrand you mentioned I needed to setup my env vars in Cron, but I haven't done that yet...that is probably what's wrong...but I'm not sure what they are or how to write them in cron...can you advise?
Scott Leibrand
@scottleibrand
Jan 03 2016 02:56
That's only necessary for uploading
PATH is more likely an issue for looping.
Although in reality PATH is also just a special env variable
see what i pasted above.
Are you getting any output in loop.log?
Tony Zarro
@tzarro
Jan 03 2016 02:58
I copied that row previously, its the first row in my Cron file...is it supposed to come before the row with asterisks?
no loop.log file has been generated yet
Scott Leibrand
@scottleibrand
Jan 03 2016 02:58
Anywhere above it
Tony Zarro
@tzarro
Jan 03 2016 02:59
is Cron something that needs to be installed or is it already included in the OS?
Scott Leibrand
@scottleibrand
Jan 03 2016 02:59
do a new cron like that just has like echo Hello world >> /var/log/openaps/loop.log
Tony Zarro
@tzarro
Jan 03 2016 02:59
ok
Scott Leibrand
@scottleibrand
Jan 03 2016 02:59
cron is installed by default.
Oddly enough, I know Paul Vixie, the guy who originally wrote it. :-)
kinda cool to have your software powering every server out there. :-)
Tony Zarro
@tzarro
Jan 03 2016 03:03
not working it appears
if I wanted it to run every minute, I'd have the hours placeholder read '/60', right?
Ben West
@bewest
Jan 03 2016 03:04
I really prefer 2>&1 | logger -t openaps
send it to syslog
Scott Leibrand
@scottleibrand
Jan 03 2016 03:04
Does that make a dedicated log file?
Ben West
@bewest
Jan 03 2016 03:05
no, it sends it to syslog
Scott Leibrand
@scottleibrand
Jan 03 2016 03:05
all stuff going to the shared files is messy
really hard to tail
Ben West
@bewest
Jan 03 2016 03:05
syslog can be configured to dupe to papertrail and other services, as well as pull all matches to a file
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 03:05
@tzarro /60 means once in hour
Ben West
@bewest
Jan 03 2016 03:06
yours won't get decocare logs
Scott Leibrand
@scottleibrand
Jan 03 2016 03:06
yeah, that's my goal. ;-)
Ben West
@bewest
Jan 03 2016 03:06
ah, I'm usually interested in those
they are fairly quiet now except errors
Tony Zarro
@tzarro
Jan 03 2016 03:08
let me reconfigure the timing of my cron file, based on what @ktomy mentioned above :)
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 03:08
@bewest why did you told about syslog... I really thought all was working and now I can see Jan 3 05:07:45 raspberrypi bad zero CRC?
:)
@tzarro all stars means each minute
Tony Zarro
@tzarro
Jan 03 2016 03:09
OK, that was definitely a problem, I'm getting the "Hello world" loop.log now
Tony Zarro
@tzarro
Jan 03 2016 03:17
I'm running the retry-loop alias from Cron now, and this is the error I'm getting: /bin/sh: 1: openaps: not found
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 03:18
it is definitly because of path
Tony Zarro
@tzarro
Jan 03 2016 03:18
Here is what I have there:
PATH=/usr/local/sbin:user/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 03:18
on your first line of the cron you should have a line like:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Tony Zarro
@tzarro
Jan 03 2016 03:19
ah, I have a typo "user"
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 03:19
otherwise you can hardcode all the paths
Tony Zarro
@tzarro
Jan 03 2016 03:25
still having the same issue: /bin/sh: 1: openaps: not found
does it need to open a bash session in order to execute openaps retry-loop?
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 03:26
normally no
try replacing openaps by /usr/local/bin/openaps
...before your "user" you should have a slash "/"
so it should be /usr/local/bin
Scott Leibrand
@scottleibrand
Jan 03 2016 03:32
Type which openaps to see which one it's using.
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 03:38
BG Target data is expected to be expressed in mg/dL. Found mmol/L in settings/bg_targets.json .
love that :)
Scott Leibrand
@scottleibrand
Jan 03 2016 03:39
There is a conversion tool somewhere.
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 03:41
will try to look for it tonight, now it's too late. thank you all again and have a nice day. ```
pi@raspberrypi:~/dyps $ date
Sun  3 Jan 05:41:00 EET 2016
Scott Leibrand
@scottleibrand
Jan 03 2016 03:42
;-)
Have a good night.
Ben West
@bewest
Jan 03 2016 03:58
in my crontab, I have SHELL=bash
Tony Zarro
@tzarro
Jan 03 2016 04:31
ugh, still not working...I'm going around in circles, really no idea what to try next...
here's what I've got thus far:
PATH=/usr/local/sbin:usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
          • cd /usr/local/bin/openaps && ( ps aux | grep -v grep | grep -q 'openaps retry-loop' || openaps retry-loop ) 2>&1 | tee -a /var/log/openaps/loop.log
any ideas would be greatly appreciated
Scott Leibrand
@scottleibrand
Jan 03 2016 04:52
Is anything getting written to loop.log?
if not, simplify. Start with a really simple cron job that writes to loop.log and make sure it works. Then keep adding stuff until something breaks.
You might be able to run sudo alpine to see the local email output from cron too
Tony Zarro
@tzarro
Jan 03 2016 04:54
how do I comment everything out of the current crontab file?
nothing getting written to loop.log
Scott Leibrand
@scottleibrand
Jan 03 2016 04:55

at the beginning of each line.

Heh
Tony Zarro
@tzarro
Jan 03 2016 04:56
what does that PATH line actually do?
Scott Leibrand
@scottleibrand
Jan 03 2016 04:56
Tells it where to find non-fully qualified command names.
Tony Zarro
@tzarro
Jan 03 2016 04:58
so if I have a PATH line like you mentioned in the comment earlier (https://gitter.im/nightscout/intend-to-bolus?at=568885cb653b30761d770b43), then that tells the system the command names can be in any of those folders?
Scott Leibrand
@scottleibrand
Jan 03 2016 05:05
Right. It searched them in order.
Not sure if my edit took: # to comment.
Dragan Maksimovic
@dm61
Jan 03 2016 05:12
This message was deleted
This message was deleted
Here is how my crontab file looks like:

SHELL = /bin/bash
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games

/5 * (cd ~/myaps && date && openaps loop) 2>&1 >> ~/myaps/myaps.log

Tony Zarro
@tzarro
Jan 03 2016 05:13
@scottleibrand in the row you suggested earlier (https://gitter.im/nightscout/intend-to-bolus?at=5688858f4f069158055cc43b) do I need to replace $directory with something?
ahhhh, I'm wondering if its the "SHELL=/bin/bash" that I'm missing, I tried something like that but not exactly
Dragan Maksimovic
@dm61
Jan 03 2016 05:14
This message was deleted
This message was deleted
This message was deleted
This message was deleted
Tony Zarro
@tzarro
Jan 03 2016 05:28
so here is my latest crontab, building it up from a simple example...the "hello world" part is working, but the simple
SHELL = /bin/bash
PATH = /usr/local/sbin:usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
          • echo Hello world >> /var/log/openaps/loop.log
          • cd ~/openaps && (openaps monitor-cgm) >> /var/log/openaps/loop.log
but the simple monitor-cgm command isn't working
I'm not getting anything for that one, nothing in the log and no updated glucose data
Dragan Maksimovic
@dm61
Jan 03 2016 05:30
strange
your monitor-cgm does work?
Tony Zarro
@tzarro
Jan 03 2016 05:31
yep
hang on, I don't think my syntax will write to the log for the monitor-cgm, fixing that and trying again
Dragan Maksimovic
@dm61
Jan 03 2016 05:32
I do not see a point to having () around monitor-cgm, should be around both
(cd ~/openaps && openaps monitor-cgm)
Tony Zarro
@tzarro
Jan 03 2016 05:36
ok
Dragan Maksimovic
@dm61
Jan 03 2016 05:37
you may try, I do not really know if it should make any difference
Tony Zarro
@tzarro
Jan 03 2016 05:41
OK, so I'm finally getting output to the log for the monitor-cgm command via cron
Here is my current cron, and here is the error
/bin/bash: openaps: command not found
SHELL = /bin/bash
PATH = /usr/local/sbin:usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
          • echo Hello world >> /var/log/openaps/loop.log
          • ( cd ~/openaps && openaps monitor-cgm) 2>&1 | tee -a /var/log/openaps/loop2.log
the Hello world command is still working
so I'm guessing there is something about the syntax of how I'm calling the openaps command which isn't kosher
Dragan Maksimovic
@dm61
Jan 03 2016 05:43
this means openaps command is not in your path
Scott Leibrand
@scottleibrand
Jan 03 2016 05:43
You might not have installed openaps right?
what was the which output again?
did you use quick-packages or quick-src or ?
Tony Zarro
@tzarro
Jan 03 2016 05:44
when I did the "which openaps" command, it gave me: /usr/local/bin/openaps
quick-packages I believe
Scott Leibrand
@scottleibrand
Jan 03 2016 05:44
ok, that should be good...
Tony Zarro
@tzarro
Jan 03 2016 05:45
should the "cd" command be referencing the openaps folder where I run all my openaps commands in the shell?
Scott Leibrand
@scottleibrand
Jan 03 2016 05:45
Add a cron entry that does which openaps >> /var/log/openaps/loop.log
Dragan Maksimovic
@dm61
Jan 03 2016 05:46
I would give it the full path /usr/local/bin/openaps in front of monitor-cgm and try again
Scott Leibrand
@scottleibrand
Jan 03 2016 05:46
cd can't use ~/
that doesn't mean the same in cron
Tony Zarro
@tzarro
Jan 03 2016 05:46
ahh, ok
Scott Leibrand
@scottleibrand
Jan 03 2016 05:46
use the fully qualified path
Tony Zarro
@tzarro
Jan 03 2016 05:46
I was experimenting with what I could do in shell, and attempting it in cron
Scott Leibrand
@scottleibrand
Jan 03 2016 05:47
but you still need it to find openaps, so also try the full path to that, and/or the which
cron environment is always annoying.
Tony Zarro
@tzarro
Jan 03 2016 05:49
I'm trying it a couple different ways:
SHELL = /bin/bash
PATH = /usr/local/sbin:usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
          • echo Hello world >> /var/log/openaps/loop.log
          • which openaps >> /var/log/openaps/loop.log
          • ( cd /home/pi/openaps && openaps monitor-cgm) 2>&1 | tee -a /var/log/openaps/loop2.log
          • ( cd /usr/local/bin/openaps && openaps monitor-cgm) 2>&1 | tee -a /var/log/openaps/loop3.log
two different error messages in loop2.log and loop3.log
loop2.log: /bin/bash: openaps: command not found
loop3.log: /bin/bash: line 0: cd: /usr/local/bin/openaps: Not a directory
ah, for loop3 the openaps file is in the directory bin, there is no openaps directory there...so when I corrected that, I get the same error for loop3 as for loop2: /bin/bash: openaps: command not found
Dragan Maksimovic
@dm61
Jan 03 2016 05:54
what does "which openaps" give you in loop.log?
Tony Zarro
@tzarro
Jan 03 2016 05:55
interesting, I'm not getting any content in loop.log for "which openaps"
perhaps I need to change the syntax to "tee" for that
let me try
Scott Leibrand
@scottleibrand
Jan 03 2016 05:57
Need a 2>&1
that redirects stderr to stdout
just redirects stdout
That is > by itself.
2>somefile would also work
Tony Zarro
@tzarro
Jan 03 2016 06:02
I setup a separate logfile for which openaps, so I know its generating a file, but its empty
here is my current crontab
SHELL = /bin/bash
PATH = /usr/local/sbin:usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
          • echo Hello world >> /var/log/openaps/loop.log
          • which openaps 2>&1 | tee -a /var/log/openaps/loop1.log
          • ( cd /home/pi/openaps && openaps monitor-cgm) 2>&1 | tee -a /var/log/openaps/loop2.log
          • ( cd /usr/local/bin/ && openaps monitor-cgm) 2>&1 | tee -a /var/log/openaps/loop3.log
getting the exact same errors for loop2.log and loop3.log
Scott Leibrand
@scottleibrand
Jan 03 2016 06:04
If which openaps is failing, the error will go to stderr, and stdout will be blank
so you need to redirect stdout too/instead
*redirect stderr too
this might be easier if you check root's mail using alpine
every failure gets emailed
Tony Zarro
@tzarro
Jan 03 2016 06:06
sudo alpine? when I try that, I get "command not found"
is that something I need to install?
Scott Leibrand
@scottleibrand
Jan 03 2016 06:10
Probably. To install something you do sudo apt-get install alpine or similar.
or you could use mail but it sucks. :-)
Tony Zarro
@tzarro
Jan 03 2016 06:10
I found some install instructions, let me try it: https://scottlinux.com/2014/06/09/read-root-mail-locally-with-alpine/
Scott Leibrand
@scottleibrand
Jan 03 2016 06:10
Perfect. Google is your friend. :-)
Tony Zarro
@tzarro
Jan 03 2016 06:27
well, I've got all that setup, and I'm seeing the email for the root, and while I'm seeing the emails for the errors with loop2.log and loop3.log, I'm not getting any emails for the which openaps...
Scott Leibrand
@scottleibrand
Jan 03 2016 06:36
The cd && openaps thing isn't gonna work anyway. Try just /usr/local/bin/openaps
once it finds the openaps command, you'll need to have it cd into your openaps dir for it to read the ini and work.
So it'll be cd to there instead of to the bin dir
I'm off to bed. But keep at it: I'm always surprised at the hours people keep in here. And Google is always awake. ;-)
Tony Zarro
@tzarro
Jan 03 2016 06:46
well, here is my take on that suggestion, but I'm sure I don't have it right and I'm still getting the same errors...part of the problem is I still don't stand how some of these commands even work...
          • ( /usr/local/bin/openaps ) && ( cd /home/pi/openaps ) && ( openaps monitor-cgm ) 2>&1 | tee -a /var/log/openaps/loop3.log
"still don't UNDERstand", that is :)
Scott Leibrand
@scottleibrand
Jan 03 2016 07:14
You can run
That should be the same as /usr/local/bin/openaps monitor-cgm
that's the replacement I was suggesting, rather than adding a bare /usr/local/bin/openaps first.
Tony Zarro
@tzarro
Jan 03 2016 07:17
Go to bed :)
Scott Leibrand
@scottleibrand
Jan 03 2016 07:17
( ) are only useful to group commands, not around a single command. The way you're using them doesn't do anything different, so you might as well remove them.
;-)
Tony Zarro
@tzarro
Jan 03 2016 07:17
I'm going to read a bunch of previous "cron" posts and see if I can figure it out :)
Scott Leibrand
@scottleibrand
Jan 03 2016 07:17
sounds like a plan
Tony Zarro
@tzarro
Jan 03 2016 07:17
ah, ok :)
Scott Leibrand
@scottleibrand
Jan 03 2016 07:17
night.
Tony Zarro
@tzarro
Jan 03 2016 07:57
I've tried so many different things trying to get the cron job to work, to no avail.
I've also looked back at all of the 'cron' posts, and tried many of those suggestions, but nothing works...I keep getting the same error message (/bin/bash: openaps: command not found)
seems like I'm running into the issues that @fjungman ran into a while back, but I couldn't find any answers to those (https://gitter.im/nightscout/intend-to-bolus?at=55ab015a91ce63ea759ac363)
going to call it a night, I'm getting punchy :)
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 12:23
@tzarro as I already told, you still ave a typo in your PATH, in front of the usr you need a /
you have
PATH = /usr/local/sbin:usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
and you need
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Tony Zarro
@tzarro
Jan 03 2016 12:26
ah, I missed that one in all the attempts...I'll try again
Alin Artiom Kenibasov
@ktomy
Jan 03 2016 12:28
this is my crontab:
pi@raspberrypi:~ $ crontab -l
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
*/5 * * * * killall -g --older-than 10m openaps
*/5 * * * * cd /home/pi/dyps && oref0-reset-git
*/5 * * * * cd /home/pi/dyps && ( ps aux | grep -v grep | grep -q 'openaps ' && echo OpenAPS already running || openaps upload ) 2>&1 | tee -a /var/log/openaps/uploader.log
copy-paste it to your machine if you still having a problem and see the output in /var/log/openaps.upload.log
this should give an openaps error (as you probabl don't have the same aliases as I have, but you shouldn't receive this "not found" error.
and don't copy-paste the first line as it is a shell prompt with command :)
Tony Zarro
@tzarro
Jan 03 2016 12:30
gotcha, thanks!
Tony Zarro
@tzarro
Jan 03 2016 12:36
ah, now I'm getting somewhere...that typo was indeed the big issue...I've been testing with calling the monitor/glucose.json report every minute, and I'm finally getting updates...no longer getting the "not found" error, as my path is finally correct.
@ktomy , @scottleibrand and everyone else: thank you so much for your help thus far, I'm on the brink of closing the loop :)
Tony Zarro
@tzarro
Jan 03 2016 13:36
And now I can happily say that I have closed the loop! Cron is running the retry-loop alias every 3 minutes, and I'm monitoring the loop.log very closely. Thanks again everyone, this has been an absolute amazing experience!
Scott Leibrand
@scottleibrand
Jan 03 2016 13:37
:+1: :-D congrats! Keep us posted as you proceed and start to let it run unattended overnight. :-)
Tony Zarro
@tzarro
Jan 03 2016 13:37
will do!
Tony Zarro
@tzarro
Jan 03 2016 13:58
Aaaaand, having a different issue now...I plugged in my RPi2 into a battery pack instead of the adapter, and now I'm getting this issue whenever monitor-cgm, monitor-pump, or the loop is running:
Traceback (most recent call last):
File "/usr/local/bin/openaps-report", line 4, in <module>
import('pkg_resources').run_script('openaps==0.0.9', 'openaps-report')
File "build/bdist.linux-armv7l/egg/pkgresources/_init.py", line 745, in run_script
File "build/bdist.linux-armv7l/egg/pkgresources/_init.py", line 1670, in run_script
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/EGG-INFO/scripts/openaps-report";, line 82, in <module>
app( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/openaps/cli/init.py", line 45, in call
self.epilog( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/EGG-INFO/scripts/openaps-report";, line 69, in epilog
super(ReportToolApp, self).epilog( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/openaps/cli/init.py", line 64, in epilog
self.create_git_commit( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/openaps/cli/init.py", line 72, in create_git_commit
if self.repo.is_dirty( ) or self.repo.index.diff(None):
File "/usr/local/lib/python2.7/dist-packages/GitPython-1.0.1-py2.7.egg/git/repo/base.py";, line 582, in is_dirty
len(self.git.diff('--cached', default_args)):
File "/usr/local/lib/python2.7/dist-packages/GitPython-1.0.1-py2.7.egg/git/cmd.py";, line 440, in <lambda>
return lambda
args, kwargs: self._call_process(name, *args, kwargs)
File "/usr/local/lib/python2.7/dist-packages/GitPython-1.0.1-py2.7.egg/git/cmd.py";, line 834, in _call_process
return self.execute(make_call(), **_kwargs)
File "/usr/local/lib/python2.7/dist-packages/GitPython-1.0.1-py2.7.egg/git/cmd.py";, line 627, in execute
raise GitCommandError(command, status, stderr_value)
git.exc.GitCommandError: 'git diff --cached --abbrev=40 --full-index --raw' returned with exit code 128
stderr: 'error: object file .git/objects/83/c229ff3ef719114ae2cf1081d937719c8cbe84 is empty
error: object file .git/objects/83/c229ff3ef719114ae2cf1081d937719c8cbe84 is empty
fatal: loose object 83c229ff3ef719114ae2cf1081d937719c8cbe84 (stored in .git/objects/83/c229ff3ef719114ae2cf1081d937719c8cbe84) is corrupt'
Any idea how to fix this one? Not sure if its related to using the battery for the first time, but it was curious timing
since git was implicated, I tried a git push but got the same error
Scott Leibrand
@scottleibrand
Jan 03 2016 14:05
Your git repo got corrupted, probably by a power cut while writing.
There's an oref0-reset-git script that will blow away git history and start it over from where you are now.
@ktomy and I have it in our crontab so it'll run automatically if git gets corrupt like this.
Tony Zarro
@tzarro
Jan 03 2016 14:06
ah, I've seen that!
I'll implement that...thanks!
Tony Zarro
@tzarro
Jan 03 2016 14:13
worked like a champ! thanks again :)
Scott Leibrand
@scottleibrand
Jan 03 2016 14:16
:-)
Scott Leibrand
@scottleibrand
Jan 03 2016 15:03
just added https://gist.github.com/bewest/a88ee1c7d3b0c7c7af1b as oref0-fix-git-corruption.sh to oref0 dev and updated oref0-reset-git.sh to try that first before resetting if it can't be fixed. will require an npm install -g to add the new command to your path so it can be used.
Tony Zarro
@tzarro
Jan 03 2016 15:48
90 minutes of excellent performance so far...I have been having intermittent issues in my testing the last few days with the carelink needing to be unplugged and plugged in again, so is there something that can periodically reset a specific USB port?
And do other folks experience that as well? I need to buy a backup stick
Dragan Maksimovic
@dm61
Jan 03 2016 16:05
@tzarro congratulations for looping! I have noticed issues with carelink, which seems to go dead occasionally (not very often). I think oref0-reset-usb command resets all USB ports.
Tony Zarro
@tzarro
Jan 03 2016 16:23
BTW, I keep walking around disbelievingly thinking to myself "I've got a freakin' artificial pancreas!"
I'm so very thankful to all of the work everyone here has put in
Dragan Maksimovic
@dm61
Jan 03 2016 16:30
Share your sentiment - it's awesome!
Dana Lewis
@danamlewis
Jan 03 2016 16:55
Woot @tzarro ! Awesome progress. Yes, see @dm61 Suggestion about resetting rather than having to unplug Carelink, but getting a second stick as a backup is nice to have.
Tony Zarro
@tzarro
Jan 03 2016 17:12
so what's the official count now of loops closed? :)
Dana Lewis
@danamlewis
Jan 03 2016 17:13
Count doesn't up until someone has several days of running the loop overnight (and sleeping presumably ;))
So official still at 22 but I think @dm61 , you, and maybe @ktomy Are you going to have us hit 25 sooner than I was guessing!
Tony Zarro
@tzarro
Jan 03 2016 17:15
I'm aiming for 25, then :)
Dragan Maksimovic
@dm61
Jan 03 2016 17:15
Last night was my 3rd day running the loop overnight, with good results
No alarms
Dana Lewis
@danamlewis
Jan 03 2016 17:18
Awesome to hear @dm61 ! Want to be the guinea pig? Switching how I get info from people to up the count, ya'll may not have seen this addition to the docs since I did it a day or so ago https://github.com/openaps/docs/blob/master/docs/Automate-system/keeping-up-to-date.md
Dragan Maksimovic
@dm61
Jan 03 2016 17:35
@danamlewis I've filled in the form - thanks!
Dana Lewis
@danamlewis
Jan 03 2016 17:44
Excellent, thanks @dm61. Just verified. :chart_with_upwards_trend: #OpenAPS = (n=1)*23
dougtakeuti
@dougtakeuti
Jan 03 2016 18:00
Using MDT Enlite here, which produces glucose.json in a format that cannot be used in determine-basal. Instead of changing the code to accept MDT format I'm trying to work around the problem by just including in the loop a couple of lines to edit the glucose.json file. I've used sed -i 's/sgv/glucose/g' monitor/glucose.json to replace sgv with glucose. The problem is that I also need to replace a string with double quotes, "date", with "display_time". I've tried to escape the double quotes with a backslash with no success. Any clues?
Jason Calabrese
@jasoncalabrese
Jan 03 2016 18:15
we really should change the code to just handle the different fields
thats what we did to handle the sgv field from NS
Scott Leibrand
@scottleibrand
Jan 03 2016 18:16
Agreed. In the mean time, json is the tool for that, rather than sed
openaps alias add prep-pumphistory-entries '! bash -c "cat monitor/pumphistory-zoned.json | json -e \"this.dateString = this.timestamp\" | json -e \"this.medtronic = this._type\" | json -e \"this.type = \\"medtronic\\"\" | json -e \"this.date = new Date(Date.parse(this.timestamp)).getTime( )\" > upload/pumphistory-entries.json"'
there's an example (the first json call)
dougtakeuti
@dougtakeuti
Jan 03 2016 18:20
ok, I'll look into that then. Thanks
Jason Calabrese
@jasoncalabrese
Jan 03 2016 18:33
just hit by a low pump battery, was waiting for that thinking it would let me add an alarm, but it's not looking as easy as I was hoping
 {
    "status": "normal", 
 -  "voltage": 1.19
 +  "voltage": 1.57
  }
Scott Leibrand
@scottleibrand
Jan 03 2016 18:33
What kind of battery?
Jason Calabrese
@jasoncalabrese
Jan 03 2016 18:34
status didn't change from normal
Scott Leibrand
@scottleibrand
Jan 03 2016 18:34
i just set a 1.35V alarm for our lithiums
Jason Calabrese
@jasoncalabrese
Jan 03 2016 18:34
energizer lithium
what do you see as full?
Scott Leibrand
@scottleibrand
Jan 03 2016 18:35
it starts at 1.5something
Sometimes it'll drop below 1.4 and then back up.
But <1.35 always means <24h
Jason Calabrese
@jasoncalabrese
Jan 03 2016 18:36
thats only for lithiums, guess I'll make it a setting
a warn and urgent level
maybe 1.35 for warn and 1.30 for urgent?
Scott Leibrand
@scottleibrand
Jan 03 2016 18:36
Sure, for starters.
I have a cron that emails us.
Jason Calabrese
@jasoncalabrese
Jan 03 2016 18:37
not sure if you saw over in /public, but we may have something for the initial load perf
Dana Lewis
@danamlewis
Jan 03 2016 18:38
+1, thanks @jasoncalabrese
Scott Leibrand
@scottleibrand
Jan 03 2016 18:38
Thx, I don't watch that channel.
Jason Calabrese
@jasoncalabrese
Jan 03 2016 18:39
lots of channels
testing it on my prod site now
Scott Leibrand
@scottleibrand
Jan 03 2016 18:41
Cool. I'll update ours as soon as you merge it to dev (unless you plan to wait).
I like that approach, since initial load is always a 3h view anyway.
Jason Calabrese
@jasoncalabrese
Jan 03 2016 18:45
it does seem faster, but I see a little rendering bug
Dragan Maksimovic
@dm61
Jan 03 2016 18:59
do you know how the pump actually executes different basal rates: as small fixed boluses at different rates, or as variable-size boluses at fixed time rate, or perhaps some combination of these two depending on the basal rate?
Scott Leibrand
@scottleibrand
Jan 03 2016 19:05
MDT has a fixed bolus size that it executes with varying frequency for temp basals
the size is different for different pump models
supposedly if you get somewhere really quiet and listen to the pump closely you can hear the motor each time it microboluses
Dana Lewis
@danamlewis
Jan 03 2016 19:15
You can hear it even if it's not really quiet.
Dragan Maksimovic
@dm61
Jan 03 2016 19:16
ok, thanks, that's what I thought. Depending on the frequency of the microboluses compared to the openaps update rate, this may produce some discrepancies between what the actual IOB is and what openaps thinks it is based on pump history.
Pump designers did not expect someone would be updating temp basals every 5 minutes :smile:
@danamlewis depends on how old you are :worried:
Scott Leibrand
@scottleibrand
Jan 03 2016 19:25
For all but the lowest basal rates, the frequency is on order of 1m or less.
Dragan Maksimovic
@dm61
Jan 03 2016 19:29
Yes, should not matter
Howard Look
@HowardLook
Jan 03 2016 20:52
Hey all! Anyone seen an issue where plugging the Dexcom in to the Pi causes the other USB ports to stop functioning? I suspect that it's a power thing. Dex is trying to charge, drawing too much USB power, killing the other ports (CareLink stick and WiFi). Dex is alternating between "I'm charging" and not. If I unplug Dex, other ports come back to life.
Jason Calabrese
@jasoncalabrese
Jan 03 2016 20:52
I haven't seen that, maybe a bad cable?
Dana Lewis
@danamlewis
Jan 03 2016 20:53
It's a power thing. Dex needs to be mostly charged
Charge the dex and it will resolve
Tony Zarro
@tzarro
Jan 03 2016 20:55
I've been having great results all day, but an error is cropping up the last few loops...
determine-basal://text/shell/enact/suggested.json
reporting enact/suggested.json
{"temp":"absolute","bg":101,"tick":"+0","eventualBG":118,"snoozeBG":118,"reason":"118 is in range. No temp required; cancel","duration":0,"rate":0}
enact/enacted.json raised bytearray index out of range
pump://JSON/set_temp_basal/enact/enacted.json
Traceback (most recent call last):
File "/usr/local/bin/openaps-report", line 4, in <module>
import('pkg_resources').run_script('openaps==0.0.9', 'openaps-report')
File "build/bdist.linux-armv7l/egg/pkgresources/_init.py", line 745, in run_script
File "build/bdist.linux-armv7l/egg/pkgresources/_init.py", line 1670, in run_script
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/EGG-INFO/scripts/openaps-report";, line 82, in <module>
app( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-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.9-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.9-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.9-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.9-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-0.0.9-py2.7.egg/openaps/vendors/medtronic.py";, line 311, in main
results = self.upload_program(program)
File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/openaps/vendors/medtronic.py";, line 320, in upload_program
return self.pump.model.set_temp_basal(program)
File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/models/init.py", line 188, in set_temp_basal
result = self._set_temp_basal(
basals)
File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/models/init.py", line 25, in call
self.response = inst.session.query(self.msg, **kwds)
File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/session.py";, line 101, in query
self.execute(command)
File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/session.py";, line 98, in execute
return super(type(self), self).execute(command)
File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/session.py";, line 39, in execute
self.download( )
File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/session.py";, line 54, in download
self.command.respond(data)
File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/commands.py";, line 58, in respond
self.getData( )
File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/commands.py";, line 273, in getData
received = True if self.data0 is 0 else False
IndexError: bytearray index out of range
Howard Look
@HowardLook
Jan 03 2016 20:55
That's what I figured. Thanks, @danamlewis
Tony Zarro
@tzarro
Jan 03 2016 20:56
I'm not even sure that this would prevent the enacting of a temp basal, but I've been right in my BG target while I've had this error...perhaps I should eat something sugary and test that :)
Dana Lewis
@danamlewis
Jan 03 2016 20:56
Yup. May need to add that to the docs somewhere if you find a good place, @HowardLook
That's my second favorite error after checking to see if the receiver is plugged in at all when trying to pull glucose data :)
Howard Look
@HowardLook
Jan 03 2016 20:57
Yeah, contemplating that now. May suggest it in a couple of places @danamlewis
Dana Lewis
@danamlewis
Jan 03 2016 20:57
:+1:
Scott Leibrand
@scottleibrand
Jan 03 2016 20:57
@tzarro you shouldn't be enacting if it doesn't have a rate or duration
Jason Calabrese
@jasoncalabrese
Jan 03 2016 20:57
nice to have the loop setup to pull from either the dex directly or via NS or Share
diabeticgonewild
@diabeticgonewild
Jan 03 2016 20:57
@dm61 ... @TC2013 did a "study" on the micro boluses: it's on the OpenAPS Dev Google group in the form of an excel spreadsheet
Tony Zarro
@tzarro
Jan 03 2016 21:04
@scottleibrand fair enough...any ideas about what the error means? I've googled "bytearray index out of range", but not comprehending what I can do about it...
Scott Leibrand
@scottleibrand
Jan 03 2016 21:05
That's probably just because those two variables are undefined, and there's no higher-level check for that fact.
I do a grep for rate or duration and then use && to enact if it's got them.
Most Linux commands return "true" on success or various forms of "false" on failure, so you can chain them together with && and ||
Howard Look
@HowardLook
Jan 03 2016 21:07
@danamlewis Crafting a couple of doc edits. Is it true that once the Dex is fully charged, the Pi will not draw power from the Dex (so Dex maintains it's charge while in use)?
Scott Leibrand
@scottleibrand
Jan 03 2016 21:08
USB spec wouldn't allow that.
Howard Look
@HowardLook
Jan 03 2016 21:08
wondering if there are different low-power and high power charging modes (like iPad has)
in practice does the Dex stay charged once plugged in?
Dana Lewis
@danamlewis
Jan 03 2016 21:09
Correct. Pi will never draw power from Dexcom
Howard Look
@HowardLook
Jan 03 2016 21:09
ok thanks
Dana Lewis
@danamlewis
Jan 03 2016 21:09
Yes to that too
Scott Leibrand
@scottleibrand
Jan 03 2016 21:09
Dex would have to be wired up as USB OTG (which it's not) and plugged in to a microusb device to offer up power.
Howard Look
@HowardLook
Jan 03 2016 21:09
Sorry I worded my question ambiguously. I didn't mean OTG.
Scott Leibrand
@scottleibrand
Jan 03 2016 23:12
someone recently figured out how to control single USB ports, so we could set up some scripts to keep the Dexcom port powered off except when we want to read from it. not sure if that would save power overall, but that is what they did for android-uploader
Thomas Emge
@ThomasEmge
Jan 03 2016 23:26
Hi, my name is Thomas Emge and after seeing after seeing lots of news about OpenAPS I decided 2016 is a good year to give it a try. I'll start with setting up the Pi today and then hopefully once the CareLink comes in this week advance from there.
Dana Lewis
@danamlewis
Jan 03 2016 23:27
awesome. welcome @ThomasEmge !
Andrew Warrington
@andrew-warrington
Jan 03 2016 23:57
@scottleibrand, for powering on and off individual USB ports, the utility is here: https://github.com/codazoda/hub-ctrl.c