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

6th
Jun 2016
Jason Calabrese
@jasoncalabrese
Jun 06 2016 00:21
@scottleibrand were already adding the full contents of iob.json to the ns-status post
And we're using it that way from NS and in Urchin
Need to start thinking about compatibility, the new errors caused some issues
I don't think we should add an extra iob
Paul Martin
@Spazholio
Jun 06 2016 00:53
@bewest I’m back and taking a look at your recommendations. I’ve switched the replace to missing and I started using the -zoned file again, and it seems to be working. However, now the auto-sens.json appears to be running three times instead of the previous two. I’m starting to think my loop just likes messing with me now...
However, I see that some of my dateString entries look like "dateString": "2016-06-06T00:47:27+00:00” and others look like "dateString": "2016-06-05T20:37:06-04:00”. Seems like the ones with the +00:00 are from share2 and the ones with the -04:00 are from my Medtronic. Is that a thing I should be concerned about?
@danamlewis If I enter a regular bolus in the pump, do I also have to put it in CarePortal for AMA? I want to make sure I’m not duplicating effort/entries.
Dana Lewis
@danamlewis
Jun 06 2016 00:57
Nope.
Paul Martin
@Spazholio
Jun 06 2016 00:58
…whoops. =)
Scott Leibrand
@scottleibrand
Jun 06 2016 01:00
@jasoncalabrese new errors?
Dana Lewis
@danamlewis
Jun 06 2016 01:00
It needs carbs, but it can come from either place. Don't enter it both places :)
Scott Leibrand
@scottleibrand
Jun 06 2016 01:01
@jasoncalabrese happy to take IOB back out: just thought it would be useful for consistency.
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:05
just wondering if it will be confusing, I'm sure someone will ask about it
the new errors in bin/oref0-determine-basal.js
since they get added to console.error
Scott Leibrand
@scottleibrand
Jun 06 2016 01:05
oh, the two numbers? I fixed that
that was just debugging output I didn't mean to leave in
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:06
you end up with an array with an error
Scott Leibrand
@scottleibrand
Jun 06 2016 01:06
not sure I follow
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:07
instead of getting expected json data for suggested you get an array with errors
happens in more cases now
Scott Leibrand
@scottleibrand
Jun 06 2016 01:07
I don't get that
example?
I am only getting json data in my suggested.json. any error output either goes to stdout (not to the json file) or is output as valid json. if you're seeing otherwise I need details so we can fix
if there are any errors the structure of the output changes
Scott Leibrand
@scottleibrand
Jun 06 2016 01:11
ah, @bewest's stuff
I thought by "new" you meant stuff I added today
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:12
I don't think those are really error conditions, more like warnings
Scott Leibrand
@scottleibrand
Jun 06 2016 01:12
I have changed some of them to warnings
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:12
just removing the errors.push(msg); would fix it
Scott Leibrand
@scottleibrand
Jun 06 2016 01:13
I think what we want is for it to error out on misconfiguration or old BG data, but warn for anything that might be transient
Ben West
@bewest
Jun 06 2016 01:14
seems like they are errors
Scott Leibrand
@scottleibrand
Jun 06 2016 01:14
@bewest we can't have the loop randomly stop working because I happen to walk into range of a wifi network with a stupid captive portal
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:14
if there isn't a meal.json for some reason we should just ignore it and move on
Scott Leibrand
@scottleibrand
Jun 06 2016 01:14
there are all kinds of reasons the input data might be screwy
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:14
could happen in some cases
Jarred Yaw
@jyaw
Jun 06 2016 01:15
Sort of confused about which version of the OpenAPS and oref0 repos I should be running to implement both AMA and autosens. I found the doc in wip/ama-docs on configuring which is super helpful, but I'm unclear as to whether I also need to update to the dev branch of the OpenAPS repo as well? Does the ama branch of oref0 also include autosens?
Scott Leibrand
@scottleibrand
Jun 06 2016 01:15
(I did see that problem with the captive portal screwing up meal.json, and pushed a fix to make it fail more gracefully there)
@jyaw the oref0 version is mostly independent of the openaps version
Dana Lewis
@danamlewis
Jun 06 2016 01:16
@jyaw yes you need AMA, and yes AMA includes auto sens
Ben West
@bewest
Jun 06 2016 01:16
it's important to be able to predict how a tool like determine-basal will behave
Scott Leibrand
@scottleibrand
Jun 06 2016 01:16
@jyaw oref0 advanced-meal-assist branch includes a more advanced version of autosens as well. a more basic version of autosens is in master, and they use the same inputs, so any autosens reports you already have should also work with AMA branch
Ben West
@bewest
Jun 06 2016 01:17
the way it was without errors I found confusing
Scott Leibrand
@scottleibrand
Jun 06 2016 01:17
@bewest exactly. you need to be able to predict that it will do a certain thing, and fall back to a more conservative thing if it gets garbage from the network. not just randomly stop working entirely
I think we now have it mostly correct as far as erroring on things that are definite configuration errors, and warning on things that might or might not be, but don't affect its ability to loop.
Ben West
@bewest
Jun 06 2016 01:18
right now, it seems to me that people think they have it configured and don't
if I'm telling it I expect it to work with meal data, then it probably shouldn't work if the data is garbage
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:20
but in that case it should just assume no carbs
not fail to low temp
Ben West
@bewest
Jun 06 2016 01:20
if it fails to fetch carbs, it should produce either the old version of carbs of a valid empty carbs
that way it works with no carbs
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:21
in general I think a different result for errors is wrong
the structure of the result shouldn't change
Paul Martin
@Spazholio
Jun 06 2016 01:22
So can anyone think of why my ISF changes fairly differently if I have my CGM connected versus when I don’t?
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:22
I ran into this when I was using 24hr glucose from NS and running off openxshareble
I have the glucose-*.json files getting deleted, so the meal.json report failed
Paul Martin
@Spazholio
Jun 06 2016 01:23
And with the CGM connected, the symbols for auto-sens.json are twice as long as without. Is the select possibly not working as intended?
Ben West
@bewest
Jun 06 2016 01:23
I don't recommend removing the files
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:23
it was a configuration error, but I didn't expect the loop to fail
I was thinking about not removing the files, but there are case where you might have a mess with old files, changing times, etc
openxshareble connecting to someone elses share
Ben West
@bewest
Jun 06 2016 01:25
hmm is that possible? shouldn't be
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:25
I'm pretty sure that happened yesterday
Ben West
@bewest
Jun 06 2016 01:25
was wondering if mine was doing that at qsph
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:26
thats why I'm thinking merging might not be good
nice to start fresh
Jarred Yaw
@jyaw
Jun 06 2016 01:26
@scottleibrand thanks! So the openAPS branch is not a factor in the transition?
Scott Leibrand
@scottleibrand
Jun 06 2016 01:26
@jasoncalabrese which specific errors' json output is problematic?
@jyaw correct, the openaps (lowercase) version is not a factor in switching oref0 to AMA
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:27
the result gets into ns-status, so then suggested/enacted is an array of errors, any code not checking for that have problems
Ben West
@bewest
Jun 06 2016 01:27
I could see adding more switches
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:27
I got a bunch of NaNs in Urchin
Ben West
@bewest
Jun 06 2016 01:27
to provide a strict mode and fallback mode
I'd much rather provide another tool that fixes the inputs or eliminates the actual problem
Scott Leibrand
@scottleibrand
Jun 06 2016 01:28
@jasoncalabrese do you have an example of the array of errors output?
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:28
I'm thinking of a whole system of fallbacks
Ben West
@bewest
Jun 06 2016 01:28
yeah, the fallbacks have to be higher level
if everything low level does a fallback that is invisible, it's very very hard to build on
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:28
make sure something is always working, adapting to what's available
Ben West
@bewest
Jun 06 2016 01:29
and since we're limited on time, I usually opt for strict mode first
"openaps": {
    "suggested": [
      {
        "msg": "Optional feature Meal Assist enabled, but could not read required meal data.", 
        "file": "monitor/meal.json", 
        "error": {}
      }
    ], 
}
that is not expected output
the NS fix to deal with it is checking for status.openaps.enacted.timestamp nightscout/cgm-remote-monitor@7e45277
Ben West
@bewest
Jun 06 2016 01:36
seems like it hsould have error: true somewhere top level or similar
and something prior should ensure that monitor/meal.json exists and is valid empty list
maybe a --fail-with for report
like --fail-with template-error.json
so if it's curl underneath and it blows up, you can still create some kind of response using the template
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:37
maybe always return error, value
for everything
then you could bubble errors up
but would be a huge change
I would like to get rid of the rm's since they cause files to not get committed/added/pushed
Ben West
@bewest
Jun 06 2016 01:42
oref0 copy-fresher --since isn't quite enough?
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:43
maybe just wondering about edge conditions, where knowing you are starting with fresh data is nice
time changes for example would be tricky
Ben West
@bewest
Jun 06 2016 01:46
was thinking about doing ble service for syncing time with mobile app
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:46
I wouldn't trust it till I saw it work a bunch of times
Ben West
@bewest
Jun 06 2016 01:47
it's mainly needed for travel
Scott Leibrand
@scottleibrand
Jun 06 2016 01:47
interesting: @japrobo's PR has an interesting approach to fixing the out-of-order visualization stuff: just put all the dependencies into that phase 1 doc: https://github.com/openaps/docs/pull/223/files Would love to get some feedback on that before merging it to dev
Ben West
@bewest
Jun 06 2016 01:47
thinking the DST stuff will get handled automatically
yeah, just did something similar openaps/docs#134
phase 1 becomes monitor
need everything almost set up for that, need NS and medtronic and glucose data coming in
phase 2 becomes Predict, adding oref0
phase 3 becomes Control, adding cron, finalizing set_temp_basal
I don't think it should go all in one doc either
in phase-1, each vendor should get it's own doc
carelink with all it's gotchas, another for TI stick, etc
Scott Leibrand
@scottleibrand
Jun 06 2016 01:52
I don't think "predict" is the right verb
but overall looks like a big improvement
Maybe something like: Phase 1: Monitoring and Visualization; Phase 2: Creating an Open Loop; Phase 3: Automated Control
Ben West
@bewest
Jun 06 2016 01:56
I didn't get a chance to really dig through this, was mostly importing material from issues and moving it around a bit... seems like pulling in the data needs to be very early, immediately followed by starting to send as much as possible to NS
yeah, that sounds good
but in order for that to happen, they need to do a tutorial on basic openaps stuff
no medical devices, just all cat, ls, echo, "hello world" stuff
forget about looping
trying to figure out how to slice up the recipes to match modules for the docs
think that's what needs to happen
Jason Calabrese
@jasoncalabrese
Jun 06 2016 01:58
@scottleibrand maybe eating now should auto lower targets?
Scott Leibrand
@scottleibrand
Jun 06 2016 02:00
I'd rather that be explicit via temp targets
Paul Martin
@Spazholio
Jun 06 2016 02:01
Seeing as how this is starting to feel like a major rewrite of the docs, would it make sense to create a new docs repo? Like, docs-v2.0 or something? Because while I’m certain lots of the data from the original docs will make it in there, it’s sounding like a from-the-ground restructuring. Would make it easier to stub out the relevant sections as well.
Scott Leibrand
@scottleibrand
Jun 06 2016 02:01
@jasoncalabrese that will also encourage people to do eating soon before the meal, since it continues after carb entry if the hour isn't up yet
@Spazholio I don't think the current PR (openaps/docs#134) is that big of a rewrite. we've done bigger docs changes recently via the same mechanism: merge everything to dev, then give that a bit to bake before merging to master.
what @bewest is describing sounds more like an outline for future changes, but I think we can make most of them incrementally
Paul Martin
@Spazholio
Jun 06 2016 02:04
Fair enough.
Jason Calabrese
@jasoncalabrese
Jun 06 2016 02:11
but with auto eating soon (via eating now) you could set it by using the bolus wizard
Paul Martin
@Spazholio
Jun 06 2016 03:01
If I don’t really eat carbs, but then one night I have more than usual, is it normal for the Dexcom to not be accurate? Because it’s “learned” my non-carby ways or something?
Dana Lewis
@danamlewis
Jun 06 2016 03:01
no
Paul Martin
@Spazholio
Jun 06 2016 03:01
That sucks.
Because it’s a pretty regular occurrence that this thing isn’t all that accurate. Calibrating twice a day seems inadequate. =/
Jason Calabrese
@jasoncalabrese
Jun 06 2016 03:04
Seems that you need to get some calibrations in the upper and lower ends of your range
Paul Martin
@Spazholio
Jun 06 2016 03:06
Oh?
Lynne Butts
@flutelynne_twitter
Jun 06 2016 03:30
I end up doing 3 calibrations a day. One when I wake up, and that is anywhere from 10-20 pts lower than the Dexcom. Mid morning, in which my meter is about 20 pts higher than the Dexcom. Then the last in the evening so I have an idea where I stand with reliability for overnight. I check with the meter about 6-8 times a day.
Paul Martin
@Spazholio
Jun 06 2016 03:32
What bugs me is that they say to NOT over-calibrate, but if the Dexcom is wrong fairly often, then wouldn’t a re-calibration be a good idea? People on FB keep saying that it “confuses” the Dexcom, but I simply can’t see how that’s the case.
Lynne Butts
@flutelynne_twitter
Jun 06 2016 03:35
If it is way off, some people suggest calibrating once every 15 min for three total entries. Sometimes it helps. Sometimes not.
Brian Bonner
@itsn0tm3
Jun 06 2016 03:56
keep in mind that the dexcom and your blood glucose aren't supposed to match exactly
they're two different kind of readings
the dexcom is from a fluid test which is usually about 15 minutes off
the blood glucose should supposedly be close to what your blood glucose is
but they're 2 different kind of readings so it's hard to compare the two sometimes
Paul Martin
@Spazholio
Jun 06 2016 03:57
No, I understand that. But if I have a straight line, then the numbers should be sorta similar, I’d think. Dexcom showing 150, and my meter showing 190 isn’t good. Waking up with the Dexcom saying 60, but my meter saying 90 isn’t good.
Jason Calabrese
@jasoncalabrese
Jun 06 2016 03:58
At least half of that 15 minute delay is the dexcom smoothing
That were raw becomes so useful
Paul Martin
@Spazholio
Jun 06 2016 03:59
I have no idea yet how to utilize raw measurements.
Brian Bonner
@itsn0tm3
Jun 06 2016 04:01
Me either, I started on the G5 so I've got no idea how the raw from the G4 makes a difference
Ben West
@bewest
Jun 06 2016 04:06
Big change is G5 has no raw. Or is very different
Scott Leibrand
@scottleibrand
Jun 06 2016 04:07
@Spazholio I think a lot of the "don't over calibrate" advice is leftover folk wisdom from the pre-505 (AP firmware) days and no longer applies.
Ben West
@bewest
Jun 06 2016 04:07
I find fewer calibrations are better, ymmv
Scott Leibrand
@scottleibrand
Jun 06 2016 04:07
Now the Dex uses the last 11 calibrations, so as long as you're not doing a dozen a day, it should be able to make good use of whatever you give it.
I think what is pretty consistent is that if it's off, calibrating helps.
But testing for every bolus and calibrating all of them is probably overkill.
Paul Martin
@Spazholio
Jun 06 2016 04:11
@scottleibrand Good info to have, thanks.
Jason Calabrese
@jasoncalabrese
Jun 06 2016 04:20
@bewest G5 does have raw, they're pulling it from the receiver
*the transmitter
It doesn't go to the recover
Receiver
fjungman
@fjungman
Jun 06 2016 05:28
I'm getting an error running monitor/glucose.json. It was working, and without even editing anything, it has stopped. Is this when it can't talk to the pump? Preflight passes, so I'm confused about this.
pi@raspberrypi:~/vmax_aps $ openaps report invoke monitor/glucose.json
vmaxdexhandheld://JSON/iter_glucose/monitor/glucose.json
monitor/glucose.json raised 'NoneType' object has no attribute 'iter_records'
Traceback (most recent call last):
File "/usr/local/bin/openaps-report", line 4, in <module>
import('pkg_resources').run_script('openaps==0.1.0', 'openaps-report')
File "build/bdist.linux-armv7l/egg/pkgresources/_init.py", line 719, in run_script
File "build/bdist.linux-armv7l/egg/pkgresources/_init.py", line 1504, in run_script
File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.0-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
app( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.0-py2.7.egg/openaps/cli/init.py", line 51, in call
self.run(self.args)
File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.0-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.1.0-py2.7.egg/openaps/cli/subcommand.py", line 52, in call
return self.method.main(args, app)
File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.0-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.1.0-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.1.0-py2.7.egg/openaps/vendors/dexcom.py", line 271, in main
for item in self.dexcom.iter_records(self.RECORD_TYPE):
AttributeError: 'NoneType' object has no attribute 'iter_records'
Report looks like this:
pi@raspberrypi:~/vmax_aps $ openaps report show monitor/glucose.json
vmaxdexhandheld://JSON/iter_glucose/monitor/glucose.json
[report "monitor/glucose.json"]
device = vmaxdexhandheld
count = 5
use = iter_glucose
reporter = JSON
fjungman
@fjungman
Jun 06 2016 05:36
Connection to Dexcom looks good.
Rebooted, still not working.
Ben West
@bewest
Jun 06 2016 06:08
hmm
0.1.0 is oldish, you could upgrade, but I don't think it would solve issue
I like blame cables, because they are easy to blame
Ben West
@bewest
Jun 06 2016 06:13
could it be cable has gone bad? that's most likely explanation given context
Jason Calabrese
@jasoncalabrese
Jun 06 2016 06:53
@bewest I was hoping that with 2 files copy-fresher would pick the newest, but it will cat them all if new enough, I guess I need something new
what I'd like is a way to copy the newest of 2 or more files
copy-freshest
was trying with this
[report "monitor/glucose-fresh.json"]
device = oref0
use = shell
remainder = copy-fresher --since 300 monitor/glucose-ns-raw.json /home/indy/cgm-loop/monitor/glucose.json
reporter = text
Ben West
@bewest
Jun 06 2016 07:30
@jasoncalabrese ah nice distinction
that sounds like copy-freshest-of
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:33
what I want to do is have a cgm-loop always going in another directory, and then always try to pull from NS in the main loop, and then pick the freshest
file times aren't really the right thing to compare
and select would get some entries, maybe from both files
but I don't want to mix them
Ben West
@bewest
Jun 06 2016 07:35
if file time is not right, what would be?
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:36
the dateString of the first entry
Ben West
@bewest
Jun 06 2016 07:36
select [--selector date]
thats what it does with lsgaps
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:36
but that would mix files
then deltas would be screwed up
Ben West
@bewest
Jun 06 2016 07:37
eh, using it causes openaps to not upload entries while android-uploader is uploading
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:37
not with 2 receivers
Ben West
@bewest
Jun 06 2016 07:38
ah, you get :03 mixed with :05's?
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:38
times might be close since they are using the same transmitter
Ben West
@bewest
Jun 06 2016 07:38
my usage indicates that doesn't happen, even with multiple uploaders
but multiple receivers... dunno
yeah, that's interesting
maybe an option on select would fix it
select --isolate-latest-date
or on lsgaps maybe
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:39
it's more select-file
Ben West
@bewest
Jun 06 2016 07:40
hmmm
so select-latest-source [--from-date] (true by default?)
with similar --date switch
dunno
interesting, super subtle
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:41
yeah
also to make things more complicated I'm thinking about multiple receivers paired to the edison at once
Ben West
@bewest
Jun 06 2016 07:42
feels like need to introduce --append and maybe --fail-from template.json for report first
and see what shakes out from that
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:42
wondering how to swap them
Ben West
@bewest
Jun 06 2016 07:43
hmm, yeah I see your point selecting source
my thought was to allow sources to provide valid null outputs on demand
and to provide support against a cache
so if it fails, instead of wiping out, it simply appends nothing to a cache
that way you can select across multiple sources and the latest would get culled
and everything always tries the same way every time, that's important
fewer if/else statements
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:45
the checks are slow, so you don't want to wait
Ben West
@bewest
Jun 06 2016 07:45
well, that's where daemon support with triggers comes in :-)
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:45
thats why I'm thinking separate loops
Ben West
@bewest
Jun 06 2016 07:45
daemon can control each resource
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:46
yeah, thats the way, but not for next week
Ben West
@bewest
Jun 06 2016 07:46
hmm
on tangent, been thinking about supporting oref0 export-loop as part of openaps looping
so if git status fails, try to recover with say oref0 reset-git, and if that fails reset .git and do openaps import backup-loop.json
if git status works, backup oref0 export-loop backup-loop..json
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:49
are ini files still getting wiped out?
Ben West
@bewest
Jun 06 2016 07:49
no, they should not be
waiting for confirmation of a negative
Jason Calabrese
@jasoncalabrese
Jun 06 2016 07:50
then why do an import, the ini would already be there
Ben West
@bewest
Jun 06 2016 07:51
hmm no good answer I guess
in fact, the recent evidence in channel matches what you say
once git is reset it just works
@flutelynne_twitter uses the new stuff and had some corruption and it just worked without an import
the pump session file can get wiped out at will and it'll just work now
it doesn't conk out openaps anymore
problem is that wasn't the root cause of issue, "pump session failing"
problem truly is power going out unexpected
if we can get power monitoring working, we can shut down safely and prevent any corruption issues
that would solve everything
Chris Oattes
@cjo20
Jun 06 2016 09:46
bewest: For an edison, couldn't you just set up a cron job that logs the voltage every minute until it dies, repeat a few times and see what voltage level it drops off at. If it's at all consistent, just set it to shut down 15/30 minutes before it reaches that threshold. Or have I misunderstood something?
Paul Martin
@Spazholio
Jun 06 2016 14:17
@bewest Where was that "how to get a new device set up using the new tools" doc? Thinking of getting my Edison up and running, and seeing if a fresh install eliminates some of the issues I've been saying. I have that doc open on my laptop at home, but I'm at work now...
David Cintron
@loudestnoise
Jun 06 2016 14:20
Howdy OpenAPSers. Been sorta-looping this weekend. Did my first overnights the last two nights. Now just waiting my smaller battery pack that does pass through charging so I can ditch this brick of a battery I’ve been using
@Spazholio I think it might be this - openaps/docs#132
Paul Martin
@Spazholio
Jun 06 2016 14:21
Bingo, thanks.
C-Ville
@C-Ville
Jun 06 2016 14:22
@bewest for the pi there are uninteruptable power supplies, for the Edison I did not yet find anything.
Paul Martin
@Spazholio
Jun 06 2016 14:24
Well, for the Edison, you can use a regular LiPo if you have the Sparkfun board. Heck, you can do the same with the BO board, I believe.
Lynne Butts
@flutelynne_twitter
Jun 06 2016 15:04
@loudestnoise Congrats! I am still waiting for infusion sets to do it live. When you ssh'd through your hot-spotted iphone, what kind of "ssh pi@..." do you use? The home wifi number or another one?
@loudestnoise I installed serverauditor and have used my phone to ssh at home, just not out of the house yet.
Paul Martin
@Spazholio
Jun 06 2016 15:07
Yeah, I'm kinda curious about that as well. I don't know the IP that my rig is given when connected to the iPhone hotspot, so can't directly connect.
Lynne Butts
@flutelynne_twitter
Jun 06 2016 15:11
@Spazholio I should be getting the battery today that was suggested from you and another person. Tried using a battery I've had for overnight, started it at 8:30PM fully charged, but it konked out by 3AM. It was looping great until then.
Paul Martin
@Spazholio
Jun 06 2016 15:11
Ouch. I keep everything plugged into the wall at all times, if I can. Battery is just for the car, otherwise, it's got power. It's worked well for me.
Lynne Butts
@flutelynne_twitter
Jun 06 2016 15:16
I'm not using it "live" yet. The incredibly short power plug to charge is so short for that battery. When the new one comes today, I will make sure that I keep it plugged in while at home, but I do walk around a lot in the house. Worried about distance and looping, I guess.
Scott Leibrand
@scottleibrand
Jun 06 2016 15:35
I usually use raspberrypi.local or similar to connect the first time on a given network, and then note the IP address so I can try both ways if needed.
David Cintron
@loudestnoise
Jun 06 2016 15:35
@flutelynne_twitter @Spazholio The complexity of the hotspot (at least for iOS) is confusing to me. Also, using it over WiFi was killing my normally all day battery on my iPhone 6s Plus. I ended up just turning on hotspot so I could SSH in from my iPhone and shutdown so I could do battery changes (don’t have my charge through pack yet)
and sometimes it would connect first try using raspberrypi.local
sometimes not
but yeah, since you don’t know the IP using the zerconfig bonjour magic is the way to go
I’m currently working on setting up reverse SSH so I can use my Linux VPS to SSH back to the Pi like @Spazholio said he does.
Lynne Butts
@flutelynne_twitter
Jun 06 2016 15:38
Thanks @scottleibrand and @loudestnoise
David Cintron
@loudestnoise
Jun 06 2016 15:38
I’m trying to figure out how the autossh works to keep it persistent
Lynne Butts
@flutelynne_twitter
Jun 06 2016 15:39
Another
Jason Calabrese
@jasoncalabrese
Jun 06 2016 15:43
autossh is for creating a tunnel to a server, I'm using it, but needed a script to periodically kill/restart autossh, not fully auto
David Cintron
@loudestnoise
Jun 06 2016 15:51
seems like it has the ability to check if the server is alive and try again if it fails. Looked like it would work well. My brain starts to hurt though when I read instructions that talk about which server is SSHing into what from where
I’ve been able to use just ssh -f -N -R 2222:localhost:22 remoteuser@remoteserver from my RPi and then SSH on the remote server using ssh -p 2222 RPiUser@localhost
David Cintron
@loudestnoise
Jun 06 2016 15:56
and so now I’m using this autossh -M 10900 -fN -o "PubkeyAuthentication=yes" -o "StrictHostKeyChecking=false" -o "PasswordAuthentication=no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 2222:localhost:22 remote@remoteserver
Paul Martin
@Spazholio
Jun 06 2016 16:03
My issue is I set up the reverse SSH connection and it's fine. Then I leave work and go home, so the network changes, but the rig doesn't KNOW that so it doesn't know to kill the running SSH process and reinitialize.
Jason Calabrese
@jasoncalabrese
Jun 06 2016 16:03
#!/bin/bash

killall -g --older-than 30m ssh
killall -g --older-than 15m autossh

if ! /bin/ps -ef | /bin/grep autossh | /bin/grep 2223 | /bin/grep -v grep > /dev/null; then
  echo no autossh process, opening new tunnel
  autossh -M 0 -N -f -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -R 2223:localhost:22 user@remotehost &
fi
is what I'm using
Paul Martin
@Spazholio
Jun 06 2016 16:03
Does your solution get around that? I think I tried the "ServerAlive" directives, but didn't get much use...
Then again, might have done it wrong. =)
Jason Calabrese
@jasoncalabrese
Jun 06 2016 16:03
it's ugly and I thought the whole point of autossh was to avoid that kind of thing
but after lots of fiddling I just stuck with it
Paul Martin
@Spazholio
Jun 06 2016 16:05
@jasoncalabrese So that solution that you just posted works well even when network hopping? And it looks like it's killing ssh and autossh indiscriminately, so I might get booted in the middle of a session?
Jason Calabrese
@jasoncalabrese
Jun 06 2016 16:05
I also have a script that pings my server and restarts network if needed
I've extended that to also kill autossh
I run the restart-autossh script every minute, and the wifi check every 5mins
the wifi script echo's the rigs ip to logs, so if you're using papertrail you can see the new ip and connect by ip even if mdns isn't working and .local doesn't work
Paul Martin
@Spazholio
Jun 06 2016 16:08
I actually use dynamic DNS, so I could set that up, and just connect to the IP that way. Doesn't help when I'm NATted but helps for the hotspot.
Dan Piessens
@dpiessens
Jun 06 2016 17:40
I created it based on my setup but it's pretty universal to get everything installed. There's also a fun updater script in there for the code
Paul Martin
@Spazholio
Jun 06 2016 17:41
And it uses @bewest's new templating stuff?
(and I'm using systemd now, so I'm wondering if I should avoid that ./configure flag...?)
Dan Piessens
@dpiessens
Jun 06 2016 17:48
Well there's no templating for the config, this just sets up all the dependencies and installs the code from the various source branches
Paul Martin
@Spazholio
Jun 06 2016 17:49
Ok, cool. I have to reflash one of my Edisons again so I'll give this a shot.
Paul Martin
@Spazholio
Jun 06 2016 17:59
@jasoncalabrese Does that autossh script kill every ssh process every 15 minutes, and every autossh process every 30, regardless of use?
JaysonEwer
@JaysonEwer
Jun 06 2016 17:59
@Spazholio I use Hericane Electric Network tools app on my iPhone to scan for all hosts on my iPhone hotspot. It's usually the only host other than the gateway, unless I connect my iPad. Also, it gets the same local IP every time so I don't have to check I just reconnect to the up it was last time.
Paul Martin
@Spazholio
Jun 06 2016 17:59
Huh. I have a network tools app. Should have thought to use that. Good call.
JaysonEwer
@JaysonEwer
Jun 06 2016 17:59
Hurricane Electric, rather.
Scott Leibrand
@scottleibrand
Jun 06 2016 18:04
another trick I use is to make a nonsense GET request against my web server with the private IP of the rig in the URL, so it shows up in my web server logs. :)
Paul Martin
@Spazholio
Jun 06 2016 18:06
Ooooh, nice. Heck, with minimal coding, I could just have a POST write to a text file I can access with the IP addresses of all my rigs. Hmmmmm...
Scott Leibrand
@scottleibrand
Jun 06 2016 18:08
or run BIND and do a custom dynamic DNS setup...
I wonder if anyone has a commercial dyn-dns setup that could be used to push the local IP into a hostname
Jason Calabrese
@jasoncalabrese
Jun 06 2016 18:29
@Spazholio yeah, it's really brute force, and annoying sometimes, but there's always something else to work on before getting back to it
fjungman
@fjungman
Jun 06 2016 18:32
Thanks, @bewest , even though it looked like the cable had connected (showed charging icon) it required much more finesse to get it actually talking over the data lines. It works now! Another perfect night of no lows or highs!
Paul Martin
@Spazholio
Jun 06 2016 18:41
Yeah, near as I can tell there's no way to tell if a SSH session is actually alive. Or more to the point, to tell if it's truly dead. I suppose just restarting on a schedule and/or trying incessantly whenever the network goes down isn't really too horrible.
ryanchen26
@ryanchen26
Jun 06 2016 19:16
General OpenAPS observation: It feels like when the BG is climbing, OpenAPS generally wants to ramp up hard (to high basal rates - 0.9-1.5u - we've never used - almost to push out a micro-bolus) to knock it down quick, and then throttle back.
high relative to our sons typical needs.
Dana Lewis
@danamlewis
Jun 06 2016 19:18
yea. and remember it’s a temp for 30, so it’s half of that which would be delivered if it ran to completion. so .9u/hr if it ran for the full 30 would be equivalent to .45u delivered
ryanchen26
@ryanchen26
Jun 06 2016 19:21
Right, and those temp for 30min can by dynamically stopped and adjusted by the system anyway depending on conditions. I guess we see the suggested, say gosh that seems aggressive, and 5,10,15minutes later it changes...we just need to get used to how dynamic things are on the system. Side note, I had the blue basal line working on NS for a brief moment one evening (with T: XXXXX in the basal pill), but it's no longer doing that...I think I need to fix that tonight to understand the rate changes better. Thanks.
Scott Leibrand
@scottleibrand
Jun 06 2016 19:23
@ryanchen26 one thing to look at is whether it's ever setting temps that, if run to completion for 30m, would end up giving enough insulin that it would cause a low. if so, your targets or ISF may be too low or something...
Brett
@burgertime14
Jun 06 2016 19:23

@Spazholio pi@raspberrypi:~ $ cat mail-ip.sh

!/bin/sh

SUBJ="APS_IP_Update"
EMAIL="XXX@gmail.com"

ip1=""
ip2=""

read ip1 < ip.txt
ip2=$(ifconfig | grep Bcast | awk {'print $2'} | awk -F: {'print $2'})

if [ "$ip1" = "$ip2" ]
then
exit
else
echo "$ip2" > ip.txt
echo "$ip2" | mail -s $SUBJ $EMAIL
exit
fi
Hack I stole and made it do what I wanted, sends an email on every change of IP

Dana Lewis
@danamlewis
Jun 06 2016 19:23
yea. keep in mind that it’s actually conservative, assuming that the last command it gets is the last it’ll be able to send. but you can also cap that by setting your max iob and max basal, if you decide that might be too agressive.
ryanchen26
@ryanchen26
Jun 06 2016 19:28
@danamlewis Oh we've definitely capped it (0.250 for now) and we are taking notes. With our testing phase of manually entering suggested basal rates, we can't seem to input the changes fast enough....we can already see that if the pump were attached it would result in what appears to be better BG control. So it is all very encouraging.
Dana Lewis
@danamlewis
Jun 06 2016 19:29
ah, cool, wasn’t sure what phase you were at :)
ryanchen26
@ryanchen26
Jun 06 2016 19:30
@scottleibrand I asked this previously....I found that if I entered over 100 ISF in the pump, the loop, when executed would error because it would see the high ISF number and interpret it as -1 and the loop would fail. So I set all ISFs to 100 for now. Are ISF limits hard coded into OpenAPS? My son has 300, 400, 275 etc...throughout the day typically.
Dana Lewis
@danamlewis
Jun 06 2016 19:34
@ryanchen26 wondering what @ddaniels1 has for ISF levels, imagining they might be similarly high, and seeing if he has any similar bugs he’s found
they read from the pump, but we’re obviously not handling the data correctly, so we need to look into that
ryanchen26
@ryanchen26
Jun 06 2016 19:39
Okay, I'll see about recreating the error tonight and report on gitter.
Dana Lewis
@danamlewis
Jun 06 2016 19:39
:+1: that would be great, thanks
ryanchen26
@ryanchen26
Jun 06 2016 20:15
openaps_info_box.jpg
Given the following openaps pill information, and the fact that we set max basal in the pump to 1.0u, why would the command sent to the pump be 0.5u? Does it want to go to 0.9? Shouldn't it be able to?
Dana Lewis
@danamlewis
Jun 06 2016 20:17
maxsafebasal, there’s also caps based 3x max basal, and 4x current
ryanchen26
@ryanchen26
Jun 06 2016 20:20
I think I get it.
elodaille01
@elodaille01
Jun 06 2016 20:51
hi
Ben West
@bewest
Jun 06 2016 20:52
howdy :-)
elodaille01
@elodaille01
Jun 06 2016 20:52
I can not copy npm file in bin directory
he says I are not rights
Can help me ?
please
I'm not in the right room ?
somebody is here ?
Scott Leibrand
@scottleibrand
Jun 06 2016 20:57
@elodaille01 you should try pasting the exact command you're trying to run and the error message you're seeing
elodaille01
@elodaille01
Jun 06 2016 20:57
bye
Scott Leibrand
@scottleibrand
Jun 06 2016 20:58
pasting the actual commands is the easiest way around the language barrier. :)
David Cintron
@loudestnoise
Jun 06 2016 20:58
:grimacing:
do I start to see these errors more when my battery is about to die on my pump?
Jun  6 15:55:50 raspberrypi openaps-loop: pump://JSON/read_clock/monitor/clock.json
Jun  6 15:55:50 raspberrypi openaps-loop: Traceback (most recent call last):
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/bin/openaps-report", line 4, in <module>
Jun  6 15:55:50 raspberrypi openaps-loop:     __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
Jun  6 15:55:50 raspberrypi openaps-loop:   File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 719, in run_script
Jun  6 15:55:50 raspberrypi openaps-loop:   File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 1504, in run_script
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
Jun  6 15:55:50 raspberrypi openaps-loop:     app( )
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
Jun  6 15:55:50 raspberrypi openaps-loop:     self.run(self.args)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
Jun  6 15:55:50 raspberrypi openaps-loop:     output = app(args, self)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
Jun  6 15:55:50 raspberrypi openaps-loop:     return self.method.main(args, app)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 40, in main
Jun  6 15:55:50 raspberrypi openaps-loop:     output = task.method(args, app)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 45, in __call__
Jun  6 15:55:50 raspberrypi openaps-loop:     output = self.main(args, app)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 327, in main
Jun  6 15:55:50 raspberrypi openaps-loop:     return self.pump.model.read_clock( )
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.28-py2.7.egg/decocare/models/__init__.py", line 25, in __call__
Jun  6 15:55:50 raspberrypi openaps-loop:     self.response = inst.session.query(self.msg, **kwds)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.28-py2.7.egg/decocare/session.py", line 101, in query
Jun  6 15:55:50 raspberrypi openaps-loop:     self.execute(command)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.28-py2.7.egg/decocare/session.py", line 98, in execute
Jun  6 15:55:50 raspberrypi openaps-loop:     return super(type(self), self).execute(command)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.28-py2.7.egg/decocare/session.py", line 39, in execute
Jun  6 15:55:50 raspberrypi openaps-loop:     self.download( )
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.28-py2.7.egg/decocare/session.py", line 54, in download
Jun  6 15:55:50 raspberrypi openaps-loop:     self.command.respond(data)
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.28-py2.7.egg/decocare/commands.py", line 61, in respond
Jun  6 15:55:50 raspberrypi openaps-loop:     self.getData( )
Jun  6 15:55:50 raspberrypi openaps-loop:   File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.28-py2.7.egg/decocare/commands.py", line 642, in getData
Jun  6 15:55:50 raspberrypi openaps-loop:     'hour'  : int(data[0]),
Jun  6 15:55:50 raspberrypi openaps-loop: IndexError: bytearray index out of range
It still says Battery: Normal, but it’s the last little bit on the pump battery status
elodaille01
@elodaille01
Jun 06 2016 21:02
someone here ?
Jason Calabrese
@jasoncalabrese
Jun 06 2016 21:03
@loudestnoise could be interference also, lots of issues that could cause that
elodaille01
@elodaille01
Jun 06 2016 21:03
Hello
Jason Calabrese
@jasoncalabrese
Jun 06 2016 21:04
@elodaille01 :point_up: June 6, 2016 1:58 PM
ryanchen26
@ryanchen26
Jun 06 2016 21:09
Previous I mentioned that my blue basal line in nightscout briefly showed the dynamic changing of the basal rate by OpenAPS before stopping and just showing the fixed pump program. Now, sitting here at work, suddenly I can see the last 4 hours of basal history represented in the blue line. Odd
David Cintron
@loudestnoise
Jun 06 2016 21:12
@jasoncalabrese Hmm, pump is sitting a few inches from carelink stick. I just watched the loop run in the last 10 minutes and first time it ran just fine, second time threw that same bit of errors
@ryanchen26 so you fixed it! :wink2:
live4sw
@live4sw
Jun 06 2016 21:31
Hi all - starting to think about setting up meal-assist and auto-sens. Are both of these included in the most recent master? In addition, I see the section of the docs titled "Configuring Automatic Sensitivity and Meal Assist Mode" only discussed auto-sens. Are those instructions still current?
Scott Leibrand
@scottleibrand
Jun 06 2016 21:44
those instructions are not fully fleshed out yet
there are some PRs open, and a wip/ama-docs branch, with some additional details
but the features themselves are in oref0 master, yes
Dan Piessens
@dpiessens
Jun 06 2016 21:46
Is there a way to track down in the data that's causing this error when I run the new autosense in AMA? avgDelta = avgDelta.toFixed(2); ^ TypeError: Object NaN has no method 'toFixed' at detectSensitivityandCarbAbsorption (/home/edison/src/oref0/lib/determine-basal/cob-autosens.js:50:29) at Object.<anonymous> (/home/edison/src/oref0/bin/oref0-detect-sensitivity.js:73:5) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3
live4sw
@live4sw
Jun 06 2016 21:46
oh ok, just checking back on that. will probably continue to hold off in that case.
thx
Scott Leibrand
@scottleibrand
Jun 06 2016 21:49
@live4sw if you want to proceed with setting them up and flesh out the docs as you go, that would also be appreciated. :)
@dpiessens looks like your avgDelta is not a number. you'll need to look at where that's coming from, and check the input files. we might also need to add a null check and a more user-friendly error message earlier in the process once you figure out where it's coming from
Ben West
@bewest
Jun 06 2016 21:51
@elodaille01 sorry, people come and go from chat quite often, it sounds like you're having an issue with npm? if you can show us the npm command you tried and what the error was, we can discuss how to fix
Ben West
@bewest
Jun 06 2016 21:57
that often happens when feeding NS data into oref0 tools
the NS data contains mbg and cal data, stuff that is not sgv
I think it could be fixed by oref0 tools ignoring non-sgv data
or we could have another tool that strips it out as an interstitial prep report
Dan Piessens
@dpiessens
Jun 06 2016 21:59
@bewest @scottleibrand I found it: in oref0/lib/determine-basal/cob-autosens.js line 48 errors if it can't find the glucose data (got that message) then it tries to calculate the delta anyway
on line 50
Scott Leibrand
@scottleibrand
Jun 06 2016 21:59
is that the same as openaps/oref0#127 ?
Paul Martin
@Spazholio
Jun 06 2016 22:01

