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

20th
Aug 2016
Brandon Faloona
@bfaloona
Aug 20 2016 00:22
@mhaeberli @danamlewis Ok, I've opened a PR for some additional error messages. Where I was unsure I went with '[to be written]' rather that ambiguity or omission.
openaps/docs#362
Feel free to @ mention me here or in github with any content you'd like me to include for the errors with no descriptions.
Scott Leibrand
@scottleibrand
Aug 20 2016 00:27
merged, thx
Brandon Faloona
@bfaloona
Aug 20 2016 00:27
POW. Thank you.
Dana Lewis
@danamlewis
Aug 20 2016 00:30
:boom:
Brandon Faloona
@bfaloona
Aug 20 2016 00:33
What is the doc build frequency? or, When will that merge show up at http://openaps.readthedocs.io/en/latest/docs/Resources/troubleshooting.html ? Oh, it's there, so I guess the build is immediate. :rocket:
Dana Lewis
@danamlewis
Aug 20 2016 00:34
automagic
Brandon Faloona
@bfaloona
Aug 20 2016 00:46

but it requires explaining how we actually operate in detail for them to actually do a compare/contrast properly

@bewest ^ Did you mean operate as a community / software releasing group, or did you mean how one would operate an instance of openaps?

I'd like to help document the operational aspects of openaps, but I'm unsure how to find a balance between too-vague-to-be-helpful, and too-specific-to-share-between-implementations. My instinct is to push for standardization, but in some areas that goes against individual building up the system themselves.

