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

4th
Oct 2015
Dana Lewis
@danamlewis
Oct 04 2015 00:00
Cool @bewest :)
Re: hotspot, it's for better visibility for what the system Is doing. OpenAPS shouldn't need connectivity to run, though.
@bewest Would be great for Ns to show status. Like @amazaheri 'S alerts from azure, and it sounds like @audiefile Has built some IFTT for similar
Chris Oattes
@cjo20
Oct 04 2015 00:04
I was asking because it doesn't seem problematic for the rpi to just be configured to connect to a hotspot, and for the phone to be the thing it ocnnects to when there isn't wifi available. Seems much less hassle.
Jason Calabrese
@jasoncalabrese
Oct 04 2015 00:04
yeah mqtt and an always running node app that does the invoking
what's everyone using to get the pi to switch networks? just edit the wpa conf?
Chris Oattes
@cjo20
Oct 04 2015 00:05
I set it up using wicd-curses
just set it to autoconnect to my home wifi, and my phones hotspot
Dana Lewis
@danamlewis
Oct 04 2015 00:06
@jasoncalabrese Yes
Ben West
@bewest
Oct 04 2015 00:06
I have my phone and my home network setup in the wpa conf
so it should autoconnect
Dana Lewis
@danamlewis
Oct 04 2015 00:06
@cjo20 Agreed
Jason Calabrese
@jasoncalabrese
Oct 04 2015 00:07
so just multiple network={} blocks?
looks simple enough
Dana Lewis
@danamlewis
Oct 04 2015 00:07
Actually, checking to see if it connects to my hotspot is the quickest way to tell if it's running, as the Pi latches on within seconds.
Yep @jasoncalabrese , very east
Peter Miller
@ochenmiller
Oct 04 2015 00:07
@scottleibrand @jasoncalabrese the fix-dead-carelink script seems to work on original RPi hardware but not the latest B+ version.
Chris Oattes
@cjo20
Oct 04 2015 00:09
@diabeticgonewild before you pull an all-nighter, you might want to read the last few minutes here
diabeticgonewild
@diabeticgonewild
Oct 04 2015 00:10
Thanks. I was eating dinner. But it is a good thing to switch in between access point mode and client mode.
Chris Oattes
@cjo20
Oct 04 2015 00:11
I'm not sure what the use-case is
diabeticgonewild
@diabeticgonewild
Oct 04 2015 00:12
When you don't have your phone or battery is dead on your phone...foreign countries...airplane flights
Cruises
Chris Oattes
@cjo20
Oct 04 2015 00:12
I'm not sure how having the raspberry pi accept wifi connections from other devices helps it get online then
diabeticgonewild
@diabeticgonewild
Oct 04 2015 00:13
You make a bash shell script to check to see if there are any access points available.
A better alternative may be using 2 Edimax dongles. One for an access point and one as a client. That is easy to configure.
Chris Oattes
@cjo20
Oct 04 2015 00:15
the beauty of the way most people power the pi when roaming is that it also doubles as a phone charger, so you could charge the phone for 2 minutes, then power it up and tell it to connect to another network if you really wanted :P
diabeticgonewild
@diabeticgonewild
Oct 04 2015 00:17
Yeah true. There are really no low-profile dongles that can do both access point and client mode at the same time so this may be the best alternative http://raspberrypi.stackexchange.com/questions/12276/how-to-make-pi-an-ap-with-2-wifi-adapters
Chris Oattes
@cjo20
Oct 04 2015 00:18
I was just trying to save you some time, because your idea does really seem to fit with the way people are using the raspberry pi, but you seem fairly insistent that you're going to spend your time on it, so I'll leave you to it now
diabeticgonewild
@diabeticgonewild
Oct 04 2015 00:18
It's a fail safe....when I went to Seattle in May I already had my Pi to connect to my phone by default. I had set it up that way cause it's headless.
IDK I am tired. Maybe my time is better spent doing something else...
Like updating docs or something. Thanks.
But open to suggestions
I mean one more Edimax single on the Pi will be fine.
  • dongle
Ben West
@bewest
Oct 04 2015 00:20
my suggestion is to not worry about automating/scripting hostapd
figure out how to make it work on your rpi, and post the config you feel comfy with to gist
leave it as a manual exercise for now ;-), don't try to perfect it....
diabeticgonewild
@diabeticgonewild
Oct 04 2015 00:22
OK. But I'm about to take my ADHD medicine (haha!) and go to Frys to pick up a couple of more those Edimax dongles....
I guess that's how I torture myself for having a few unproductive days...
Ben West
@bewest
Oct 04 2015 00:23
did you get openaps-js installed?
if it were me, I'd be more interested in getting openaps-js and other stuff installed, and leave the hostapd stuff for later
diabeticgonewild
@diabeticgonewild
Oct 04 2015 00:24
Yeah I did.
I'm thinking about commenting it, so that we can streamline the install process more so we know what needs to be named what to close the loop, etc. plus people need to know what determine-basal.js does
And that can be added to docs eventually soon.
Jason Calabrese
@jasoncalabrese
Oct 04 2015 00:28
think the pi is on my hotspot, but need a way to figure out it's ip when it does that
Chris Oattes
@cjo20
Oct 04 2015 00:29
@jasoncalabrese ios?
Jason Calabrese
@jasoncalabrese
Oct 04 2015 00:29
had to pull the wifi dongle to get it back on my wifi
android
Chris Oattes
@cjo20
Oct 04 2015 00:29
ah, not sure about that
Jason Calabrese
@jasoncalabrese
Oct 04 2015 00:30
maybe should add a report for that, invoke and get the ip recorded
have it pushing to github on each loop
Chris Oattes
@cjo20
Oct 04 2015 00:31
I got an app on ios that scans through a subnet and pings each ip, and reports which have devices
Ben West
@bewest
Oct 04 2015 00:32
can also customize the avahi advertisements...
perform dns-srv request?
Chris Oattes
@cjo20
Oct 04 2015 00:54
hmm, is anyone aware of a power adaptor that automatically switches between wall-power and battery depending on what is plugged in?
Scott Leibrand
@scottleibrand
Oct 04 2015 01:23
So the main use case for the hostapd stuff is when you don't have cellular data, because iPhones at least won't hotspot them. But I agree that it's a lower priority than actually getting your loop up and running.
It's also less important now that we have offline mode in openaps-js
diabeticgonewild
@diabeticgonewild
Oct 04 2015 01:25
Yeah true. I'm really not in a hurry. Trying to collect 30 days worth of CGM data first
Scott Leibrand
@scottleibrand
Oct 04 2015 01:26
Monica: another thing you could work on in the mean time (that's more suitable to incremental accomplishment) is write up determine-basal.js test cases.
Dana Lewis
@danamlewis
Oct 04 2015 01:27
Good call @diabeticgonewild :) since you need to have your CGM going to run the system.
diabeticgonewild
@diabeticgonewild
Oct 04 2015 01:34
K...thanks. Will do.
John Males
@johnmales
Oct 04 2015 09:24
Hi all, hope all is well. Was banging my head trying to figure out why I couldn't connect nightscout RESTfully
The API_SECRET needs to be alphanumeric - I generated a key with a password manager and the non alphanumeric prevented a connection. Once I changed this no problems connecting.
Holger Sanft
@holgi13
Oct 04 2015 11:46
Hi to all - what a wonderful day in my life - since last week my CGM is authorized and running. Yesterday my best friend Oliver (@oschumac) help me to start the openAps !!! All systems now running - YEAH
Scott Leibrand
@scottleibrand
Oct 04 2015 12:15
Congrats @holgi13! Are you testing during the day? Running overnight? How's it working for you so far?
Scott Leibrand
@scottleibrand
Oct 04 2015 12:28
@johnmales care to update the docs to make them more clear on that point, and send a pull request?
Holger Sanft
@holgi13
Oct 04 2015 12:59
@scottleibrand thanks - we tested the configuration parameters for me, today at all times. I am put on the work from Oliver at the last weeks. I thing we started with the nights in the next week.
Scott Leibrand
@scottleibrand
Oct 04 2015 13:10
Sweet. :-)
Peter Miller
@ochenmiller
Oct 04 2015 15:34
Interesting discovery overnight. We slept on top of the Medtronic 722 pressing some buttons. It has an alarm state that lets the user know - giving instructions to press "act" then "esc". A good safeguard for a well designed pump. This was the state for a few hours. During this time there was an error condition from the openaps set_temp_basal command: "recieved": false . I'll be spending some time today writing error checking for that condition. Additionally, I'm not dumping pump status out to logs, but I'll bet that the error condition would be reflected there too.
Peter Miller
@ochenmiller
Oct 04 2015 15:54
Plus spell check! "i before e expect after c". lol.
John Males
@johnmales
Oct 04 2015 16:06
@scottleibrand yes will do
Peter Miller
@ochenmiller
Oct 04 2015 18:14
Also had first encounter with low glucose suspend just now. Worked out quite well. I changed line in determine-basal.js to read var threshold = profile.min_bg - 20. rather than 30. Going to pull this out as an edge case so that threshold depends on min_bg, but also has an absolute configurable floor.
Scott Leibrand
@scottleibrand
Oct 04 2015 18:52
Good idea
How do you think it should work exactly? And what is your min_bg?
I'm confused what you think OpenAPS should do differently when received: is false. When the pump is in alarm state or suspended, it can't issue temps, so it doesn't really matter what it tries to do, does it?
Chris Oattes
@cjo20
Oct 04 2015 18:54
This message was deleted
Ben West
@bewest
Oct 04 2015 18:55
you can press-keys esc act to clear alarms
there's also read current alarms function
Scott Leibrand
@scottleibrand
Oct 04 2015 18:55
I like that kind of approach. But presumably you have a better one? :-)
(the one cjo20 deleted)
i wouldn't necessarily want to clear alarms
Ben West
@bewest
Oct 04 2015 18:56
most common is low reservoir
Scott Leibrand
@scottleibrand
Oct 04 2015 18:56
Except maybe when BG is really low and it's still delivering insulin.
That doesn't stop temps though afaik.
Ben West
@bewest
Oct 04 2015 18:57
I think if pump is in alarm state, it's similar to bolus
it's locked down
Scott Leibrand
@scottleibrand
Oct 04 2015 18:57
Need to experiment with the low reservoir alarm. I've never noticed it stopping temps.
Chris Oattes
@cjo20
Oct 04 2015 18:59
@scottleibrand I deleted it because I hadn't thought it through properly yet :P What min_bg do you use?
Scott Leibrand
@scottleibrand
Oct 04 2015 19:00
  1. Max 120.