@scottleibrand I’m looking to figure out why my auto-sens.json is different when I have my Dexcom connected versus when I don’t. Here’s a big of info that I’ve gathered:

Dexcom + NS data
116316 Jun  6 17:50 monitor/glucose.json
-+++++++++--+++++>++--+++++++-++-++++-+-+++++-+++++++---+-+-+++-----++-+----+++--++-++--++-+-++--+-++++-++++++++-+-----++--=-+-++-++------+----+++++--++-------------+--++++++++++++++++--+-++++++-+++++++--+++>>>>>>>>+++++++-++>>>+++++-+++-+++++++>>>>>>>>>>>>>>>>++++++-----+----------+++++++--++++--
298 chars
301 JSON entries
Excess insulin resistance detected: ISF adjusted from 20 to 17


NS only
105791 Jun  6 17:55 monitor/glucose.json
++-+++++++++--+++++>++--+++++++-++-++++-+-+++++-+++++++---+-+-+++-----++-+----+++--++-++--++-+-++--+-++++-++++-++-+-----++--++
126 chars
288 JSON entries
ISF adjusted from 20 to 16

It looks like there’s an extra hour being counted (there are 13 extra entries in the Dexcom + NS). But the auto-sens.json seems to have WAAAAY more symbols than it should? Thoughts?