Dana Lewis
@danamlewis
Aug 20 2016 00:57
@bfaloona will need some help documenting a new way to get setup once we have the new boards to work with…I would not make any other major flow/structure changes to the docs knowing that those are coming out and we’ll be writing up a new flow with the boards & all the nifty setup tools in mind
Chris Oattes
@cjo20
Aug 20 2016 01:18
@danamlewis is the plan to go with yocto moving forwards, given that ubilinux is going to get increasingly out of date?
Eric Jensen
@elnjensen
Aug 20 2016 01:23
Looking forward to the ubilinux vs. yocto answer - I'm picking up an Edison tomorrow, and TI stick is in the mail. :smiley_cat: Had been thinking I would go to Loop, but the more I think about it, the more I feel like I want to leverage what I've learned about OpenAPS, and my own Linux experience, going forward. And @danamlewis and @eluhrs were persuasive about the merits of TI stick...
garykidd
@garykidd
Aug 20 2016 01:41
Ti stick and Edison en route for mechs well.
Eric Luhrs
@eluhrs
Aug 20 2016 01:50
@elnjensen I've been using yocto for a few months. The downside is that the package manager only has a limited selection of packages. For example, sdcc was not available for building subg firmware. But I can already do that on my pi. The upside is that connman makes it easy to get bluetooth tethering to work. Some have had trouble with connman, but it works well for me. One nice thing about Edison is that you can try one OS, swap the compute module, then try the other.
Dana Lewis
@danamlewis
Aug 20 2016 02:25
My $.02 on the article that got everyone buzzing today: it’s old news that the FDA is aware of what the community’s doing: http://bit.ly/2bkfiwY
Eric Jensen
@elnjensen
Aug 20 2016 02:51
Interesting discussion today about transparency of methods / algorithms for all treatment methods. One specific example of this that I had wondered about before I even thought of starting to loop, and which I'll bring up with my endo if she has concerns about this, is that we don't even know how our pumps calculate how much active insulin we have on board at a given time. I played around with this a bit with my tslim pump, just noting down the numbers after a bolus and seeing how they change over time. Not linear for sure, but also not easy to reverse engineer without some effort. Whereas with oref0, I can just go look at the code. :shipit: Turns out it is two second-order polynomials (rising, then falling, joined at the peak). :smiley:
Eric Jensen
@elnjensen
Aug 20 2016 03:02
Sorry, not rising then falling - should plot before I speak. Looking at the plots now...
Dana Lewis
@danamlewis
Aug 20 2016 03:14
Yep. Not seeing net iob has been a long time frustration point for me on standard pumps.
Eric Jensen
@elnjensen
Aug 20 2016 03:30
I was curious, so I plotted it - iPython notebook with code and plot here.
Mark Wilson
@mddub
Aug 20 2016 03:39
@ochenmiller if he’s okay with pairing his pebble to the pi/edison instead of his phone (or using a second, school-only pebble, since it sounds like he doesn’t get much out of the phone connection there anyway), pancreabble is designed for monitoring an openaps offline https://github.com/mddub/pancreabble
Paul Martin
@Spazholio
Aug 20 2016 04:10
Can pancreabble post to Dexcom Share?
That’s what’s kept me from mucking along those lines - my wife uses the Dexcom Share/Follow/Whatever app to keep tabs on me.
Gina
@gclyon
Aug 20 2016 04:11
how do you know if you have a corrupted git repository?
Mark Wilson
@mddub
Aug 20 2016 04:14
@Spazholio pancreabble is one-way from the pi/edison to the pebble over bluetooth, so no
Paul Martin
@Spazholio
Aug 20 2016 04:15
Is there ANY way to get glucose info from the receiver into Dexcom Share without using the dedicated app?
Mark Wilson
@mddub
Aug 20 2016 04:15
yes
i think the xDrip or xDrip+ app does it
Paul Martin
@Spazholio
Aug 20 2016 04:16
I’m fairly unclear on what xDrip is (the name’s used for a few things) - is that something that can run on the Edison, or is it an iPhone/Android thing only?
Mark Wilson
@mddub
Aug 20 2016 04:17
someone — @mhaeberli maybe? — set that up to use Loop with an xDrip when Loop supported getting online cgm data from share only
in this case i guess i’m using it to mean both the xDrip hardware and the xDrip app for android
Martin Haeberli
@mhaeberli
Aug 20 2016 04:18
@Spazholio , @shanselman I think figured out how Dexcom Share uploads and downloads work and published a note...
Mark Wilson
@mddub
Aug 20 2016 04:18
you’d have to see how they did it and port it to python or javascript for your openaps rig
Paul Martin
@Spazholio
Aug 20 2016 04:18
Ahhh, I see. I’m currently using an Edison/TI stick rig, and I’m pretty happy with it. Although, I may try building an xDrip rig, but don’t have an Android phone...
Mark Wilson
@mddub
Aug 20 2016 04:19
have you seen Loop?
anyway what i’m suggesting for your openaps rig doesn’t require an xDrip, it just requires reading the upload-to-Share code from that app, and rewriting it as something which can run in your openaps environment, doing the same thing for the numbers it downloads via usb from your receiver
Paul Martin
@Spazholio
Aug 20 2016 04:24
Ah, I see.
Mark Wilson
@mddub
Aug 20 2016 04:25
but that’s a super-convoluted solution. what’s the problem exactly?
Brandon Faloona
@bfaloona
Aug 20 2016 04:28
@gclyon You'll know your repository is corrupt if running git status fails, complaining about missing/empty/corrupt objejcts in your .git directory. Most or all openaps commands will also fail.
Martin Haeberli
@mhaeberli
Aug 20 2016 04:33
@Spazholio pretty easy to just view on Nightscout...
Paul Martin
@Spazholio
Aug 20 2016 04:33
That doesn’t help my wife view it on her Dexcom Share app.
Martin Haeberli
@mhaeberli
Aug 20 2016 04:33
If your wife uses an iPhone then there is also an app that seems to wrap the web UI.
Paul Martin
@Spazholio
Aug 20 2016 04:34
I also want to have it in Dexcom Share so I can give docs access to it.
Mark Wilson
@mddub
Aug 20 2016 04:37
but you otherwise would rather not have the share receiver paired to the phone at all?
to conserve battery?
Paul Martin
@Spazholio
Aug 20 2016 04:45
Not so much. I was more exploring options. On the rare occasions I have zero internet connectivity, I struggle to keep the loop working - I don’t have two separate setups to work in those two situations. My rig pulls data from NS which pulls from the Share bridge, so it’s essential in that way. I’ve tried openxshareble, but found it to have issues. I should really revisit that though.
Mark Wilson
@mddub
Aug 20 2016 04:46
are you using a pi or an edison?
i think some improvements were made recently to openxshareble, but there, you’re pairing the receiver to the rig instead of the phone
so the remote monitoring part becomes a lot more complicated
but there are also open-source closed loop solutions that don’t depend on a separate linux controller at all now
makes things a lot simpler
Brandon Faloona
@bfaloona
Aug 20 2016 05:20
@danamlewis Good to know about the pending doc changes, thanks. Regarding operational docs, I'm thinking about accessible, high level use cases (e.g.: battery low, unknown system failure, remote login, remote monitoring, shutdown system, reboot system). Resources/operation.md seems like a good page to create in a PR (If I get to it). I'll focus on the shape of the doc and not the details, given the changes on the horizon.
Dana Lewis
@danamlewis
Aug 20 2016 05:21
That all sounds awesome @bfaloona
Greg Scull
@komby
Aug 20 2016 06:12
I have to share because I know you all know this struggle. Today Ainsley came home from 5 days of D camp. At camp she took her pump and dexcom but not her OpenAPS or Loop rig. She didn't even have her nightscout Uploader (which we have had for two years now)
On day one at camp she checked her pump in and forgot the 6 day old G5 receiver in her pump belt while she went down the water slide
Camp sent her home with a loaner so we will see how that goes
I really tonight just wanted to say thanks
Thank you so much for this AP she is running once again tonight
Greg Scull
@komby
Aug 20 2016 06:18
107 -> ATM and I'm so happy it's all here and working. She isn't at camp she is back in life and her OpenAPS team is fighting for her BG !
Jason Calabrese
@jasoncalabrese
Aug 20 2016 06:29
just merged @ps2's nightscout/cgm-remote-monitor#1896 Loop plugin for Nightscout
Brandon Faloona
@bfaloona
Aug 20 2016 06:49
Here are some operational notes I came up with, and a first stab at how we could include it in openaps docs. Not quite ready for a PR.
https://gist.github.com/bfaloona/0259bde39fe4dfab95c0c41e5cace868
Martin Haeberli
@mhaeberli
Aug 20 2016 07:43
:+1: @bfaloona
Hichame Yessou
@hichameyessou
Aug 20 2016 09:42
Second night looping, woke up with a perfect 130 :smile: :smile:
C-Ville
@C-Ville
Aug 20 2016 10:16
@bfaloona great idea
John Benjamin
@Bender1061
Aug 20 2016 11:18
So I've been running my loop since middle of May. So background I've had a Kidney transplant couple years ago and unfortunatly we were not able to get away from using steroids. And I'm sure most of you realize how hard it is to control BG with steroids. Makes you super insensitive to insulin (I know I'm using like 4 times as much insulin as my Brother). In the past the lowest Ive been able to bring my A1c was 8.2 or so. Today I got my results of 7.3! Yes I know not near as good as some of you are able to get but for a person on steroids that is almost unheard of. I'm still tinkering and I hope to get it to 7 or lower but this is absolute testiment that this system works!
Matthias
@ceben80
Aug 20 2016 11:23
@bfaloona :clap:
Hichame Yessou
@hichameyessou
Aug 20 2016 12:06
@Bender1061 Congratulations! :muscle:
fallon225
@fallon225
Aug 20 2016 12:26
Last night, @inform880 got a lot of pushover notifications that all appear to be because of ???. What settings can we change so he would have gotten less? (I do know that he should have put in a "no looping", which only would have stopped the four "openaps isn't looping" alarms.)
2016-08-20 12.21.18.png
2016-08-20 12.21.23.png
Eric Jensen
@elnjensen
Aug 20 2016 13:02
@komby Sorry to hear about losing the receiver, but glad she is back home and doing OK. Yes, it is all a struggle sometimes, but good to have people to share it with.
@hichameyessou Congrats on the successful looping! I agree, it feels great to wake up right on target.
@Bender1061 Good job with dealing with the steroids and glad that looping is helping. I've had steroid injections a few times, and it was crazy how much more insulin I had to take - sometimes it felt like I was just bolusing and bolusing and it was hardly having an effect. I admire your ability to deal with it.
Gina
@gclyon
Aug 20 2016 13:41
@Bender1061 Way to go!! (and btw, your A1c is better than mine and I can't blame steriods!) I can't wait to get my loop going, and have similar success!
Can anyone elaborate on 'setting up multiple Carelinks' for better range... Can't be as simple as powering it, right?
garykidd
@garykidd
Aug 20 2016 14:13
@komby I just go through >2 weeks with crazy insulin resistance as a result of celestone injection---glad it finally dissipated. I was taking 175% basal for a long while....glad its over now. I was thinking how an active loop wouldve really helped....hope to be there soon.
sorry @Bender1061 ^ I think that's awesome progress you've made....and everybody's different.
garykidd
@garykidd
Aug 20 2016 15:27
w/r/t Dexcom receiver times reported with iter_glucose...what makes display time and system time different? My Display Time seems like the right time but the System time is not right?
Eric
@ecc1
Aug 20 2016 16:06
system time is an internal counter; there's an offset value used to calculate display time based on how the user sets the clock
garykidd
@garykidd
Aug 20 2016 16:08
@ecc1 Thanks. And you dont set the system time? and therefore I shouldn't really care what system time is but rather just care that the display time is correct? is that right?
I'm re-enagaging and starting from the beginning after a long hiatus.
David
@david-t1
Aug 20 2016 16:10
@garykidd as I am trying to get my open loop working, I am imagining a "long hiatus," lol
Eric
@ecc1
Aug 20 2016 16:21
Right, you can ignore system time as long as the display time is correct. Nobody has reverse-engineered a command to set the time remotely as far as I know, unlike for the Medtronic pumps.
Jason Calabrese
@jasoncalabrese
Aug 20 2016 16:23
You can set the display time
openaps use cgm UpdateTime --to now
I do that when swapping receivers
Ben West
@bewest
Aug 20 2016 16:25
the system time is set on the production line and never changes
display time is what you see on the receiver, it never shows you system time
when you change the time in the menu, it's altering the offset from the system time to modify the display_time
see openaps use cgm DescribeClocks to see how it all lines up
Eric
@ecc1
Aug 20 2016 16:34
Thanks, I should have reread the dexcom code before posting misinformation.
Eric Luhrs
@eluhrs
Aug 20 2016 17:08
@ecc1 One other thing I've noticed with the Adafruit 1000c inline with the Edison: the battery never reaches a full charge. I think low 90s is about as high as it gets.
@ecc1 of course, that's using Yocto's battery-voltage command which seems to be a bit flakey.
Dana Lewis
@danamlewis
Aug 20 2016 17:37
@elnjensen :) :clap: :confetti_ball:
@Bender1061 that's so great to hear! Thanks for sharing :)
@komby :+1:
Scott Leibrand
@scottleibrand
Aug 20 2016 17:46
@gclyon multiple carelink rigs can be done (we used to) but I would instead focus on building a mmeowlink rig next: the TI sticks etc. have way better range. And mmeowlink has a "wait for silence" command that allows multiple rigs to play nicely together.
Gina
@gclyon
Aug 20 2016 17:48
ok. i have a few carelinks, so thought if it was something simple, i could go ahead and implement while i'm testing the loop. i will def look into the TI stick.
Eric Jensen
@elnjensen
Aug 20 2016 18:13
I have a G5 transmitter, and a Dexcom receiver that was formerly G4+Share but has been software upgraded to work with the G5. Any chance it will work with openxshareble?
Ben West
@bewest
Aug 20 2016 18:17
no
it'll work with usb with the builtin support
Eric Jensen
@elnjensen
Aug 20 2016 18:21
Thanks, @bewest Right, I have it working over USB already, wondering if it was an option over BLE. Presumably they've changed the communication enough that the G4 code doesn't work?
Ben West
@bewest
Aug 20 2016 18:21
correct, it's a different technology altogether, actually
for g4, the receiver has a bidirectional BLE interface that works similar to a uart
one characteristic is for tx, and another for rx
Eric Jensen
@elnjensen
Aug 20 2016 18:22
Ah, thanks for clarifying.
Ben West
@bewest
Aug 20 2016 18:22
and it's the same as usb/serial protocol
for g5, the transmitter is operating as a beacon
the receiver can pair and pick up the readings, but the receiver doesn't expose any services to consume, only the the transmitter offers it's beacon
so the operating model there is different, you need a long lived process like oacids/openaps-dbus to keep state and be ready for the beacons when they happen
Eric Jensen
@elnjensen
Aug 20 2016 18:24
Interesting. So the only option would be to intercept individual data values the way Nate Rackelyft's iOS code does.
Ben West
@bewest
Aug 20 2016 18:24
yes, exactly
Eric Jensen
@elnjensen
Aug 20 2016 18:34
I've played a bit with small modifications to the demo app that Nate has on the xDripG5 repository, which runs alongside the Dexcom app on the iPhone. If I wanted to try to modify that to log values and then pass those to an OpenAPS instance (e.g. filling in the gaps when offline, if otherwise pulling from NS), what kind of interface/data format would this need to present (e.g. over BLE) to OpenAPS? Very interested in having something like this, but not sure where it makes sense to start thinking about it / working on it.
Ben West
@bewest
Aug 20 2016 18:42
ah for openaps
there's several uses called oref0_glucose
these usually reformat whatever it was into something an array of objects with type, filtered unfiltered sgv glucose device, date, and dateString fields
dateString is iso 8601 string with timezone
date is epoch in ms
type is usually set to sgv
others are optional
sgv/glucose is the glucose reading
device is a note so we know how we got this data, I've been gravitating towards url-ish strings like openaps://pump/522 or similar
share2, bridge, xdrip things like that are all used by various uploaders
the timezones vendor has a use called lsgaps and select
these were designed to help with gap syncing, and there's been some work to modify the uses to take matching --gap specifications
Ben West
@bewest
Aug 20 2016 18:48
we've also been thinking about modifying report to learn how to --append to a file rather than truncate and replace
so as long as you can get new readings, in theory you can "add to local cache" to get a nice historical list
Eric Jensen
@elnjensen
Aug 20 2016 18:49
OK, thanks - very useful. Maybe will start with just figuring out how to log info to persistent storage on the iPhone, but I'll use the above to guide what fields to log. I'm new to iOS devel so this could take a while. But good to have goals. :-)
Ben West
@bewest
Aug 20 2016 18:49
if you go after the bluez interface, you should be able to get readings directly from the transmitter in openaps
Eric Jensen
@elnjensen
Aug 20 2016 18:49
Can you point to an example text file format that contains those fields? Might as well match an existing format if possible.
oh bother, it's busted again
on linux, dbus is used to interface with ble
Eric Jensen
@elnjensen
Aug 20 2016 18:53
Re: the bluez interface, the comms side of things is an area I know nothing about, so maybe I'll start with the data gathering and see how far I get. Then can figure out how to get the data from A to B.
Thanks for the docs.
Ben West
@bewest
Aug 20 2016 18:55
there's a bunch of example python scripts in the bluez test directory: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/test
these show how to get on dbus using python, and how to manipulate the ble interfaces
bluez makes it so you basically just have to identify the characteristics and then can read/write to them
I think @ecc1 has some interesting golang stuff to work with dbus, too
Eric Jensen
@elnjensen
Aug 20 2016 19:01
OK, will take a look at that. I actually do have some Python experience, so perhaps that's more manageable than the Swift/iOS angle.
Ben West
@bewest
Aug 20 2016 19:11
here's some code which exposes new system-wide service on linux, based on openaps https://github.com/openaps/oacids
Gina
@gclyon
Aug 20 2016 19:17
have setup pushbullet to notify phone of temp basal...Need a hint on getting the './format_enact_for_push.sh | ./ping.sh' scripts to auto run in the loop. Is there a way to run scripts in reports/aliases?
Ben West
@bewest
Aug 20 2016 19:17
yes, two ways
you can introduce any suite of commands as an openaps device
when something is a device, all the reporting stuff works
the process openaps vendor allows using any combination of unix processes as an official openaps vendor, that's the way calling oref0 works
there's a helper utility for both device and alias that can help things
oref0 device-helper pushbullet './format_enact_for_push.sh | ./ping.sh' should print a json snippet
oref0 device-helper pushbullet './format_enact_for_push.sh | ./ping.sh' | openaps import
should allow doing openaps use pushbullet shell to run that script
dunno if it takes inputs
consider as an example: oref0 device-helper hello 'echo $*' | openaps import
followed by openaps use hello shell hello world
devices support the use commands, any use command can become a report, replace use keyword with report add path/to/new-report.json JSON ...
Ben West
@bewest
Aug 20 2016 19:22
use is replaced by four different keywords to become a report to invoke
alias is to group lots of reports together or to run scripts, the mechanics are identical to git alias
Martin Haeberli
@mhaeberli
Aug 20 2016 19:40

