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

11th
Nov 2015
Tim Howard
@tghoward
Nov 11 2015 00:45
@scottleibrand @bewest have either of you seen this as a result of trying to get the latest treatment data from nightscout?
here's the call and result. Will post ini file next
pi@betacb ~/bcb-s $ openaps use latest-treatments shell test.json
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>
        ^
Traceback (most recent call last):
ini file
pi@betacb ~/bcb-s $ cat latest-treatments.ini
[device "latest-treatments"]
fields = 
cmd = nightscout
args = latest-openaps-treatment bcbsarah.and.rest.of.url.here

pi@betacb ~/bcb-s $
Seeing that it is trying to parse html, I read that as successfully talking to the site, but getting back html instead the expected json?
Scott Leibrand
@scottleibrand
Nov 11 2015 00:49
What is the URI (URL minus hostname) it's requesting?
Tim Howard
@tghoward
Nov 11 2015 00:49
how do I get that info?
Scott Leibrand
@scottleibrand
Nov 11 2015 00:49
what are the contents of test.json?
Tim Howard
@tghoward
Nov 11 2015 00:50
test.json is non-existent
Scott Leibrand
@scottleibrand
Nov 11 2015 00:50
k
Tim Howard
@tghoward
Nov 11 2015 00:51
Parroting the call from one of your lines, you had a pipe and then a file, I think. I'll go find it
Scott Leibrand
@scottleibrand
Nov 11 2015 00:52
openaps alias add latest-ns-treatment-time '! bash -c "nightscout latest-openaps-treatment $NIGHTSCOUT_HOST | json created_at"'
that one?
you can also run that manually for testing:
$ nightscout latest-openaps-treatment $NIGHTSCOUT_HOST | json created_at
2015-11-10T11:02:00-08:00
Tim Howard
@tghoward
Nov 11 2015 00:54

this one

latest-ns-treatment-time ! bash -c "openaps use latest-treatments shell |json created_at"
`

but now I'm not even sure whether that was yours!

Scott Leibrand
@scottleibrand
Nov 11 2015 00:54
yeah, that's the same as mine
or try running just nightscout latest-openaps-treatment $NIGHTSCOUT_HOST to see what you're getting back
Tim Howard
@tghoward
Nov 11 2015 00:55
your direct call to nightscout worked! Nice
I can run with that, I think. :smile:
Scott Leibrand
@scottleibrand
Nov 11 2015 00:55
not sure where your latest-treatments.ini came from
I don't have one of those
oh, but I think I did once upon a time
Tim Howard
@tghoward
Nov 11 2015 00:56
From a @bewest post pretty far up the chain when he was describing it to you
Scott Leibrand
@scottleibrand
Nov 11 2015 00:56
then I simplified it to get rid of the extra device
Tim Howard
@tghoward
Nov 11 2015 00:56
excellent. I'll do the same.
Scott Leibrand
@scottleibrand
Nov 11 2015 00:57
openaps alias add format-latest-nightscout-treatments '! bash -c "nightscout cull-latest-openaps-treatments monitor/pumphistory-zoned.json settings/model.json $(openaps latest-ns-treatment-time) > upload/latest-treatments.json"'
you could do that as a report with a device, but I chose not to, since I don't care about git history on it
Tim Howard
@tghoward
Nov 11 2015 00:59
thanks!
John Males
@johnmales
Nov 11 2015 01:34
I think I've missed where the nightscout command lives? Which repo?
Tim Howard
@tghoward
Nov 11 2015 01:37
in oref0, I'm pretty sure
yes, they are shell scripts in oref0/bin
Tim Howard
@tghoward
Nov 11 2015 01:43
hmm, that might not be exactly right. Might have to wait for the gurus @scottleibrand
Scott Leibrand
@scottleibrand
Nov 11 2015 01:47
That's correct. Dev branch. The nightscout command is in a file confusingly named ns.sh. :-)
When Ben gets back from DC I think he's planning to release oref0 dev to master.
(And maybe rename that file)
John Males
@johnmales
Nov 11 2015 02:33
Ok missed that thanks :)
Ben West
@bewest
Nov 11 2015 16:28
yeah, the file should be renamed
had family in town last week, this week in D.C. :-)
next week is d-data, but a little more free
timomer
@timomer
Nov 11 2015 17:05
@scottleibrand I am using this fork - its not very recent https://github.com/timomer/openaps-js/blob/master/bin/determine-basal.js
@scottleibrand fyi - I have just gotten the native javascript determine-basal.js running in android, I need to do a few more tests and ask we make some changes to determine-basal.js - then I can keep on the same version as you. whats cool, will reach out for a chat soon
Scott Leibrand
@scottleibrand
Nov 11 2015 17:20
Sweet!