Dan Piessens
@dpiessens
Jun 06 2016 22:01
Most likely, no error in there but I have a similar setup to @Spazholio
Paul Martin
@Spazholio
Jun 06 2016 22:01
And last night when I was doing the same thing, one way, my ISF would adjust to 30 from 20, and the other way it would adjust to 22 from 20. Large difference.
Oh hey, looks like @dpiessens and I are doing the same thing?
Scott Leibrand
@scottleibrand
Jun 06 2016 22:04
@Spazholio I would uncomment or add a console.error line to print out more details on each glucose value it's parsing, rather than just the single character
I've left some useful debug statements in the code commented out, or you can add similar ones as needed elsewhere
Paul Martin
@Spazholio
Jun 06 2016 22:06
Where does the code live now? I’m not using the ~/src dir anymore. And would that result in 298/126 different console statements? I’ll do it, but that’s gonna be a large bit o’ data. =)
Scott Leibrand
@scottleibrand
Jun 06 2016 22:07
well, that's what ~/src is for: mucking around in the source locally for debugging
might also be worth doing a diff of the two glucose.json files
Dan Piessens
@dpiessens
Jun 06 2016 22:09
ccccccevnhuunfgbvjgdhvvcgdcrlunevcjfebiljtcb
Scott Leibrand
@scottleibrand
Jun 06 2016 22:09
that was a very secure password you had there. :-p
Paul Martin
@Spazholio
Jun 06 2016 22:10
Which file specifically is that in? I’m looking in my /usr/local/bin but I don’t know which one it’s in. oref0-determine-basal?
Scott Leibrand
@scottleibrand
Jun 06 2016 22:12
lib/determine-basal/cob-autosens.js: process.stderr.write("+");
Paul Martin
@Spazholio
Jun 06 2016 22:13
Got it.
Running another loop so I can diff the two files.
Dana Lewis
@danamlewis
Jun 06 2016 22:15
@dpiessens cat crossing? ;)
Paul Martin
@Spazholio
Jun 06 2016 22:15
I’ll enable the console output in a few.
(my money was on “spider on the keyboard”)
eyim
@eyim
Jun 06 2016 22:18