for reference and for future pull requests - with respect to docs - I’m clear from recent discussion here that

http://openaps.readthedocs.io/en/latest/docs/openaps-guide/

is current and is auto-built - just want to confirm that for local / offline editing, github/openaps/docs/tree/master is the place to ‘start’, as it were ...

Gina
@gclyon
Aug 20 2016 20:03

@bewest , Wow!--I think I actually understand that! my 'openaps use pushbullet shell' cmd runs, but errors out at the end with

ValueError: Extra data: line 1 column 4 - line 3 column 645 (char 3 - 1026)

I lost connectivity to cgm, and am wondering if this has anything to do with it?

Brandon Faloona
@bfaloona
Aug 20 2016 20:15
Anyone have a recommendation for an android app to replace Hotspot Manager (by etustudio). It's linked from Resources / technical-resources.md, but is no longer available at the Google Play store.
Gina
@gclyon
Aug 20 2016 20:38
thank you @bewest ! you're terrific!
in the words of my 1 yr old, "I deed it!!!!"
It does still give that ValueError, but loop works and cell phone notification of temp basal change
R. Dennis Steed
@rdsteed
Aug 20 2016 20:38
This message was deleted
diabeticgonewild
@diabeticgonewild
Aug 20 2016 20:44
I got Bluetooth tethering working on Ubilinux. I verified that I am getting internet transfers via the Bluetooth pairing by doing ping 8.8.8.8 (and disabling internet via nano /etc/network/interfaces prior to doing that...)
2016-08-20_15-44-25.jpg
diabeticgonewild
@diabeticgonewild
Aug 20 2016 20:50
It's paired via BLE
Used a special script to activate BLE pairing in a way that it can connect to my iPhone. Also used a BLE app on iPhone to connect via BLE to iPhone called LightBlue Explorer.
diabeticgonewild
@diabeticgonewild
Aug 20 2016 21:00