Stupid gitter app. 110.
Dana Lewis
@danamlewis
Oct 04 2015 19:07
Low reservoir does not stop temps.
Chris Oattes
@cjo20
Oct 04 2015 19:08
blob
@scottleibrand threshold on the y axis , profile.min_bg on the x
Scott Leibrand
@scottleibrand
Oct 04 2015 19:10
Maybe we should just put a lower limit on min_bg
that would also mitigate the problem we saw with mmol/L BG targets being interpreted incorrectly as mg/dL
Peter Miller
@ochenmiller
Oct 04 2015 19:12
@scottleibrand @bewest , my first step is to just create a check for the error condition. In the case of the button being accidentally pressed, I don't think I'd want to clear remotely unless I could programmatically have evidence that the error wasn't ongoing. Also, if we're sleeping on the pump, I'd want to wake up and move it.
Chris Oattes
@cjo20
Oct 04 2015 19:12
@scottleibrand or do both
Scott Leibrand
@scottleibrand
Oct 04 2015 19:14
Yeah, I'd also be fine with both. Maybe we should survey everyone looping to see what min_bg they settled on.
Chris Oattes
@cjo20
Oct 04 2015 19:14
what is min_bg used for?
Peter Miller
@ochenmiller
Oct 04 2015 19:15
I think a hard set lower limit on min_bg and threshold make sense. Best of both worlds - as I like how min_bg is currently derived - and therefore configurable throughout the day.
Chris Oattes
@cjo20
Oct 04 2015 19:15
and threshold for that matter
Peter Miller
@ochenmiller
Oct 04 2015 19:17
Also, a hard set threshold allows for experiments in setting range without having to separately calculate threshold. Then threshold could be moved down based on user confidence in technology.
Dana Lewis
@danamlewis
Oct 04 2015 19:18
Good idea
Chris Oattes
@cjo20
Oct 04 2015 19:19
@ochenmiller you might get weird behaviour moving between the limited threshold and the part where it follows bg though? if you put a hard lower limit on it
Peter Miller
@ochenmiller
Oct 04 2015 19:19
@cjo20 unless I have this wrong, min_bg and max_bg are pulled from the bolus wizard settings on the Medtronic pump. Threshold is derived from min_bg.
Scott Leibrand
@scottleibrand
Oct 04 2015 19:20
I don't think threshold is actually a distinct thing. We just use the min and max directly.
Chris Oattes
@cjo20
Oct 04 2015 19:22
so from the look of the code, threshold is the point where temp basal is set to 0 if BG isn't rising
Peter Miller
@ochenmiller
Oct 04 2015 19:25
Right now threshold is only referenced in one place that I can see, as a safeguard to implement low glucose suspend. My argument is to make it a hard setting. That way if a user set a low minimum end to the range range say, min_bg = 70 then threshold wouldn't be calculated at 40.
Tim Howard
@tghoward
Oct 04 2015 19:27
Just got my second RPi and will go through the current manual/instructions to see if it all flows well for me. Any particular place that needs more attention?
this pi case by the way, is pretty slim (and cool!):
http://c4labs.net/products/zebra-case-raspberry-pi-b-black-ice
Peter Miller
@ochenmiller
Oct 04 2015 19:30
@tghoward I've been thinking about how to get multiple RPi's to communicate in order to determine which one is closest to/can talk to the pump. An extension of the current .lock file mechanism with a heartbeat signal between units would be great.
Chris Oattes
@cjo20
Oct 04 2015 19:32
have one of them be a server, the server cycles through the pi's telling them to try and get data from the pump, until it finds one that can
Peter Miller
@ochenmiller
Oct 04 2015 19:33
Was also thinking that the current RF setup isn't great for determining proximity to the pump, but more modern "internet-of-things" technology would do it really well. Something like a Tile (but smaller) attached to the pump. I've had lots of cases so far when the pump responds to the model query, only to be out of range for the rest of the loop.
@cjo20 right, like a computer cluster
Chris Oattes
@cjo20
Oct 04 2015 19:34
This message was deleted
what happens if multiple pi's send commands at the same time?
Dana Lewis
@danamlewis
Oct 04 2015 19:35
@ochenmiller Was talking with @bewest about that (relay idea) using rileylink, since it'll have even better range
@cjo20 They never send at exact same tjme
Tim Howard
@tghoward
Oct 04 2015 19:35
Very interesting - this is certainly an issue for us: getting the carelink to see the pump. Having multiple RPi units looking for the pump might be nice.
Dana Lewis
@danamlewis
Oct 04 2015 19:35
It might replace another command. But only an issue if you have different setups
If you have 2 algorithms you're testing, that's only time it might be an issue. Otherwise no big deal to have them close and both trying to read
Chris Oattes
@cjo20
Oct 04 2015 19:36
I mean what happens if the pump is in the middle of responding to one request and it gets another from a different device?
Peter Miller
@ochenmiller
Oct 04 2015 19:38
@cjo20 need a voting/quorum system so the RPis always know which one has control.
Dana Lewis
@danamlewis
Oct 04 2015 19:39
@tghoward No particular place needs attention, it all does :) so any feedback and PRs is great.
Scott Leibrand
@scottleibrand
Oct 04 2015 19:42
@cjo20 you can sometimes get the response to one command getting attributed to another one in that situation. Usually it rejects it in carelink, but sometimes it gets all the way through to the error checks in my loop.sh.
Tim Howard
@tghoward
Oct 04 2015 19:42
@danamlewis Ok, thanks. Will do my best with PRs.
Scott Leibrand
@scottleibrand
Oct 04 2015 19:42
in decocare I mean.
Peter Miller
@ochenmiller
Oct 04 2015 19:43
@bewest (or others), any indication that the Carelink stick could report on signal strength from the pump? Also, am I seeing it right that the shorter commands like model are more tolerant to bad signal strength than the - presumably longer - ones like set_temp_basal?
Rachel Sandlain
@audiefile
Oct 04 2015 19:47
I do have a script to to check the care link stick is working and that it can read from the pump. If not it sends a notification via ifttt. I think there may be some kinks but I can share what I have/how I did it if people are interested
Chris Oattes
@cjo20
Oct 04 2015 19:47
@ochenmiller it would make sense that shorter commands are more tolerant, as if the signal gets low it probably starts missing bits, there is less chance of that happening with shorter messages
Dana Lewis
@danamlewis
Oct 04 2015 19:48
@audiefile Would love that, I think would be extra interesting to folks getting started
Peter Miller
@ochenmiller
Oct 04 2015 19:50
@scottleibrand - didn't see your question above. We're currently set to min_bg 80, max_bg 120 days. min_bg 100, max_bg 140 nights.
Rachel Sandlain
@audiefile
Oct 04 2015 19:51
I'll work on a cleaned up version then and let you know :)
Peter Miller
@ochenmiller
Oct 04 2015 19:52
On Tandem pump we'd set the target at 150 overnight - but I usually make an independent judgement based on not having more than 4 units on board while sleeping.
Tim Howard
@tghoward
Oct 04 2015 21:21
@danamlewis just tried a PR for some very minor edits. Let me know if the pull is smooth (or if I'm offbase on anything!)
hardware next ...
Dana Lewis
@danamlewis
Oct 04 2015 21:21
Thanks @tghoward , looking forward to taking a look!
Dana Lewis
@danamlewis
Oct 04 2015 21:31
These all look good, good catch on the 404.
Tim Howard
@tghoward
Oct 04 2015 21:32
Great!
Dana Lewis
@danamlewis
Oct 04 2015 21:42
Just needed a ../(foldername)/(filename)#(subsection)
Commented that back on #15 in case anyone needs it in future
Tim Howard
@tghoward
Oct 04 2015 21:51
Ah, good. Makes sense. Thanks.
Rachel Sandlain
@audiefile
Oct 04 2015 23:44
@danamlewis I put a few details and the code in a gist here: https://gist.github.com/audiefile/a9b89a71505b13b513cb
Dana Lewis
@danamlewis
Oct 04 2015 23:45
Excellent thanks @audiefile !
Ben West
@bewest
Oct 04 2015 23:54
nice, very clever
how does the iftt stuff get delivered to you?
SMS/twitter/pebble?
Scott Leibrand
@scottleibrand
Oct 04 2015 23:55
She said pushover
so you could do the same with their APO directly.
Ben West
@bewest
Oct 04 2015 23:55
right, pushover, got it
Scott Leibrand
@scottleibrand
Oct 04 2015 23:55
API
Rachel Sandlain
@audiefile
Oct 04 2015 23:57
You could do other fancy stuff though. Maybe turn a hue light orange? I had just found ifttt so I decided to try that
I didn't like the IF notification app as I could never hear the notifications from it. But that's an option too