@Spazholio @jasoncalabrese @loudestnoise Hey Guys - so this is what I am doing for SSH tunnel that seems to work well even if I change networks:

Create script on my edison called autossh.sh - I sudo nano autossh.sh then copy in the stuff below:

#!/bin/bash

if pgrep 'autossh$' ; then
  echo already running
else
  echo starting autossh
  autossh -R 55555:localhost:22 login@sshserver.info -N &
fi

then

sudo chmod +x autossh.sh to make executable

then add to crontab:

          • /home/edison/ti/autossh.sh >/dev/null 2>&1
Paul Martin
@Spazholio
Jun 06 2016 22:28
Looks like diffing probably won’t work as the order of items in the JSON elements differ from file to file. And the elements themselves, sometimes.
Paul Martin
@Spazholio
Jun 06 2016 22:56
@scottleibrand Do you want me to do a console.log for every single symbol? Or do you think just picking one would be sufficient? If so, which one?
@dpiessens I have a workaround for the issue you’re encountering, if you’d just like to get the loop up and running again.
Scott Leibrand
@scottleibrand
Jun 06 2016 22:58
@Spazholio this is one of those things where I just try something and see what it gives me, and then try again
often based on what's easiest to do in the code. usually you're just gonna run it once or twice and then remove it anyway
Paul Martin
@Spazholio
Jun 06 2016 23:00
That’s true. However, I’m gonna need help looking at the data, so I figured I’d give you some say. =)
Scott Leibrand
@scottleibrand
Jun 06 2016 23:01
all we're really trying to do is figure out what all those extra symbols are from, so if you print something unique (maybe a date string) from each of them, you should be able to see what it's processing
not sure you need me for that. :)
Paul Martin
@Spazholio
Jun 06 2016 23:01
Good call.
Jason Calabrese
@jasoncalabrese
Jun 06 2016 23:11
that's much cleaner than my hack @eyim, I was wondering if the process was just hung and still running
Paul Martin
@Spazholio
Jun 06 2016 23:11
@eyim I have something very close to that, and it’s not working. That being said, I’ll be switching over to that tonight, and report back tomorrow. Thanks!
@scottleibrand Ok, I’m feeling a bit dumb. When working in a browser, I know how to see console.log entries, but where are those shown when running the loop? I don’t see them in my output.
eyim
@eyim
Jun 06 2016 23:14
It still gets hung every once in a while for me as well but overall seems to work
Paul Martin
@Spazholio
Jun 06 2016 23:15
Does the process die if you switch networks? I don’t see anything in there that would cause it to restart, or self-heal or anything like that.
I’m also not very familiar with autossh.
Scott Leibrand
@scottleibrand
Jun 06 2016 23:16
@Spazholio you probably want console.error rather than console.log. most of these tools' stdout has to be json for things to work properly.
when you run the command from the command line, console.error goes to stderr, and console.log to stdout
eyim
@eyim
Jun 06 2016 23:18
Sorry I am not that familiar with it either. My dev guys argued for a while about the best way to do this before deciding on this (they aren't experts in this area they claim) but I bounce between networks and it seems to work most of the time (sometimes still gets hung for a period of time)

FYI here is the full instructions:
Create SSH key on edison device

https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
ssh-keygen -t rsa
on file to save key - just hit enter
No passphrase

to see key:
cat /home/edison/.ssh/id_rsa.pub

Add public key to server

Add auto SSH on edison
sudo apt-get install autossh ssh

ssh login@server.info and then login

a) Create script on edison autossh.sh

