mendhak/gpslogger

Position recording stops early

Opened this issue · 9 comments

I tried gpslogger for some of the recent versions on my Android 8 Huawei P10 Lite, but it is unusable for me:

Starting logging with battery optimization switched off (other apps need that to continue logging while the screen is locked), the logging of positions stops very early (probably as soon as the screen is locked).

The way I use it is like this:

  1. Start the app
  2. Activate the screen saver (lock screen) by pressing power button shortly
  3. Put the phone back in the pocket.

At the end the tracks being recorded only have one or two positions.
That means the app is completely unusable for logging the positions.
I have at least one app that has no problems being used the same way, so I guess it's a problem of the app, not of the device.
However other apps (like OpenTracks) also show this problem.

The logest track I've ever recoded has just two trkpat elements.

I was about to link to the dontkillmyapp site just like the comment here. I've been contacted by other Huawei users both here on Github issues and on email, with the same problem but there isn't much I can do.

But you said there is another app that has no problems - can you share its name, or if you cannot share its name, can you check its permissions. Is it using a WAKELOCK or a "keep device awake" permission? Because that would explain why it's able to function fine.

The other app is apemap (also knows as ape@map, see http://www.apemap.com/ (also in play store)). However I have a license for the professional version, so I don't know whether the free version behaves identical. I know that I have to turn off battery optimization when I want to record a track, but I also do that for gpslogger.
I just checked the settings only available when the app is running: It was set to "automatic", so I changed it to "manual", allowing background execution. I'll see and report whether that makes a difference.

I had a look at apemap and it doesn't have a wakelock. So I'm not sure how they're managing to stay awake and keep recording.

I also saw your comment about various guides on implementing location services. I've done all of the things mentioned like foreground services, permissions, notification, just like OpenTracks has. One thing I haven't done though is the Fused Location Provider. I cannot use that as it's a proprietary service, so it's not allowed on F-Droid.

I tried a newer mobile (Android 12, ColorOS 12.1 (Oppo)), but the issue is still the same: I get just a few points recorded.
BTW: Why can't I save or copy the protocol that I can display?

I'm not sure then, why that's still happening on another device. I'm assuming you've done everything on that OS related to battery and permissions. Only other thing I could think of if there are some additional proprietary battery optimization features in the OS, or a third party application like a battery saver?

I'm not sure what you mean by copying the protocol? What protocol?

"Protocol" is the text you see when having selected the "protocol view" ("Protokollansicht" in German).
I did a "field test" yesterday, keeping the app in the foreground and the display active, and there it seemed to log waypoints at the second attempt (on the first attempt it logged just one waypoint and then stopped, even though I kept the app in the foreground. But I'll have to investigate the data more carefully)

My second field test also failed: I had disabled all energy saving options (but the lockscreen would still activate), and gpslogger was set to log a position every 30 seconds. After about 90 minutes about 12 positions were logged; one position about every five minutes.
GPX and debug log are in the file.
gpslogger-test.zip

In the meantime I tried yet another app: OsmAnd
So far this is the only app that logs positions while in background and energy saving is not enabled. It uses Google Play Services by default, but can be set to use the Android API.
As the app is open source, can't you copy the mechanism to let users select the location provider they are most happy with?

I had a look at the debug log, and that time interval of 5 minutes is definitely matching the doze mode time limit. That's as good as it's going to get.

The OsmAnd F-Droid app doesn't seem to have the option to use Google's own location provider, but the Google Play Store version does. F-Droid doesn't allow including the proprietary library that provides the Fused Location Provider.