BLE Tethering is pretty easy on Ubilinux, actually

sudo apt-get install libbluetooth-dev
sudo apt-get install nodejs
sudo npm install bleno (WARNING: it puts out errors and loads slowly but the install ends up working....)
cd node modules/bleno/
sudo rfkill unblock bluetooth
sudo hciconfig hci0 up
sudo hcitool dev

Then save this file as "node_echo.js" in nano or whatever....This puts the Edison in BLE mode for Bleno.
/**
 * Simple bleno echo server
 * Author: Shawn Hymel
 * Date: November 22, 2015
 *
 * Creates a Bluetooth Low Energy device using bleno and offers one service
 * with one characteristic. Users can use a BLE test app to read, write, and
 * subscribe to that characteristic. Writing changes the characteristic's
 * value, reading returns that value, and subscribing results in a string
 * message every 1 second.
 *
 * This example is Beerware (https://en.wikipedia.org/wiki/Beerware).
 */

// Using the bleno module
var bleno = require('bleno');

// Once bleno starts, begin advertising our BLE address
bleno.on('stateChange', function(state) {
    console.log('State change: ' + state);
    if (state === 'poweredOn') {
        bleno.startAdvertising('MyDevice',['12ab']);
    } else {
        bleno.stopAdvertising();
    }
});

