GPS through Gadgetbridge #5540
Replies: 1 comment
-
Posted at 2022-10-03 by @gfwilliams I'm not 100% sure if Gadgetbridge does collect location data. It has to ask for permissions, but that is actually what is required to access Bluetooth! But yes, that's a good idea. I feel like it's definitely something that could be added to Gadgetbridge. It could be an option in the 'Android Integration' app and when enabled, if the phone is connected it can override Posted at 2022-10-03 by user148386 I was thinking about a new method like
but your idea sounds also good. In the settings of Gadgetbridge is an option to determine the current location and it has also an option "Keep location uptodate" so i thought there is already a way to get the location in gadgetbridge. Posted at 2022-10-06 by user148386 @gfwilliams do you have an idea when this could be implemented? Posted at 2022-10-07 by @gfwilliams
Honestly at this point I'd be doing basically what anyone would - which is trawling through the source to find out what that But when you know how to do it, just implement it in Posted at 2022-10-08 by RaoulDuke Implementing this is beyond my skills, but it would make the watch far more useful for things like cycling, hiking, paragliding - basically all outdoor activities where you need constant location information. Constant onboard GPS usage shortens battery life from a few weeks to a few hours. Posted at 2022-10-08 by @halemmerich This would be great. During hiking I had my phone tracking the location anyway because of the much better GPS reception. Using that to cheaply (in terms of battery) providing a position to the bangle is a good thought. @user148386 having a new method would mean all apps would have to be changed to use this. Overriding the original method (possibly as a config option) solves this. This can also allow an automatic fallback to internal GPS should the watch get disconnected from the phone. Posted at 2022-10-10 by @gfwilliams Just looking into this, the pref is called So this isn't something we can just hook on to. I guess the best solution is actually for the Bangle interface code to just check Posted at 2022-10-30 by user148386 Hi, If you want have a look at the code, you can find it here. I have currently the problem, that the LocationManager dose not return the count of satellites or the current course(at least i didn't find a getter for that), so i set them to zero. I also send an extra flag to show that the gps data comes from an external source. Posted at 2022-10-30 by @halemmerich You would probably have to implement a handler for the gps event in boot.js#20 of the android bangle app, that then calls something like Posted at 2022-10-30 by user148386 Can you give me a path to that file, because i don't find it? Posted at 2022-10-30 by @halemmerich You can find it here: https://github.com/espruino/BangleApps/blob/master/apps/android/boot.js Posted at 2022-11-06 by user148386 Hi, i would have an implementation that sends the gps data from the smathphone to the banglejs device. There it will be emitted with the "gps" event. Posted at 2022-11-06 by @thyttan Regarding the Gadgetbridge side of it: Regarding the Banglejs side of it: Posted at 2022-11-07 by @thyttan Posted at 2022-11-21 by user148386 Hi, And here is the PR for the android intergration app Please take a look if you have time. Posted at 2022-11-23 by @gfwilliams That's excellent - thanks! Let's hope this all gets merged soon :) Posted at 2022-12-04 by user148386 I had to repoen the Gadgetbride PR, since i broke the previous one by updating my branch. Do i have to do anything to merge it, or can only the maintainer merge the PR? Posted at 2022-12-04 by @thyttan Yes, when the PR looks good to one/some of the maintainers it will be merged. I left a comment on your recently closed PR :) Posted at 2022-12-08 by user148386 Yeah i saw it, if i need to update the branch again, i gonna look at it Posted at 2022-12-13 by user148386 Yesterday, the Gadgetbridge PR was merged, so this should now be included in the next release of the app. Posted at 2022-12-13 by @gfwilliams Realistically I'm probably not going to do a new Gadgetbridge app release before Christmas - Google added some extra requirements to the Play Store, and in the process of satisfying them things could get broken - and I don't want to do that just before Christmas when I won't be around to fix them. But the nightlies should have it in I hope. Posted at 2022-12-15 by HughB Not sure I would want an automatic fallback to watch gps. Too dangerous in my view as you might not be aware and it could flaten the battery. Also there could be a long period of no fix whilst the gps powers on and gets a first fix. Would have to be an option IMO. Posted at 2022-12-15 by @halemmerich The phone delivering GPS data is done to save power when GPS is active on the bangle. It does not push GPS events all the time. Posted at 2022-12-29 by user148386 I found some bugs in the Gadgetbridge app aswell as in the "Android" app on the banglejs device. The bug on the Gadgetbridge was, that the GPS_PROVIDER when the NETWORK_PROVIDER should have been used to get the gps data. Therefore the GPS data wasn't updated if you don't have a connection to some GPS sattelites. I fixed it and you can find the PR here The bug on the Banglejs "Android" App was that the received data was published on the "gps" event. However the normal event used by the build in gps chip is the "GPS" event. I changed therefore the event to match the event used by the build in gps chip. If you have time please take a look. @gfwilliams if it is not to late i would suggest to wait until the fix of the Gadgetbridge app is merge before releasing a new version of the Banglejs-Gadgetbridge app, so that this fix is also included. Posted at 2022-12-29 by user148386 @hughb @halemmerich To use the gps data from Gadgetbridge, you need to activate it in the settings of the Banglejs device of the Gadgetbrdige as well as in the settings of the "Android" app on the banglejs device. The default values are set to false, so it is not possible to accedentily activate this feature. Also @halemmerich, another advantage of the gps data from the Gadgetbridge is that we can use the GPS data of the current network (which is not possible on the bangle device). Therefore we can get gps data, even if ther is no connection to any gps sateliets. Posted at 2022-12-31 by @halemmerich All in all a very nice addition to the bangle :) This even makes auto-updating the position for the "My Location" app easy on the battery. Posted at 2023-01-06 by @gfwilliams @user148386 thanks for those fixes! Let's hope they get in to Gadgetbridge soon. Maybe you could also ensure 'long -> lon' in that PR, and then we can also get that fixed at the same time and pull out the change in the PR for BangleApps? I also noticed there is a comment on https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3007#issuecomment-760013 - maybe that's why it's not being merged at the moment? Posted at 2023-01-07 by user148386 I forgot to add the "long-lon" mapping in that pr and it is already merged. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-10-02 by user148386
Hi everyone,
i was looking into the GPS of the Banglejs 2 and it seems like it uses alot of energy if in use. I was wondering if it would be possible to get the GPS data through the gadgetbridge, since the phone has the needed battery capacity and a good enough GPS position?
Also, it looks like that the Gadgetbridge already collects location data.
Beta Was this translation helpful? Give feedback.
All reactions