-
• #27
This works even better.
function setupGPS() { Bangle.setGPSPower(1); UBX_CFG_RESET(); wait(100); UBX_CFG_PM2(120,5); wait(20); UBX_CFG_RXM(); wait(20); UBX_CFG_SAVE(); wait(20); Bangle.on('GPS',onGPS); }
-
• #28
try to go out of the zip and touch and hold the zip to select it, don't go inside
Yes, this - it seems modern Android releases don't do it, but there was a certain Android OS where it was a bit painful to select the zips!
-
• #29
Managed to get the firmware updated on the wired bangle, thanks for the help.
-
• #31
Wow, that's great! No, sorry - I missed it. When I went to the thread I only saw Page 1 :)
I'm a bit busy today but I'll look into this later in the week
-
• #32
Been doing a test, been running for 18 hours and have 45% battery left, woo hoo.
I'll do a pull request, just tidying up a few things. -
• #33
Wow, that's amazing. Maybe you could come up with a 'GPS Config' app? So you can configure the GPS for various power modes (or return it to default).
You could just use
E.showMenu
for it: http://www.espruino.com/Reference#l_E_showMenuIf you're having difficulty with it, let me know. If you can provide functions a bit like
setModeNormal
,setModeSuperE
,setMode2Minute
I'm happy to do the rest. -
• #34
Have done a gpsservice widget with a settings app that sets the kind of parameters you describe above. Full details in the README at:
https://github.com/hughbarney/BangleApps/tree/master/apps/gpsservice
Have sent a pull request.
-
• #35
Very nice!
-
• #36
Where did the pictures go?
-
• #37
Just merged in!
-
• #38
Thanks for that. Have done another pull request for a gps_set|get_settings() and I now restore to SuperE mode on power off of the GPS through the gpsservice widget.
-
• #39
If you have an app using this gpsservice widget what happens when that app exits? Does the gpsservice widget keep the GPS powered on? If so, is there a way to have the gpsservice power off the GPS on an app exit? Thx
-
• #40
Right now, whenever an app exits the GPS gets powered off - basically when you switch apps, Bangle.js resets everything to a 'power-on' state so apps always have the same state.
It's a good way to keep Bangle.js nice and stable regardless of what each app does, but I am looking at adding a way of keeping the GPS powered on between apps that both use the GPS for a later firmware update.
-
• #41
@Gordon, what about introducing a descriptor about what should stay on during switch of apps... If descriptor is absent, behavior unchanged. If descriptor present, operation according to its multi-value statuses. Applications can then design what to do. There could even be an expiration in the description for each item keeping power so that things may not run down the battery when forgotten. Almost like power management of battery run laptops.
-
• #42
I've recently added the ability to do
Bangle.setGPSPower(1, "myappid")
which at least helps with stopping other apps/widgets powering off the GPS.The issue with letting apps request that stuff is kept running is that honestly it'd be so easy for it to be misused, and then it makes Bangle.js look bad for everyone when the battery life goes from weeks to a few hours any nobody knows why.
-
• #43
@Gordon, Thanks for the quick answer a couple of days ago. Sorry about the delay, I have 'been bush' field testing the Bangle.JS
If I follow what you are saying :
- A GPS app can call the GPS Low Power Service widget to set a power mode and power on the GPS.
- The GPS Low Power Service powers on the GPS in the requested mode.
- The GPS app exits and the GPS is automatically powered off.
- The GPS Low Power service continues to run with a widget icon indicating the GPS is on but the GPS is actually off.
Is that right?
Thanks, Mike.
- A GPS app can call the GPS Low Power Service widget to set a power mode and power on the GPS.
-
• #44
Hi Mike,
I think things are a little 'in flux' at the moment - it turns out the GPS Low Power Service widget isn't required and we'll likely be removing it soon as it complicates matters. In a few days time, this will be the situation:
- There's a
GPS Settings
app - you can go in there and adjust how you want the GPS to work - low power, normal, etc - These settings the apply to every other app that uses GPS (via the normal Bangle.js APIs)
- There'll be a GPS Status widget which you can add that'll show you the current status of GPS (on/off) if you're interested and the app/other widgets don't show anything.
Hope that helps!
- There's a
-
• #45
Pretty close to pushing the GPS Setup app out in the next couple of days.
-
• #46
Bangle.setGPSPower(1, "myappid") - sounds a good idea. But I agree about the power, always my worry too, thats why I have done the tiny GPS widget, I want to know when the the power hungry parts of the hardware are on.
-
• #47
Sounds good but I am not using the widget in a static way so I hope I can still dynamically change mode as needed. Will there be an API to allow me to dynamically change the GPS mode?
My speedalt app functions like a watch face in that it obeys the screen off timeouts etc. You can flick the screen on for 10 secs for a look with a wrist movement etc. While the screen is on it uses the current widget call to switch to SuperE mode and when the screen goes off it switches to PMOO mode. Worked really well over a two day hike plus 4 hours of driving on a single charge last weekend. ( Actually drops to PMOO mode 15 secs after the screen is turned off allowing a little time to restore the screen if you want to keep viewing it )
Alternatively, perhaps make that behavior one of the baked-in options in your settings app?
-
• #48
Hi Gordon, I should have added. No rush. The work that you folk have done on the GPS power management improvements is just fantastic. Best to think it through and get it right so no pressure. Keen to help or test if I can. Cheers Mike
-
• #49
That's a really nice use-case! I think that probably what makes the most sense is to tweak the new GPS Settings app (now merged in!) such that it provides a module, and you can do something like:
try { require("gps-settings").setLowPower(); } catch (e) { // GPS settings not installed }
I'll do that before we do anything with the widget anyway. I think it's a bit more flexible as it means the widget isn't sitting there using RAM when you're not running a GPS app.
-
• #50
Do we need the equivalent of a library or will the GPS setup app work as a library if you use require() ?
Had some success with the test bed code below.
Be good if you could verify the result.
Setting the update and search time to 120s and baud rate to 120s:
After the GPS has settled down and established its first fix I can see a cylcle of about 40-50s at 31mA and about 70s at 7.8mA. Increasing the period will increase the time it consumes the 7.8mA. So there is a trade off in terms of how recent you want the last fix to be. The 120s setting will effectively average the consumption out to 15mA - but that will double the battery life when GPS is on. My requirement is to get a GRID REF when walking and I dont mind it ot was 2 minutes ago. At 15mA average consumption you would get about 20hrs time with the GPS on all day as opposed to 10hrs using the PMS/SuperE mode.