// Notify the console that we've accepted a connection
bleno.on('accept', function(clientAddress) {
    console.log("Accepted connection from address: " + clientAddress);
});

// Notify the console that we have disconnected from a client
bleno.on('disconnect', function(clientAddress) {
    console.log("Disconnected from address: " + clientAddress);
});

// When we begin advertising, create a new service and characteristic
bleno.on('advertisingStart', function(error) {
    if (error) {
        console.log("Advertising start error:" + error);
    } else {
        console.log("Advertising start success");
        bleno.setServices([

            // Define a new service
            new bleno.PrimaryService({
                uuid : '12ab',
                characteristics : [

                    // Define a new characteristic within that service
                    new bleno.Characteristic({
                        value : null,
                        uuid : '34cd',
                        properties : ['notify', 'read', 'write'],

                        // If the client subscribes, we send out a message every 1 second
                        onSubscribe : function(maxValueSize, updateValueCallback) {
                            console.log("Device subscribed");
                            this.intervalId = setInterval(function() {
                                console.log("Sending: Hi!");
                                updateValueCallback(new Buffer("Hi!"));
                            }, 1000);
                        },

                        // If the client unsubscribes, we stop broadcasting the message
                        onUnsubscribe : function() {
                            console.log("Device unsubscribed");
                            clearInterval(this.intervalId);
                        },

                        // Send a message back to the client with the characteristic's value
                        onReadRequest : function(offset, callback) {
                            console.log("Read request received");
                            callback(this.RESULT_SUCCESS, new Buffer("Echo: " + 
                                    (this.value ? this.value.toString("utf-8") : "")));
                        },

                        // Accept a new value for the characterstic's value
                        onWriteRequest : function(data, offset, withoutResponse, callback) {
                            this.value = data;
                            console.log('Write request: value = ' + this.value.toString("utf-8"));
                            callback(this.RESULT_SUCCESS);
                        }

                    })

                ]
            })
        ]);
    }
});
Then do node ble_echo.js
Then open up a BLE utility connector like LightBlue Explorer
and connect to the Edison....
Then disable WIFI Internet via nano /etc/network/interfaces
And do a "ping test"
Anyway, it worked for me....
Jarred Yaw
@jyaw
Aug 20 2016 21:08
Those who use digital ocean or something else for NS.... it appears I maxed out the CPU (DAY) metric on azure today and NS went away on me :(. I'm thinking maybe I reset urchin a bunch of times and that consumed the time. Not sure. I want to avoid that in the future. Is there a set of instructions setting up something like digital ocean with nightscout? Which paid plan would I look at?
diabeticgonewild
@diabeticgonewild
Aug 20 2016 21:11
You do need screen installed because npm is always running in the background when BLE is running, and you can't kill that.
But it does work perfectly ptherwise.
You probably would want an @reboot cronjob for the node ble_echo.js command....so that the ble is initiated every time the Edison is turned on...
diabeticgonewild
@diabeticgonewild
Aug 20 2016 21:33
Well come to think of it, there are psuedo-crontab utilities that you can download for npm that are basically "Crontab for npm". Anyway, instead of @reboot, just run the node ble_echo.js command every 5 minutes to have it connect to the phone.
diabeticgonewild
@diabeticgonewild
Aug 20 2016 21:39
Well, technically you would want both a @reboot and a command running every 5 minutes or so to verify and ensure BLE connection.
cd node modules/bleno/ should be cd node_modules/bleno/...I really can't read even printed text...
John Dodds
@johners97
Aug 20 2016 21:45
openaps use tz rezone --timezone "BST" --adjust "missing" --date "timestamp dateString start_at end_at created_at" --astimezone monitor/pumphistory.json
Does this look right?
I would like to ask, why do you have to rezone? I know that it's necessary but why?
Sounds like a silly question I know
diabeticgonewild
@diabeticgonewild
Aug 20 2016 21:46
There probably is a simpler way, but I don't know. Honestly, that looks like long-line-itis...I wouldn't trust that to work.
John Dodds
@johners97
Aug 20 2016 21:54
mm-format-ns-glucose <input> <output>
When entering this in, you just put the glucose.json in nput and the ns-glucose into the output
?
Martin Haeberli
@mhaeberli
Aug 20 2016 22:47
@johners97 as I understand it, generally, some times are kept in UTC (Universal time, formerly known as Greenwich) ; a lot of other stuff is done in local time.
i need to rtfm again, but as I recall, for example, sgv / BGs come in in UTC
and so does pump-history
but for sanity and other reasons maybe (speculating), oref0 and other things like it rezoned to local
the time data as I recall is self-defining to the extent it tells you internally what time zone it is in.
Peter Miller
@ochenmiller
Aug 20 2016 22:48
:point_up: August 19, 2016 11:39 PM - @mddub , thanks for the tip!
diabeticgonewild
@diabeticgonewild
Aug 20 2016 22:57
I have the munches. I want white chocolate....it's hard not to give in.
Usually I want like Cheetos, Ice cream, Pizza, etc. so this is weird.