mendhak / gpslogger

:satellite: Lightweight GPS Logging Application For Android.
https://gpslogger.app
Other
1.97k stars 606 forks source link

App is logging more frequently than specified, draining battery? #586

Open mehrdadn opened 7 years ago

mehrdadn commented 7 years ago

Hi,

I'm experiencing a weird problem. My logging interval is set to 300 seconds, minimum distance to 25 meters, minimum precision to 499 meters, match duration to 10 seconds, absolute fix time to 30 seconds, and "Don't log if I'm not moving is checked".

While I'm on a train, however, I see the phone trying to update its position every 1-2 minutes, which drains my battery. This occurs whether or not a point is successfully logged. Why does this occur? I'm not sure how to diagnose it. Two screenshots of the logging can be found here.

Thanks!

mendhak commented 7 years ago

Are you using multiple profiles, accidentally switched by any chance? You could try to enable debug logging and keep the logger running for say 30 minutes then post it or email it to me, can have a look in there. You can also attempt a clean start by wiping the app's data and resetting from scratch.

mehrdadn commented 7 years ago

Sorry for the lack of a reply, I messed something up and didn't get a notification!

I am using 2 profiles but they are not accidentally switched; the other profile is set to continuous monitoring (although for some reason it doesn't actually record new data points despite continuously leaving on the GPS... perhaps another thing to post an issue about). I'll try the debug log and see if I can find anything, thanks for the suggestion! The reset might also work, it does look feel like an internal misconfiguration of sorts.

mehrdadn commented 7 years ago

@mendhak I got a log of the issue. First, here's what it looks like in the Log View:

13:32   Requesting GPS location updates
13:32   Requesting cell and wifi location updates
13:32   <LAT_REDACTED>,<LON_REDACTED>
13:32   Filename: gpslogger-<SERIAL_REDACTED>-2017
13:34   Requesting GPS location updates                         <------- why??
13:34   Requesting cell and wifi location updates               <------- why??
13:35   Absolute timeout reached, giving up on this point

And here's the debug log (debuglog.txt):

13:32:11 INFO  GpsLoggingService.startGpsManager:583 - No movement detected in the past interval, will not log
13:32:11 DEBUG GpsLoggingService.setAlarmForNextPoint:943 - Set alarm for 450 seconds
13:32:45 DEBUG GpsLoggingService.onEvent:1095 - DetectedActivity [type=IN_VEHICLE, confidence=42]
13:32:45 DEBUG GpsLoggingService.onEvent:1098 - Just exited still state, attempt to log
13:32:45 INFO  GpsLoggingService.startGpsManager:602 - Requesting GPS location updates
13:32:45 INFO  GpsLoggingService.startGpsManager:613 - Requesting cell and wifi location updates
13:32:46 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:46 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:47 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:47 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:48 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:49 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:50 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:51 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:52 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:32:52 DEBUG GeneralLocationListener.onGpsStatusChanged:118 - Fix obtained
13:32:52 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185462905
13:32:52 INFO  GpsLoggingService.onLocationChanged:866 - <LAT_REDACTED>,<LON_REDACTED>
13:32:52 DEBUG GpsLoggingService.resetCurrentFileName:710 - Should change file name dynamically: true
13:32:52 INFO  GpsLoggingService.resetCurrentFileName:735 - Filename: gpslogger-<SERIAL_REDACTED>-2017
13:32:52 DEBUG GpsLoggingService.onLocationChanged:876 - Logging passive location to file
13:32:52 DEBUG GpsLoggingService.writeToFile:970 - Calling file writers
13:32:52 DEBUG Kml22WriteHandler.run:216 - Finished writing to KML22 File
13:32:52 DEBUG AndroidWearLogger.write:59 - Android wear logger - connect to device
13:32:52 DEBUG GpsLoggingService.stopGpsManager:674 - Removing towerLocationManager updates
13:32:52 DEBUG GpsLoggingService.stopGpsManager:679 - Removing gpsLocationManager updates
13:32:52 DEBUG GpsLoggingService.setAlarmForNextPoint:943 - Set alarm for 450 seconds
13:32:53 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871

13:34:49 DEBUG GpsLoggingService.onEvent:1086 - DetectedActivity [type=STILL, confidence=80]
13:34:49 DEBUG GpsLoggingService.onEvent:1088 - Just entered still state, attempt to log
13:34:49 INFO  GpsLoggingService.startGpsManager:602 - Requesting GPS location updates
13:34:49 INFO  GpsLoggingService.startGpsManager:613 - Requesting cell and wifi location updates
13:34:50 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 23 satellites
13:34:50 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:51 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:52 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:52 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:53 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:54 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:55 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:56 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:56 DEBUG GeneralLocationListener.onGpsStatusChanged:118 - Fix obtained
13:34:56 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:34:56 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:34:57 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:57 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:34:57 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:34:58 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:58 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:34:58 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:34:59 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:34:59 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:34:59 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:00 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:35:00 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:00 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:01 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:35:01 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:01 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:02 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:35:02 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:02 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:03 DEBUG GeneralLocationListener.onGpsStatusChanged:139 - 24 satellites
13:35:03 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:03 DEBUG GpsLoggingService.onLocationChanged:771 - Has description? false, Single point? false, Last timestamp: 1508185972871
13:35:04 WARN  GpsLoggingService$3.run:648 - Absolute timeout reached, giving up on this point
13:35:04 DEBUG GpsLoggingService.stopGpsManager:674 - Removing towerLocationManager updates
13:35:04 DEBUG GpsLoggingService.stopGpsManager:679 - Removing gpsLocationManager updates
13:35:04 DEBUG GpsLoggingService.setAlarmForNextPoint:943 - Set alarm for 450 seconds

(Note that my parameters are slightly different than from my first post above, e.g. logging interval is 450 seconds here.)

Why is the app trying to get a position before 450 seconds have passed since the last fix? This doesn't make sense to me.