-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
location frequency control #1168
Comments
I think quite a few people have found a difference going into Android 12 with device update frequency. This has been exacerbated by different device manufacturers doing slightly different things. What I've found (on both the emulator and on a Pixel device) is that, in move mode, you get locations at roughly double the frequency specified in In move mode,
For interval, it's the other way round. The parameter in
There's no intent available to allow config twiddling, and remove config / command doesn't really work on Android yet. This will come in 2.5.0 (hopefully) and provide a load more capabilities around being able to remotely configure the app either via the transport or through an intent. |
I did some sleuthing, there seems to be some issues with the emulator because it doesn't emulate non-GPS sources of location. Also, despite asking for a On a real device (pixel 4a running Android 12), in move mode and with the app not in the foreground, I see the following frequencies:
So it turns out that the parameters we can provide to the Google client are really nothing more than a "best effort". You'll get an average interval that's the requested (or more frequent), but there's no guarantee that you'll get locations at least as often as specified. It's also worth saying that the MapActivity maintains its own high accuracy listener, which the background service then can use to send locations more frequently. With |
ok. i'm not looking for frequency updates at least as frequent as X - the other way around - i want to specify X and not update more frequently than X. OR when the move distance (locatorDisplacement) has gone at least Y. given above it looks like the closest i can come is to replicate your experiment and try to pick a moveModeLocatorInterval value that produces an average near what i want to achieve for X (and understand that move mode doesn't consider locatorDisplacement). Would significant change mode work the same way with locatorInterval? |
That is similar to what I am seeing, albeit on Android 11. When the move mode interval is set to 10 seconds, I am getting updates of every second. When the interval is set to 60 seconds the reporting interval is between 4-5 seconds. So it always seems higher than the requested interval. Perhaps owntracks should skip the extra reporting (i.e. not send them onto the MQTT/HTTP server)? FWIW, I have "improve location accuracy" disabled as we live in a rural area, and it has the opposite effect (i.e. only 1 cellular mast about 5 miles away). With it enabled, we get some pretty random locations and the frequency of reports appears to increase. |
So the Google location client does also let you specify a I wonder if it'd be useful to have a preference toggle that allows users to peg the
Yes, that value is what gets set as the parameter for |
Sounds like a very good approach. If you want any help with the testing I am very happy to help. I have the source downloaded and can build the app, just not got my head around the code yet :) |
I'll add it into the next release. |
I have just been for a drive around the block with a hacked version of setupLocationRequest() which simply sets fastestInterval to the same value as interval and it appears to work very well. |
also using http mode (in homeassistant) vs mqtt mode.
Something seems to have changed in Android 12 with respect to the frequency at which location updates occur - at least with my particular phone. What i am observing is that in move mode, location updates seem to occur much more frequently. Prior to Android 12, they seem to occur about every 20-30 seconds. Now they seem to happen every 1-2 seconds - i am now getting thousands of API calls to my reverse geocode provider when the device is in move mode. the only setting i had changed was moveModeLocatorInterval to 20 seconds - after updating to Android 12 and seeing increased frequency, i changed it to 60 seconds thinking it may slow down the location updates. But from reading the booklet, i'm thinking this only affects how frequently owntracks actively checks for location updates - but in move mode, if it's getting gps updates from "other apps", then it's simply publishing them upon arrival, but i'm not sure i'm interpreting the booklet correctly.
I have been using tasker to change the device from significant change mode to move mode when in the car and back to significant change mode, at home. This was working great until the change to Android 12.
I am wondering if this is known/expected or something else might be going on. I am fine to abandon move mode and use siginficant change mode if i can figure out how to pick some values of locatorInterval & locatorDisplacement to get better accuracy than the default significant change mode settings. If i understand these two parameters, the location is published not more frequently than locatorInterval AND only when location has changed >= locatorDisplacement since the last publish... if that is correct, then i can play around with some values and try it out.
Is there any way to update these values dynamically? ie, can they be set by sending an Intent from Tasker? or only by remote command? (home assistant doesn't do anything to enable remote commands, so i'd have to change to mqtt mode to use that option)
The text was updated successfully, but these errors were encountered: