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

26th
Jun 2016
Terri Lyman
@tatigger
Jun 26 2016 00:20
@danamlewis Is this pm-ing in this forum?
Scott Leibrand
@scottleibrand
Jun 26 2016 00:25
No, you have to search for her handle and start a new conversation.
Terri Lyman
@tatigger
Jun 26 2016 00:33
Got it!
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 01:56
hi everyone. We are getting a loose object corrupt git error. I know I saw a solution to this in the documentation but can't for the life of my find it again now when we need it. Help?
Scott Leibrand
@scottleibrand
Jun 26 2016 02:26
oref0-reset-git in cron. Where did you look in the docs? The troubleshooting section? Perhaps we need a PR there to add a pointer to the suggestion about putting it into cron for people who skipped that part. (And one to make it more clear that yes, you really need to do that.)
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 02:50
@scottleibrand yes, looked in troubleshooting and then went to look in issues and did finally find it in a comment you made on issue 30. Still didn't find it in the actual documentation. Send me a link? I'll submit a PR for it.
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 03:15

we are still working on our timezone issue and believe we have identified the problem but we are having trouble fixing it. monitor/pumphistory-zoned.json does not have timezone "-04:00" in it like monitor/clock-zoned.json does. Tried a bunch of different ways to create this report, all with the same results. Can you help? What are we doing wrong?

pi@raspberrypi:~/myopenaps $ openaps report add monitor/pumphistory-zoned.json JSON tz rezone --adjust missing monitor/pumphistory.json
added tz://JSON/rezone/monitor/pumphistory-zoned.json
pi@raspberrypi:~/myopenaps $ openaps report invoke monitor/pumphistory-zoned.json
tz://JSON/rezone/monitor/pumphistory-zoned.json
reporting monitor/pumphistory-zoned.json
pi@raspberrypi:~/myopenaps $ cat monitor/pumphistory-zoned.json
[
{
"_type": "Bolus",
"_description": "Bolus 2016-06-25T17:39:00 head[4], body[0] op[0x01]",
"timestamp": "2016-06-25T17:39:00",
"_body": "",

when I ask to show devices it show me to pumps
timezones://tz
medtronic://ki_pump
medtronic://pump
dexcom://cgm
Also what is timezone TZ?
Paul Martin
@Spazholio
Jun 26 2016 03:18
@AndyProbolus_twitter Does this do what you want it to? openaps use tz rezone --timezone "EDT" --date timestamp --date dateString --date start_at --date end_at --date created_at --astimezone monitor/pumphistory.json
Scott Leibrand
@scottleibrand
Jun 26 2016 03:22
@AndyProbolus_twitter looks like troubleshooting is the only place it's mentioned, and that only has the fix corruption script, not reset-git. If you could do a PR to add that there, that would be good. Maybe also would be good to give an example cron (in the currently rather sparse cron section) of running oref0-reset-git every minute?
Gera Yeremin
@gera3d
Jun 26 2016 03:25
NVM I think I figured it out
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 03:29
@Spazholio yes, that did exactly what we wanted!! Will try it out
Paul Martin
@Spazholio
Jun 26 2016 03:32
:thumbsup:
Gera Yeremin
@gera3d
Jun 26 2016 03:33
ok when I am putting number is do I put the whole thing in? PAR and all?
Here is the main error its shooting at me:
TypeError: Non-hexadecimal digit found
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 03:34
@Spazholio worked great with the use command. created a report out of the string you gave us, but getting an error. Any ideas for this one? pi@raspberrypi:~/myopenaps $ openaps report add monitor/pumphistory-zoned.json JSON tz rezone --timezone "EDT" --date timestamp --date dateString --date start_at --date end_at --date created_at --astimezone monitor/pumphistory.json
Traceback (most recent call last):
File "/usr/local/bin/openaps-report", line 4, in <module>
import('pkg_resources').run_script('openaps==0.1.5', '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.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
app( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-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.5-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.5-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.5-py2.7.egg/openaps/reports/add.py", line 26, in main
params = task.method.to_ini(args)
File "/usr/local/lib/python2.7/dist-packages/openapscontrib-0.0.15-py2.7.egg/openapscontrib/timezones/_init.py", line 31, in to_ini
if args.timezone._filename == '/etc/localtime':
AttributeError: 'tzlocal' object has no attribute '_filename'
Paul Martin
@Spazholio
Jun 26 2016 03:35
Have you set your timezone? Are you in EDT?
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 03:35
@scottleibrand I'll give that PR a shot tomorrow, almost out of gas tonight. :)
Gera Yeremin
@gera3d
Jun 26 2016 03:38
Ok Nvm again I think I got it you need to cut the PAR =D
saying that in the instructions would be nice.
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 03:42

@Spazholio Yes, we are in EDT. nightscout is set, just did this to set the pi, just in case?
pi@raspberrypi:~ $ sudo raspi-config

Current default time zone: 'US/Eastern'
Local time is now: Sat Jun 25 23:39:07 EDT 2016.
Universal Time is now: Sun Jun 26 03:39:07 UTC 2016.

Current default time zone: 'America/New_York'
Local time is now: Sat Jun 25 23:39:42 EDT 2016.
Universal Time is now: Sun Jun 26 03:39:42 UTC 2016.

Current default time zone: 'America/New_York'
Local time is now: Sat Jun 25 23:40:05 EDT 2016.
Universal Time is now: Sun Jun 26 03:40:05 UTC 2016.

pi@raspberrypi:~ $ cd myopenaps
pi@raspberrypi:~/myopenaps $ openaps report add monitor//pumphistory-zoned.json JSON tz rezone --timezone "EDT" --date timestamp --date dateString --date start_at --date end_at --date created_at --astimezone monitor/pumphistory.json
Traceback (most recent call last):
File "/usr/local/bin/openaps-report", line 4, in <module>
import('pkg_resources').run_script('openaps==0.1.5', '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.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
app( )
File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-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.5-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.5-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.5-py2.7.egg/openaps/reports/add.py", line 26, in main
params = task.method.to_ini(args)
File "/usr/local/lib/python2.7/dist-packages/openapscontrib-0.0.15-py2.7.egg/openapscontrib/timezones/_init.py", line 31, in to_ini
if args.timezone._filename == '/etc/localtime':
AttributeError: 'tzlocal' object has no attribute '_filename'

still getting the error noted above

Paul Martin
@Spazholio
Jun 26 2016 03:44
If you run openaps device show, do you show a timezones://tz device? Also, do you have an /etc/localtime file?
Scott Leibrand
@scottleibrand
Jun 26 2016 03:44
@AndyProbolus_twitter sounds good.
@gera3d sounds like a small PR is in your future. :-)
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 03:50
This message was deleted
Paul Martin
@Spazholio
Jun 26 2016 03:50
You might want to delete that first one - it has your API secret in it.
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 03:52
so yes to both, but where does that leave us?
Paul Martin
@Spazholio
Jun 26 2016 03:53
Does your entry in openaps.ini look like this:
[report "monitor/pumphistory-zoned.json"]                                                                                                                                                                                                                                                                               
use = rezone
reporter = JSON
astimezone = True
date = timestamp dateString start_at end_at created_at
adjust = missing
input = monitor/pumphistory.json
device = tz
timezone = EDT
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 04:00
@Spazholio it does now :), and the report finally invoked with correct data. Many thanks, we have been struggling with this for hours, two nights in row.
Paul Martin
@Spazholio
Jun 26 2016 04:01
Ouch. Curious - what did it look like before? Might be something that @bewest would be interested in.
Chris Oattes
@cjo20
Jun 26 2016 04:06

Trying to get uploading of glucose to nightscout working the "official" way, but format-recent-type doesn't seem to work. I've been working through nightscout.sh to work out where it is failing. lsgap returns

[
  {
    "current": "2016-06-25T22:57:00+01:00",
    "prev": "2016-06-25T21:19:00+01:00",
    "dateString": "2016-06-25T22:57:00+01:00",
    "delta": 5880.0
  },
  {
    "current": "2016-06-25T23:08:00+01:00",
    "prev": "2016-06-25T22:57:00+01:00",
    "dateString": "2016-06-25T23:08:00+01:00",
    "delta": 660.0
  },
  {
    "current": "2016-06-26T04:41:49+01:00",
    "prev": "2016-06-26T04:24:00+01:00",
    "dateString": "2016-06-26T04:41:49+01:00",
    "delta": 1069.0
  }
]

which is then passed to openaps use tz select --current now --gaps lsgap.json monitor/glucose.jsonwhich fails with

Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/edison/src/openaps/bin/openaps-use", line 63, in <module>
    app( )
  File "/home/edison/src/openaps/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/home/edison/src/openaps/bin/openaps-use", line 57, in run
    output = app(args, self)
  File "/home/edison/src/openaps/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/home/edison/src/openaps/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/home/edison/src/openaps/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/home/edison/src/openaps-contrib/openapscontrib/timezones/__init__.py", line 297, in main
    if spec.includes(get(elem)):
  File "/home/edison/src/openaps-contrib/openapscontrib/timezones/__init__.py", line 264, in get
    return parse(item.get(args.date))
  File "build/bdist.linux-i686/egg/dateutil/parser.py", line 1164, in parse
  File "build/bdist.linux-i686/egg/dateutil/parser.py", line 552, in parse
  File "build/bdist.linux-i686/egg/dateutil/parser.py", line 671, in _parse
  File "build/bdist.linux-i686/egg/dateutil/parser.py", line 188, in split
  File "build/bdist.linux-i686/egg/dateutil/parser.py", line 184, in next
  File "build/bdist.linux-i686/egg/dateutil/parser.py", line 177, in __next__
  File "build/bdist.linux-i686/egg/dateutil/parser.py", line 93, in get_token
AttributeError: 'NoneType' object has no attribute 'read'
I need to get some sleep, but any suggestions of what to try next would be appreciated for when I get back to the pc
Gera Yeremin
@gera3d
Jun 26 2016 04:07
Ok so making reports seems like a pain in the but. Is there not a set of standard reports I can use? That come with basic prebuilt alias list.
Chris Oattes
@cjo20
Jun 26 2016 04:09
@gera3d are you talking about the reports that the docs talk you through?
Gera Yeremin
@gera3d
Jun 26 2016 04:10
yep
Andy Probolus
@AndyProbolus_twitter
Jun 26 2016 04:11

@bewest @Spazholio this is what the it looked like before, when we were trying to create it with the tz clock,
'''[report "monitor/pumphistory-zoned.json"]
use = clock
reporter = JSON
astimezone = False
date = None
adjust = missing
input = monitor/pumphistory.json
device = tz
timezone = '''

The documentation was a bit to subtle for us, apparently:
Note that a pumphistory-zoned.json report is required, which can be generated from pumphistory.json using tz, following the approach described above for clock-zoned.json, including making sure to add it to your monitor-pump alias.

Gera Yeremin
@gera3d
Jun 26 2016 04:11
@cjo20 It wants me to create reports for day!
Chris Oattes
@cjo20
Jun 26 2016 04:11
@gera3d It's definitely a good idea to go through the docs creating them yourself, it makes sure you've read what you're doing properly and gives you a better understanding of how the system works. It's really important that people grasp how things fit together so they can work out how to fix the system when it goes wrong
Gera Yeremin
@gera3d
Jun 26 2016 04:12
But am I really going to go back and read the reports?
Nightscout already does a great job with that... and I am sending it all my data.
Chris Oattes
@cjo20
Jun 26 2016 04:14
It isn't generating reports like nightscout does. A "report" in openaps is something that runs using a device (pump / cgm / some other things), usually to gather or process data in some way for the next step of the pipeline
for example, you set up reports to get the current time / basal rates / reservoir status /...
Gera Yeremin
@gera3d
Jun 26 2016 04:15
Ok so report is more like a pipe with Data that you shoot into the loop?
to figure out what Basel should be?
Chris Oattes
@cjo20
Jun 26 2016 04:16
The loop is made up of a chain of reports
A report will usually either read data from a device, or read the output of a different report
Gera Yeremin
@gera3d
Jun 26 2016 04:18
Ok I see how its valuable to understand but using someone else's tweaked and polished loop seems like a better idea then trying to guess at my own.
Chris Oattes
@cjo20
Jun 26 2016 04:19
If you go through the documentation, it explains how to set things up
Paul Martin
@Spazholio
Jun 26 2016 04:20
And you generally only have to set up each report once.
Once it’s done, it’s done. Your loop will refresh and use them as needed.
Gera Yeremin
@gera3d
Jun 26 2016 04:21
Right I get it but I am trying to understand why using someone elses datasets is a bad idea.
Chris Oattes
@cjo20
Jun 26 2016 04:21
Because without going through the documents, you won't understand why someone has the reports they've got
the documentation walks you through getting everything you need. "Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime"
This isn't an off-the-shelf product that you can just install without understanding and have it work for you
Gera Yeremin
@gera3d
Jun 26 2016 04:24
Ok in the video I watched this young guy was talking about some of the best algorithms are created and upkept by a few groups.
So first you write you own then you scrap it and use the good ones?
Chris Oattes
@cjo20
Jun 26 2016 04:26
No. What most people use at the moment is "oref0". That is a possible implementation of some AP algorithms. The documentation talks you through setting up oref0 for your own pump, teaching you how to gather the data it requries using reports and how the data flows through the system.
openaps is basically just a system that makes it easy to gather / pipe data around
oref0 is a set of tools that look at a set of data and produce output
the documentation talks you through setting up openaps to gather the input and pass it through the different parts of oref0
Chris Oattes
@cjo20
Jun 26 2016 04:31
It's 0530 and I need some sleep o/
Gera Yeremin
@gera3d
Jun 26 2016 04:36
ahah
OK thanks for the feedback.
aabramowicz
@aabramowicz
Jun 26 2016 04:50
Following the docs to update NS to dev branch for OPENAPS - seems I've somehow knackered my site and can't figure out why it won't display despite successful deployment.
Lynne Butts
@flutelynne_twitter
Jun 26 2016 05:07
Are you looking for the 9.3?
aabramowicz
@aabramowicz
Jun 26 2016 05:07
if thats the dev branch..ya
Lynne Butts
@flutelynne_twitter
Jun 26 2016 05:09
This message was deleted
This message was deleted
aabramowicz
@aabramowicz
Jun 26 2016 05:11
hrmmm...link not working
Lynne Butts
@flutelynne_twitter
Jun 26 2016 05:11
Ugh It doesn't link correctly. CGM FB page, then search "grilled cheese"
It is a May 29th post.
aabramowicz
@aabramowicz
Jun 26 2016 05:13
I see it
Lynne Butts
@flutelynne_twitter
Jun 26 2016 05:13
Yay
aabramowicz
@aabramowicz
Jun 26 2016 06:02
Black screen with dashes on dev branch of NS
aabramowicz
@aabramowicz
Jun 26 2016 06:15
works fine with main branch
Jim is CrushingT1D
@CrushingT1D
Jun 26 2016 07:08
Young guy = @mddub
Jason Calabrese
@jasoncalabrese
Jun 26 2016 07:13
@aabramowicz check the logs also try some api endpoints /api/v1/entries.json should return since data
Dave Ewall
@daveewall
Jun 26 2016 12:32
Just another note about the timeline issue... I've been running on a Pi without issue, but crea
When I created a Edison with the same commands, the pump history time zone report didn't work. Putting it in my cron job with the use command worked fine, so I just did that as a workaround.
When I have more time I'll look into it more.
Alexandre Cossette
@alexk7
Jun 26 2016 14:37
wnmtkh
aabramowicz
@aabramowicz
Jun 26 2016 15:47
@jasoncalabrese the endpoint does return recent data but the dev depolyment still only gives black screen and dashes
ddaniels1
@ddaniels1
Jun 26 2016 15:59
trying to set up a new rig and need access to SRC code so ran curl -s https://raw.githubusercontent.com/openaps/docs/master/scripts/quick-src.sh | bash -
Getting this error:
Cloning into 'decoding-carelink'...
fatal: unable to connect to github.com:
github.com[0: 192.30.252.122]: errno=Connection timed out
Is there another way to install source code?
@bewest @scottleibrand or others who know?
Sulka Haro
@sulkaharo
Jun 26 2016 17:30
@ddaniels1 that's super odd, shouldn't happen in the networking works as expected
aabramowicz
@aabramowicz
Jun 26 2016 17:30
@jasoncalabrese I have a second site now running 0.9.0-beta3. The documentation speaks of two environment variables, API_SECRET and NIGHTSCOUT_HOST. To add NIGHTSCOUT_HOST what is the value?
Sulka Haro
@sulkaharo
Jun 26 2016 17:33
FYI all - anyone contributing to oref0 code might want to ready through my PR at openaps/oref0#146
This adds a generic way to put preferences into preferences.json, in addition to making the temp basal safety margin multipliers configurable
Paul Martin
@Spazholio
Jun 26 2016 18:14
Excellent. I’ve been really looking forward to being able to up my max temp basal rate, so thank you for this. Can you elaborate on the difference between current_basal_safety_multiplie and max_daily_safety_multiplier? (and is that first one supposed to be multiple or multiplier?)
Sulka Haro
@sulkaharo
Jun 26 2016 19:01
oops typo. both are with the r.
The max safe basal limit is by default set to the smallest of current_basal 4 or highest basal rate of the day 3 or the max basal from the pump
Paul Martin
@Spazholio
Jun 26 2016 19:13
So currently, my basal rate is set (in the pump) at 1.8u, so the current_basal_safety_multiplier would be the 3 (that it’s hardcoded to now), but I have a timeframe when it’s 1.9u. So with current_basal_safety_multiplier I could adjust the “3” and...what exactly would max_daily_safety_multiplier be for? Feel free to use my numbers in your answer, as I learn best by example. =)
Scott Leibrand
@scottleibrand
Jun 26 2016 19:16
It defaults to 4. What behavior do you want?
Sulka Haro
@sulkaharo
Jun 26 2016 19:21
max_daily_safety_multiplier is applied to the highest basal you have at any point during the day. What time of the day are you not getting a temp basal that's as high as you'd like?
What's your basal at that point in time?
Paul Martin
@Spazholio
Jun 26 2016 19:26
It’s not a time of day, but whenever I start to rise, I get capped at 5.4u/hr.
And for the most part, I don’t have to bolus except for a little bit at dinner. Generally, the rig/loop is handling everything.
And it’s not trying to go a LOT higher than 5.4u (at least when I bother to check what it’s requesting), but it’s definitely hitting that cap.
Paul Martin
@Spazholio
Jun 26 2016 19:32
And @scottleibrand - looking in the code, I’m seeing var maxSafeBasal = Math.min(profile.max_basal, 3 * profile.max_daily_basal, 4 * basal);. I’m not sure what basal is in that context. Is that the rate that my pump thinks it should give based on what it’s programmed to for that time of day? Regardless, my pump never gives me more than 5.4u, because of the 3 * profile.max_daily_basal (I think) which is what I’d like to be able to tweak if desired, because that seems to be the one that’s capping me.
Paul Martin
@Spazholio
Jun 26 2016 19:48
Ironically enough, I think I answered my own question by asking it. =)
Dana Lewis
@danamlewis
Jun 26 2016 19:49
@Spazholio also sounds like you are using this to overcome not doing meal boluses? (Just trying to seek clarification)
Chris Oattes
@cjo20
Jun 26 2016 19:50
basal in that case is the basal rate set for that moment in time in the pump settings
before any temp basals have been applied
Sulka Haro
@sulkaharo
Jun 26 2016 19:52
@Spazholio ha, yes. Also, what's the max basal in your pump?
Paul Martin
@Spazholio
Jun 26 2016 19:52
@danamlewis Not necessarily to overcome meal boluses, as I don’t eat many meals. I don’t do breakfast, and for lunch, it’s either a burger patty (or two) or a keto shake - 5g carbs + a bunch of protein. Dinner is really the only time I actually have carbs, and those are just incidental from veggies. It’s the protein rise that I’m letting it take care of, since sometimes I’m able to calcualate it and sometimes I’m not. Because my body seems to react differently to the same amount of protein sometimes. Hooray, biology!
@sulkaharo 8u.
That value has been meticulouly calculated from my gluteal region.
Sulka Haro
@sulkaharo
Jun 26 2016 19:54
Different types of protein absorb very differently, guess you know that? Your gut bacteria handles different meats, veg differently.
Paul Martin
@Spazholio
Jun 26 2016 19:55
Oh yes. I just don’t know which and how. It’s never been a huge deal, but I suppose I could test it out one of these days. And I swear I’ve got some sort of delayed stomach emptying going on, but that’s a worry for another day. =)
Sulka Haro
@sulkaharo
Jun 26 2016 19:57
The base rule seems to be: red meat spikes slow and hard, white meats, fish and veg starts to absorb faster and in a more stable manner.
But yeah, sounds like you could up the multiplier by one and see what happens
Paul Martin
@Spazholio
Jun 26 2016 19:59
Well, whenever this gets merged into AMA, I’m game to give it a shot. =)
And I never heard that about red meat vs the others. Then again, I’ve never really looked into it.
Good info to have though, so thanks.
ddaniels1
@ddaniels1
Jun 26 2016 20:00
posting this again to see if anyone has insight:
@ddaniels1
trying to set up a new rig and need access to SRC code so ran curl -s https://raw.githubusercontent.com/openaps/docs/master/scripts/quick-src.sh | bash -
Getting this error:
Cloning into 'decoding-carelink'...
fatal: unable to connect to github.com:
github.com[0: 192.30.252.122]: errno=Connection timed out
Edison is connected to the internet as I get a return when I `curl www.google.com'
Chris Oattes
@cjo20
Jun 26 2016 20:01
what happens if you try ping google.co.uk
or ping github.com
Sulka Haro
@sulkaharo
Jun 26 2016 20:02
Yup, I'd confirm the rig routes correctly first.
ddaniels1
@ddaniels1
Jun 26 2016 20:03
Interesting, it returns >edison@mobile:~/Documents/try5$ ping google.co.uk PING google.co.uk (216.58.194.163) 56(84) bytes of data.
and then just hangs
Sulka Haro
@sulkaharo
Jun 26 2016 20:11
That means it's not routing data
Are you using a static IP or DHCP?
Paul Martin
@Spazholio
Jun 26 2016 20:17
It’s routing SOMETHING, as it was able to do a DNS lookup though.
Sulka Haro
@sulkaharo
Jun 26 2016 20:20
DNS is local, probably?
Jarred Yaw
@jyaw
Jun 26 2016 20:21
Hey do we have a way of doing like an analysis of which code base you're using and what net effect it would have on your control? We have so much data in nightscout, it seems like you could feed that back into the particular base's determine-basal and see net effect on care at any given time... could also test out algorithm updates etc. Could also use it to feed back possible therapy changes. I don't doubt you guys have some sort of sample Json files you use in dev, but that kind of tool would be pretty cool. Just thinking aloud in case this already exists...
ddaniels1
@ddaniels1
Jun 26 2016 20:23
DHCP
Sulka Haro
@sulkaharo
Jun 26 2016 20:23
Yocto or Ubilinux?
ddaniels1
@ddaniels1
Jun 26 2016 20:23
Ubilinux.
Sulka Haro
@sulkaharo
Jun 26 2016 20:23
Sounds to me like the router is wrong, so local IP data works but nothing is routed to Internet
ddaniels1
@ddaniels1
Jun 26 2016 20:24
interesting when I put in curl www.google.com it returns the data
Sulka Haro
@sulkaharo
Jun 26 2016 20:24
Right, that is odd
Paul Martin
@Spazholio
Jun 26 2016 20:24
Can you do the same things on your local machine? Do they work?
Sulka Haro
@sulkaharo
Jun 26 2016 20:24
And your computer is connected to the same exact network?
:D
Paul Martin
@Spazholio
Jun 26 2016 20:25
Wondering if it’s a routing issue with your ISP or something. It’s rare, but I’ve seen it happen. And it’s maddening to diagnose. =)
Even more maddening to convince your ISP that it’s happening.
ryanchen26
@ryanchen26
Jun 26 2016 20:26
Interesting Error: Just came back from a kid's party. We were running our RPi on a iPhone Hotspot. Worked fine. When we got home we turned off the hotspot and reset the RPi so it would connect to the house Wi-Fi. 20 Minutes later I noticed the loop wasn't running. I turned off crontab, and ran the loop manually. We got this error ConfigParser.NoSectionError: No section: u'device "pump"' . Some how the contents of the pump.ini file got ERASED (the file was still there, just blank). I got back up and running within 2min after putting the info back in the pump.ini file. I wonder if this is the result of not formally shutting down before unplugging the power.
Sulka Haro
@sulkaharo
Jun 26 2016 20:29
@ryanchen26 that's caused by your current OpenAPS version managing the pump session state information in the pump.ini file, so any time your reboot, if the file write is happening at the same time, you'll lose the file
there's a newer version in github that puts the state into a separate file
Not formally shutting down is always a risk
Paul Martin
@Spazholio
Jun 26 2016 20:30
And you can set up a quick script that will detect when you don’t have an internet connection, and gracefully switch over. I have mine run every minute, and it works flawlessly.
ryanchen26
@ryanchen26
Jun 26 2016 20:31
@sulkaharo Thanks. I'll update.
@Spazholio Care to share an example?
ryanchen26
@ryanchen26
Jun 26 2016 20:34
cool, thanks.
Paul Martin
@Spazholio
Jun 26 2016 20:34
Mine is very similar, but I don’t have it pushed to Github. Because I’m slacking. I should really fix that. Hang on…=)
Dana Lewis
@danamlewis
Jun 26 2016 20:35
@jyaw no tool like that exists today. But in that spirit of thinking, check out oref0 issue 99 for some thoughts on building a tool for basal tuning as a start in this direction...
Most of our work has been iterating on algorithms for real time, we're starting to think more about retrospective but no one has gotten around to a feature or algorithm compare tool that's open source and usable. Would be awesome, though :)
Sulka Haro
@sulkaharo
Jun 26 2016 20:37
@ryanchen26 Not sure if this is part of AMA or in dev; definitely not yet in the master
Dana Lewis
@danamlewis
Jun 26 2016 20:38
If that's an area you're interest in exploring, you could open an issue and start logging ideas/discussion
ryanchen26
@ryanchen26
Jun 26 2016 20:42
@sulkaharo Yes, I see that my primary RPi is version 0.1.0, and my other two are 0.1.5. So the recommendation is update to 0.1.5 and Dev branch?
Sulka Haro
@sulkaharo
Jun 26 2016 20:42

Btw might be of interest here as well: we've yet to setup unit test code coverage reporting into Github but covering the codebase has progressed nicely recently. Latest I'm seeing for oref0 is:

=============================== Coverage summary ===============================
Statements   : 88.04% ( 449/510 )
Branches     : 82.25% ( 278/338 )
Functions    : 95.24% ( 20/21 )
Lines        : 89.37% ( 437/489 )
================================================================================

which is getting to a nice level :)

Dana Lewis
@danamlewis
Jun 26 2016 20:43
Thx for all the awesome work, @sulkaharo! :+1:
Sulka Haro
@sulkaharo
Jun 26 2016 20:44
@ryanchen26 depends what you want? I'm on a "later-than-latest" AMA branch - if you go with Dev assume you need to test the loop and check what's going on when you deploy
Chris Oattes
@cjo20
Jun 26 2016 20:44
which is the unchecked function?
Sulka Haro
@sulkaharo
Jun 26 2016 20:45
it's an anonymous function that's part of AMA
ryanchen26
@ryanchen26
Jun 26 2016 20:45
@sulkaharo Very good. I'll look into it.
Sulka Haro
@sulkaharo
Jun 26 2016 20:47
@cjo20 iobArray.forEach(function(iobTick) { in determine-basal.js, starting on line 199
Jarred Yaw
@jyaw
Jun 26 2016 20:55
@danamlewis thanks just wanted to know where it's at before I thought about it too much more. Sounds pretty valuable after more basal tuning stuff is developed.
Dana Lewis
@danamlewis
Jun 26 2016 20:56
Never hurts to think about it :) but also worthwhile to start documenting for everyone to collaborate on!
Paul Martin
@Spazholio
Jun 26 2016 20:58

https://github.com/Spazholio/edison_wifi <— question about this script. Does anyone know why it never writes the lockfile? It does if I have a script that just does

lockfile=$'/home/edison/edison_wifi/WiFi_Check.pid'                                                                                                                                                                                                                                                                     
echo $$ > $lockfile

But it doesn’t work within the script, but it does hit that part of the script.

Chris Oattes
@cjo20
Jun 26 2016 21:00
put in an echo $lockfile before the echo $$
Paul Martin
@Spazholio
Jun 26 2016 21:00
Setting Lockfile
/home/edison/edison_wifi/WiFi_Check.pid
Performing Network check for wlan0
Chris Oattes
@cjo20
Jun 26 2016 21:02
hrm, try using a static filename echo $$ > ~/test.txt
Paul Martin
@Spazholio
Jun 26 2016 21:03
That worked.
drwxr-xr-x  3 edison users    4096 Jun 26 17:02 edison_wifi
That’s the perms on the directory. My crontab should be able to write to that, no?
ryanchen26
@ryanchen26
Jun 26 2016 21:04
This message was deleted
Chris Oattes
@cjo20
Jun 26 2016 21:05
I think that crontab -e runs as the user, so yes
what are the permissions on the test.txt file?
if you delete the lockfile and let the script create it, it might have the right permissions
Paul Martin
@Spazholio
Jun 26 2016 21:06
The lockfile is never created in the first place.
Perms on test.txt are 644.
Chris Oattes
@cjo20
Jun 26 2016 21:07
put whoami in the script, see who it runs as?
Paul Martin
@Spazholio
Jun 26 2016 21:08
edison
Chris Oattes
@cjo20
Jun 26 2016 21:15
that's weird then
Paul Martin
@Spazholio
Jun 26 2016 21:15
I agree. =)
Ben West
@bewest
Jun 26 2016 21:44
lockfile=$'/home/edison/edison_wifi/WiFi_Check.pid' looks like odd syntax... the $ at the beginning likely doesn't do what you expect
Ben West
@bewest
Jun 26 2016 21:50
re managing network, it'd be interesting to look at dbus using either conman or networkmanager one of which is always installed
http://dev.iachieved.it/iachievedit/exploring-networkmanager-d-bus-systemd-and-raspberry-pi/ the platform allows us to detect when new network is available and respond when it happens
(turn out this is same API (dbus) that openxshareble and lots of other stuff uses to talk ble and other things)
this tool could probably handle both edison and rpi https://github.com/mvidner/cnetworkmanager
Ben West
@bewest
Jun 26 2016 21:55
benefit of going through the dbus API is that there's a permission scheme set up so you don't need to use sudo, you can define a policy for your user to use the service sans sudo
Paul Martin
@Spazholio
Jun 26 2016 21:57
@bewest I can see that, however it works in a very basic test script, but not when in the rest of the script. That’s what’s puzzling to me.
And I’m using wpa_supplicant (as using Network Manager on the commandline is a nightmare) which is why I had to tweak the script just a touch.
Never tried cnetworkmanager though.
Ben West
@bewest
Jun 26 2016 21:58
right, probably mix of sudo/permissions that's confounding things networkmanager doesn't have CLI, it's an API usually there's just a GUI
Paul Martin
@Spazholio
Jun 26 2016 21:58
Oh, networkmanager has a CLI - nmcli - it’s just godawful.
I think I even tried nmtui which wasn’t any better. I may try again later on, but for now, this is working just fine.
Ben West
@bewest
Jun 26 2016 22:00
what's bad about nmcli?
it has tab completion for everything
Paul Martin
@Spazholio
Jun 26 2016 22:01
To be honest, I don’t recall. I just recall not liking it. I may give it another whirl - Network Manager is really a good tool, and versatile.
Ben West
@bewest
Jun 26 2016 22:01
anyway, the main thing is that using something through the dbus api will allow you to do it avoiding sudo which I think is confounding factors
Paul Martin
@Spazholio
Jun 26 2016 22:02
But my script tries to write the lockfile before sudo is ever invoked. Could it still be screwing things up?
Ben West
@bewest
Jun 26 2016 22:02
avoiding sudo and hardcoded values would also open it up as a re-usable tool that others could use ;-), it could even be an openaps device add wifi networkmanager type of thing ;-)
the crontab is created using sudo crontab?
Paul Martin
@Spazholio
Jun 26 2016 22:03
Nope, just regular ol’ crontab -e
If lockfile=$'/home/edison/edison_wifi/WiFi_Check.pid’ looks odd to you, how would you rewrite it?
Chris Oattes
@cjo20
Jun 26 2016 22:05
get rid of the $?
Paul Martin
@Spazholio
Jun 26 2016 22:05
Same result.
Ben West
@bewest
Jun 26 2016 22:06
not sure I understand
is the script crashing before that point?
Paul Martin
@Spazholio
Jun 26 2016 22:07
No, the script runs just fine. It’ll do all the network stuff as intended, it just never writes that lockfile like it’s supposed to. It’s really a minor thing, but now my curiosity is piqued as to why it’s not working.
Ben West
@bewest
Jun 26 2016 22:08
you can set -x; near the top
Paul Martin
@Spazholio
Jun 26 2016 22:09
Remind me what that does?
Ben West
@bewest
Jun 26 2016 22:09
and send all output from cron into syslog 2>&1 | logger -t wifistuff
that turns on debugging
Paul Martin
@Spazholio
Jun 26 2016 22:10
Oh damn it all. Disregard every thing I said over the last hour.
headdesk
Thanks for the set -x trick though.
Paul Martin
@Spazholio
Jun 26 2016 22:23
Turns out the lockfile is designed to make sure the script isn’t running concurrently (like a lockfile is designed for) and at the bottom of the script, it’s removed. My fault for not realizing that.
Dave Ewall
@daveewall
Jun 26 2016 22:33
Speaking of the networking not working, has anybody gotten bluetooth tethering working on the Edison? The docs had a great script
working on the Pi, but doesnt work on the Edison. I have it connected to a phone, but not sure how to get the bnep0 to show up.
Paul Martin
@Spazholio
Jun 26 2016 22:34
Yocto or Ubi?
Dave Ewall
@daveewall
Jun 26 2016 22:34
Ubi.
Paul Martin
@Spazholio
Jun 26 2016 22:34
Then no, I don’t think so.
Dave Ewall
@daveewall
Jun 26 2016 22:35
yocto any different?
Paul Martin
@Spazholio
Jun 26 2016 22:35
Ubi is superior in some ways, but deficient in others. =/
Ben West
@bewest
Jun 26 2016 22:35
what's not working, just getting bnep0 created?
they all work the same way :-)
there's a d-bus api that controls the whole thing under the hood
there's different versions of different tools that use that API
Dave Ewall
@daveewall
Jun 26 2016 22:36
as far as I can tell, yes... According to the iPhone and the bluetoothctl, theyre connected, but no network interface shows up. I know its dbus connected, but I'm a bit dbus illiterate.
dbus-related, I mean.
Ben West
@bewest
Jun 26 2016 22:36
there's a tool in bluez test folder called test-nap, in older (bluez 4) there was a tool called pand
Paul Martin
@Spazholio
Jun 26 2016 22:37
@bewest Do you have BT tethering to an iPhone working under Ubi?
Ben West
@bewest
Jun 26 2016 22:37
test-nap seems to mostly work, though the whole process is still clunky enough I don't have it working reliably
Dave Ewall
@daveewall
Jun 26 2016 22:38
well, as long as the tools work, I'm happy to screw with scripting to play around until it works. My entire loop is mostly a cron job bash script instead of aliases anyway.
I'll take a look at test-nap tomorrow morning then. Thanks, guys.
I recommend reading up on d-bus :-)
Paul Martin
@Spazholio
Jun 26 2016 22:44
I’d love a primer on dbus. Got any links? That thing is like voodoo black magic to me.
Ben West
@bewest
Jun 26 2016 22:45
need bridge-utils installed to get brctl
I wound up using qdbus, gdbus, d-feet and other tools to just explore it
basically it's like having URLs/endpoints for lots of stuff; every app can have their own suite of stuff