#!/bin/bash

if pgrep 'autossh$' ; then
  echo already running
else
  echo starting autossh
  autossh -R 55555:localhost:22 login@server.info -N &
fi

sudo chmod +x autossh.sh to make executable

then add to crontab:

          • /home/edison/ti/autossh.sh >/dev/null 2>&1

2) to log in then have to first log into server first

SSH login@server.info using RSA key

Need to change out the login@server.info with the correct info for your server
Paul Martin
@Spazholio
Jun 06 2016 23:44
@scottleibrand With the Dexcom unplugged, it goes all the way back to Mon Jun 06 2016 09:17:25 GMT-0400 (EDT). With it plugged in, it goes back to -Sun Jun 05 2016 18:57:11 GMT-0400 (EDT). Shouldn’t it be evaluating 288 entries from NS? If my math is right, it’s only doing 12 hours worth from NS - 144, so exactly half.
Scott Leibrand
@scottleibrand
Jun 06 2016 23:48
do you have non-sgv entries in there too?
perhaps count=288 is getting 144 sgv entries and 144 of something else?
Paul Martin
@Spazholio
Jun 06 2016 23:48
Checking...
sgv appears 258 times in the glucose.json that’s taken strictly from NS.
Ben West
@bewest
Jun 06 2016 23:50
you can add ?find[type]=sgv to get only sgv entries
err count=288&find[type]=sgv
Scott Leibrand
@scottleibrand
Jun 06 2016 23:51
that might also fix your and @dpiessens' other problem
Paul Martin
@Spazholio
Jun 06 2016 23:51
I’ll do that, but still - I only have 144 entries when there’s 258 that have valid sgv entries. Isn’t that wonky?
Scott Leibrand
@scottleibrand
Jun 06 2016 23:52
is that when parsing the ns file directly, or after merging it?
Paul Martin
@Spazholio
Jun 06 2016 23:53
No merging. This is the one that exists in raw-ns/glucose.json
Ben West
@bewest
Jun 06 2016 23:53
openaps use ns shell get entries.json 'count=288&find[type]=sgv' | json -a dateString sgv | uniq -c | wc -l
Paul Martin
@Spazholio
Jun 06 2016 23:53
Also, @bewest - I know there was a question as to whether or not (I think) the select would work as intended when the raw-cgm/glucose.json wasn’t present. As far as I can tell, it does.
Ben West
@bewest
Jun 06 2016 23:54
have couple dupes in mine, so result in 284 instead of 288
Paul Martin
@Spazholio
Jun 06 2016 23:54
Now it’s 288.
Hmmm….
Hang on...
[device "ns-glucose"]                                                                                                                                                                                                                                                                                                 
fields =.
cmd = bash
args = -c "curl -s https://www.lexal.net:1337/api/v1/entries.json?count=288 | json -e 'this.glucose = this.sgv'"
Ben West
@bewest
Jun 06 2016 23:55
that's not the ns device if you add &find[type]=sgv it'll change the search syntax
you can use ns device though since the search syntax allow this
Paul Martin
@Spazholio
Jun 06 2016 23:56
Yeah, my ns device is set up using the “new” method.
Ben West
@bewest
Jun 06 2016 23:56
openaps report add raw-ns/glucose.json JSON ns shell get entries.json 'count=288&find[type]=sgv'
Paul Martin
@Spazholio
Jun 06 2016 23:56
Should I replace my ns-glucose calls in my loop to ns?
ryanchen26
@ryanchen26
Jun 06 2016 23:56
Fixed my basal blue line / iob pill readout in NS. I was feeding latest-treatments.json and monitor/iob.json pumphistory.json when I should have been giving it pumphistory-zoned.json. Looks like it's working now.
Paul Martin
@Spazholio
Jun 06 2016 23:57
Ok, cool. And the new behavior is to remove my old report and replace it with this new one, right?
Scott Leibrand
@scottleibrand
Jun 06 2016 23:57
@ryanchen26 :clap: :)
Ben West
@bewest
Jun 06 2016 23:57
yeah, we created ns-glucose in particular to add the extra json step at the end
Scott Leibrand
@scottleibrand
Jun 06 2016 23:57
@ryanchen26 is that something that a tweak to the docs would've helped you find earlier? if so, you should PR it in.
Ben West
@bewest
Jun 06 2016 23:57
but it turns out ns supports it using the search syntax directly, so we don't need it
Paul Martin
@Spazholio
Jun 06 2016 23:57
Ok, so I’ll have to go through and find where that’s being called and remove/rework it.
Running loop again to verify.