Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Instances #6

Open
gregwaehner opened this issue Jun 9, 2014 · 11 comments
Open

Multiple Instances #6

gregwaehner opened this issue Jun 9, 2014 · 11 comments

Comments

@gregwaehner
Copy link

gregwaehner commented Jun 9, 2014

Hi - I'm helping Cheryl and she has 2 children with T1D. I tried getting creative tonight and modified the metadata information in the CloudPeddle deployment process. Unfortunately, it looks like there is a limit of one cgm-pebble instance per phone. I'm guessing it's tied to the App UUID. So my question...

  1. Is there a way to run two cgm-pebble instances on the same phone?
  2. Is there a way for a single cgm-pebble instance to query / display from 2 cgm-remote-monitor Azure websites?

Thanks.

  • Greg


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@jasoncalabrese
Copy link
Member

I thought we could just change the guid and then install 2 copies as a initial hack. Since there are several families with 2 T1D kids I'm hoping we can come up with a real solution.

Ideally they would be able to use a single nightscout server and single pebble app and based on the receiver id's we'd be able to figure out which kid it was for. Before that having the pebble point to 2 nightscout servers might be a good step.

@Alkene
Copy link

Alkene commented Jul 30, 2014

Greg recently helped me out by letting me know I needed to change the UUID so I could run two different watchfaces. I have done that and it is nice that I can now easily switch between the two kids on the pebble. Is there anyway to have the pebble alarm go off for the kid that is not on the active watchface display?

@bewest
Copy link
Member

bewest commented Jul 30, 2014

No. I just met someone from Pebble team, and we quickly ran through some of our use cases.
There is not a way to run "background" apps on pebble right now.

Some alternative ideas:

  • allow one pebble app to view any number of "endpoints"
  • use split screen
  • add some kind distinguishing mark
  • use the accelerator sensor to detect "shake/swip to next endpoint"
  • automatically rotate through endpoints on predictable cycle

The short term hack, as you've discovered is to generate new app in cloudpebble, and use the newly generated UUID from there.

@Alkene
Copy link

Alkene commented Jul 30, 2014

Yeah, I was afraid of that.

@Alkene
Copy link

Alkene commented Jul 31, 2014

Okay, so I'm going to try and add two endpoints and have it switch the display every 30 seconds to the other kid. This would be where I change how often Pebble.addEventListener("appmessage" is calling cgmfetch(), right?

static void timer_callback(void *data) { send_cmd(); timer = app_timer_register(60000, timer_callback, NULL);

So I would want to change the 60000 to 30000

Then instead of using opts I could just put in the url for that particular kids data set.

var req = new XMLHttpRequest();
var endpointnumber = 2;
var url1 = http://kid1.azurewebsites.net/pebble
var url2 = http://kid2.azurewebsites.net/pebble

//console.log('options', opts, opts.endpoint);
If(counter % endpointnumber == 1){
req.open('GET', url1, true);
}else{ 
req.open('GET', url2, true);
}

Then I could continue with the existing code and make all the data handling variables arrays based on counter so it would be unique to the watch face.
example.
delta[counter % 2] = (currentBGDelta[counter % 2] ect....
counter = counter +1;

Any comments would be greatly appreciated and probably save me lots of time trying to figure this out.

@Alkene
Copy link

Alkene commented Aug 2, 2014

Never mind. I got it all figured out. Thanks for the idea bewest. I now have it set to switch between each kid every 30 seconds and custom alarms set up such that the alertsince are arrays and stay with each kid. I did the programming so that it would be fairly easy to expand to more than two people. Is there any interest for me to clean up my code a little more and put in a pull request? I would do it such that everything would stay the same for someone that doesn't have multiple accounts they are trying to monitor, but would be easy to change a few lines of code for someone that needed to have the pebble constantly switching. The only thing I won't be able to do is changed the settings website to pull in multiple website links to get the needed data.
kid1
kid2

@jasoncalabrese
Copy link
Member

@Alkene, this is really cool, have you looked at what we're doing on #16

Lets align so that we don't run into merge hell, there were lots of changes in the other PR. Also lots a indent/whitespace stuff so I think pulling all this together will take some work. The sooner we start on that the better.

We need to move the setting page over here so we can add multiple urls, like you said, also the names.

I'll probably be working on this late tonight

@Alkene
Copy link

Alkene commented Aug 2, 2014

Yeah, I have been kind of watching for when that big merge comes through. I will try and keep an eye out for when it does and then see if I can use that to do a clean pull request.

@jasoncalabrese
Copy link
Member

@bewest, @Alkene, I just moved the config page over! Was way easier than I thought.

@Alkene you could work on the changes for the setting page if you want, just target a pull a request to the gh-pages branch.

@jasoncalabrese
Copy link
Member

#16 is getting very close, I'd like to get this in soon too. We have some family friends that this will really help.

@Alkene do you have any commits in your repo yet? Should I start a new branch in the community repo that we can target with pull requests so we can start working on the integration?

@Alkene
Copy link

Alkene commented Aug 2, 2014

I haven't made any commits yet so if you wanted to start a new branch in the community repo that would be fine. I'm actually not sure how to code in HTML and when I do get to it it will be more trial and error on my part. We have a wedding to do today but I plan to set some time aside tomorrow to work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants