[Help Wanted]: Rare updates on high accuracy with low distance filter
Required Reading
- [x] Confirmed
Plugin Version
4.16.9
Mobile operating-system(s)
- [ ] iOS
- [x] Android
Device Manufacturer(s) and Model(s)
Pixel 8
Device operating-systems(s)
Android 15
What do you require assistance about?
I was using the app with distance filter 200 and medium accuracy. Then around 9am I switched to 10 meters and high accuracy using await bg.BackgroundGeolocation.setConfig(...). But it seems like nothing changed. I don't see any indication in the logs, I received small number of locations with low accuracy only.
Attached config and logs from email logs option. You can see that it shows correct new configuration. But in the logs nothing.
[Optional] Plugin Code and/or Config
╔═════════════════════════════════════════════
║ TSLocationManager3.6.7 (442)
╠═════════════════════════════════════════════
╟─ Google Pixel 8 @ 15 (flutter)
{
"activityRecognitionInterval": 10000,
"allowIdenticalLocations": false,
"authorization": {},
"autoSync": true,
"autoSyncThreshold": 0,
"backgroundPermissionRationale": {
"title": "Allow {applicationName} to access this device's location even when closed or not in use?",
"message": "[CHANGEME] This app collects location data for FEATURE X and FEATURE Y.",
"positiveAction": "Change to \"{backgroundPermissionOptionLabel}\"",
"negativeAction": ""
},
"batchSync": false,
"configUrl": "",
"crashDetector": {
"enabled": false,
"accelerometerThresholdHigh": 20,
"accelerometerThresholdLow": 4.5,
"gyroscopeThresholdHigh": 20,
"gyroscopeThresholdLow": 4.5
},
"debug": false,
"deferTime": 0,
"desiredAccuracy": -1,
"desiredOdometerAccuracy": 100,
"disableAutoSyncOnCellular": false,
"disableElasticity": false,
"disableLocationAuthorizationAlert": false,
"disableMotionActivityUpdates": false,
"disableProviderChangeRecord": false,
"disableStopDetection": false,
"distanceFilter": 10,
"elasticityMultiplier": 1,
"enableHeadless": false,
"enableTimestampMeta": false,
"extras": {},
"fastestLocationUpdateInterval": -1,
"foregroundService": true,
"geofenceInitialTriggerEntry": true,
"geofenceModeHighAccuracy": false,
"geofenceProximityRadius": 1000,
"geofenceTemplate": "",
"headers": {},
"headlessJobService": "com.transistorsoft.flutter.backgroundgeolocation.HeadlessTask",
"heartbeatInterval": -1,
"httpRootProperty": "location",
"httpTimeout": 60000,
"isMoving": true,
"locationAuthorizationRequest": "Always",
"locationTemplate": "{\"timestamp\": \"<%= timestamp %>\",\"coords\": {\"latitude\": <%= latitude %>,\"longitude\": <%= longitude %>,\"accuracy\": <%= accuracy %>,\"speed\": <%= speed %>,\"heading\": <%= heading %>,\"altitude\": <%= altitude %>},\"is_moving\": <%= is_moving %>,\"odometer\": <%= odometer %>,\"event\": \"<%= event %>\",\"battery\": {\"level\": <%= battery.level %>,\"is_charging\": <%= battery.is_charging %>},\"activity\": {\"type\": \"<%= activity.type %>\"},\"extras\": {},\"_\": \"&id=53155658&lat=<%= latitude %>&lon=<%= longitude %>×tamp=<%= timestamp %>&\"}",
"locationTimeout": 60,
"locationUpdateInterval": 300000,
"locationsOrderDirection": "ASC",
"logLevel": 3,
"logMaxDays": 1,
"maxBatchSize": -1,
"maxDaysToPersist": 1,
"maxMonitoredGeofences": 97,
"maxRecordsToPersist": -1,
"method": "POST",
"minimumActivityRecognitionConfidence": 75,
"motionTriggerDelay": 0,
"notification": {
"layout": "",
"title": "",
"text": "Location Service activated",
"color": "",
"channelName": "TSLocationManager",
"channelId": "",
"smallIcon": "",
"largeIcon": "",
"priority": -1,
"sticky": false,
"strings": {},
"actions": []
},
"params": {
"device_id": "53155658"
},
"persist": true,
"persistMode": 2,
"schedule": [],
"scheduleUseAlarmManager": false,
"speedJumpFilter": 300,
"startOnBoot": true,
"stationaryRadius": 25,
"stopAfterElapsedMinutes": 0,
"stopOnStationary": false,
"stopOnTerminate": false,
"stopTimeout": 5,
"triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking",
"url": "http:\/\/server.traccar.org:5055\/",
"useSignificantChangesOnly": false,
"enabled": true,
"schedulerEnabled": false,
"trackingMode": 1,
"odometer": 249315.1875,
"isFirstBoot": false,
"didLaunchInBackground": false,
"didDeviceReboot": false
}
╔═════════════════════════════════════════════
║ DEVICE SENSORS
╠═════════════════════════════════════════════
╟─ ✅ ACCELEROMETER: {Sensor name="ICM45631 Accelerometer", vendor="Invensense", version=1, type=1, maxRange=156.9064, resolution=5.985504E-4, power=0.001, minDelay=5000}
╟─ ✅ GYROSCOPE: {Sensor name="ICM45631 Gyroscope", vendor="Invensense", version=1, type=4, maxRange=34.906586, resolution=1.3323124E-4, power=0.001, minDelay=5000}
╟─ ✅ MAGNETOMETER: {Sensor name="MMC56X3X Magnetometer", vendor="MEMSIC", version=1, type=2, maxRange=3198.1567, resolution=0.0976, power=0.001, minDelay=10000}
╟─ ✅ SIGNIFICANT_MOTION: {Sensor name="Significant Motion (wake-up)", vendor="Google", version=1, type=17, maxRange=1.0, resolution=1.0, power=0.001, minDelay=-1}
╚═════════════════════════════════════════════
[Optional] Relevant log output
06-13 08:35:34.094 INFO [TrackingService k]
╔═════════════════════════════════════════════
║ TrackingService motionchange: false
╠═════════════════════════════════════════════
06-13 08:35:34.114 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 3
06-13 08:35:34.120 INFO [HttpService a]
🔵 HTTP POST: b8e433c0-68be-4004-864d-0cc7979b6ad0
06-13 08:35:34.368 INFO [HttpService$f onResponse]
🔵 Response: 200
06-13 08:35:34.373 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 3
06-13 08:54:51.627 INFO [HeartbeatService stop]
🔴 Stop heartbeat
06-13 08:54:51.636 INFO [TrackingService changePace]
🔵 setPace: false → true
06-13 08:54:51.636 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: still
╟─ 🎾 ENTER: walking
╚═════════════════════════════════════════════
06-13 08:54:51.642 INFO [TrackingService k]
╔═════════════════════════════════════════════
║ TrackingService motionchange: true
╠═════════════════════════════════════════════
06-13 08:54:51.665 INFO [TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 5 (75911ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 37.468586,-122.233270 hAcc=15.852 et=+18d10h22m9s762ms alt=-18.600000381469727 vAcc=1.0], time: 1749830015754
06-13 08:54:51.683 INFO [SingleLocationRequest startUpdatingLocation]
🔵 [SingleLocationRequest start, action: 1, requestId: 5]
06-13 08:54:51.702 INFO [LocationRequestService b]
ℹ️ Location availability: false
06-13 08:54:52.932 INFO [LocationRequestService b]
ℹ️ Location availability: true
06-13 08:54:52.950 INFO [TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 5 (80ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 37.468510,-122.233204 hAcc=11.493 et=+18d10h23m26s878ms alt=-18.700000762939453 vAcc=1.0], time: 1749830092870
06-13 08:54:52.952 INFO [TSLocationManager onSingleLocationResult]
🔵 Acquired motionchange position, isMoving: true
06-13 08:54:52.960 INFO [TSLocationManager requestLocationUpdates]
🎾 Location-services: ON
06-13 08:54:52.965 INFO [SQLiteLocationDAO persist]
✅ INSERT: a99a2b38-cc1a-4fe2-ab4a-256a098b7cb0
06-13 08:54:52.966 INFO [ActivityRecognitionService start]
🎾 Start motion-activity updates
06-13 08:54:52.968 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
06-13 08:54:53.004 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 4
06-13 08:54:53.016 INFO [HttpService a]
🔵 HTTP POST: a99a2b38-cc1a-4fe2-ab4a-256a098b7cb0
06-13 08:54:53.057 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🎾 ENTER: walking
╚═════════════════════════════════════════════
06-13 08:54:53.343 INFO [HttpService$f onResponse]
🔵 Response: 200
06-13 08:54:53.350 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 4
06-13 08:54:57.005 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════
06-13 08:54:57.407 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════
06-13 08:54:57.900 INFO [TrackingService b]
ℹ️ Location availability: false
06-13 08:56:18.420 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: walking
╟─ 🎾 ENTER: still
╚═════════════════════════════════════════════
06-13 08:56:18.425 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: STOP_TIMEOUT in 300000ms (jobID: 2059034116)
06-13 08:56:18.427 WARN [TSScheduleManager oneShot]
ℹ️ Scheduling exact alarms requires android.permission.USE_EXACT_ALARM with SDK >= 34. Oneshot using in-exact Alarm
06-13 08:58:48.186 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: still
╟─ 🎾 ENTER: walking
╚═════════════════════════════════════════════
06-13 08:58:48.187 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: STOP_TIMEOUT
06-13 08:59:54.863 INFO [TrackingService b]
ℹ️ Location availability: true
06-13 08:59:54.930 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: walking
╟─ 🎾 ENTER: in_vehicle
╚═════════════════════════════════════════════
06-13 09:00:04.136 INFO [DeviceSettings$a onReceive]
🔴 PowerSaveMode
06-13 09:00:09.435 INFO [TSLocationManager d]
🔴 Location-services: OFF
06-13 09:00:09.436 INFO [TSLocationManager requestLocationUpdates]
🎾 Location-services: ON
06-13 09:00:09.438 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════
06-13 09:00:09.475 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 300000ms (jobID: -18513055)
06-13 09:00:09.478 INFO [SQLiteLocationDAO persist]
✅ INSERT: b0c8551c-496f-43b8-b6aa-b8182a1046e4
06-13 09:00:09.489 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
06-13 09:00:09.517 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 5
06-13 09:00:09.519 INFO [HttpService a]
🔵 HTTP POST: b0c8551c-496f-43b8-b6aa-b8182a1046e4
06-13 09:00:10.965 INFO [HttpService$f onResponse]
🔵 Response: 200
06-13 09:00:10.968 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 5
06-13 09:00:11.161 INFO [TSLocationManager d]
🔴 Location-services: OFF
06-13 09:00:11.162 INFO [TSLocationManager requestLocationUpdates]
🎾 Location-services: ON
06-13 09:00:11.163 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════
06-13 09:00:11.185 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: MOTION_ACTIVITY_CHECK
06-13 09:00:11.187 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 60000ms (jobID: -18513055)
06-13 09:00:16.492 INFO [TSLocationManager d]
🔴 Location-services: OFF
06-13 09:00:16.494 INFO [ActivityRecognitionService stop]
🔴 Stop motion-activity updates
06-13 09:00:16.496 INFO [HeartbeatService stop]
🔴 Stop heartbeat
06-13 09:00:16.699 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: MOTION_ACTIVITY_CHECK
06-13 09:00:16.938 INFO [TSGeofenceManager start]
🎾 Start monitoring geofences
06-13 09:00:16.941 INFO [ActivityRecognitionService start]
🎾 Start motion-activity updates
06-13 09:00:16.944 INFO [HeartbeatService stop]
🔴 Stop heartbeat
06-13 09:00:16.945 INFO [TrackingService changePace]
🔵 setPace: false → false
06-13 09:00:16.957 INFO [TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 6 (22338ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 37.468673,-122.233427 hAcc=20.232 et=+18d10h28m28s627ms alt=-18.5 vAcc=1.0], time: 1749830394619
06-13 09:00:16.958 INFO [TSLocationManager onSingleLocationResult]
🔵 Acquired motionchange position, isMoving: false
06-13 09:00:16.961 INFO [SQLiteLocationDAO persist]
✅ INSERT: 12e91fd7-f0a5-424a-99c9-dd7a50e0998f
06-13 09:00:16.963 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
06-13 09:00:16.970 INFO [TrackingService k]
╔═════════════════════════════════════════════
║ TrackingService motionchange: false
╠═════════════════════════════════════════════
06-13 09:00:16.983 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 6
06-13 09:00:16.984 INFO [HttpService a]
🔵 HTTP POST: 12e91fd7-f0a5-424a-99c9-dd7a50e0998f
06-13 09:00:17.045 INFO [HeartbeatService stop]
🔴 Stop heartbeat
06-13 09:00:17.050 INFO [TrackingService changePace]
🔵 setPace: false → true
06-13 09:00:17.050 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🎾 ENTER: in_vehicle
╚═════════════════════════════════════════════
06-13 09:00:17.050 INFO [TrackingService k]
╔═════════════════════════════════════════════
║ TrackingService motionchange: true
╠═════════════════════════════════════════════
06-13 09:00:17.055 INFO [TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 7 (22436ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 37.468673,-122.233427 hAcc=20.232 et=+18d10h28m28s627ms alt=-18.5 vAcc=1.0], time: 1749830394619
06-13 09:00:17.055 INFO [TSLocationManager onSingleLocationResult]
🔵 Acquired motionchange position, isMoving: true
06-13 09:00:17.057 INFO [TSLocationManager requestLocationUpdates]
🎾 Location-services: ON
06-13 09:00:17.058 INFO [ActivityRecognitionService start]
🎾 Start motion-activity updates
06-13 09:00:17.060 INFO [SQLiteLocationDAO persist]
✅ INSERT: d460b64d-65bb-42d1-bfc5-c87cf38cd400
06-13 09:00:17.061 INFO [HttpService flush]
ℹ️ HttpService is busy
06-13 09:00:17.284 INFO [HttpService$f onResponse]
🔵 Response: 200
06-13 09:00:17.288 INFO [HttpService a]
🔵 HTTP POST: d460b64d-65bb-42d1-bfc5-c87cf38cd400
06-13 09:00:17.504 INFO [HttpService$f onResponse]
🔵 Response: 200
06-13 09:00:17.513 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 6
06-13 09:00:17.954 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════
06-13 09:00:18.470 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
06-13 09:00:22.138 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🎾 ENTER: in_vehicle
╚═════════════════════════════════════════════
06-13 09:00:25.946 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════
06-13 09:00:33.901 INFO [TrackingService b]
ℹ️ Location availability: false
06-13 09:00:35.209 INFO [TrackingService b]
ℹ️ Location availability: true
06-13 09:00:35.995 INFO [ScheduleEvent a]
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: TERMINATE_EVENT
╠═════════════════════════════════════════════
06-13 09:03:50.604 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
06-13 09:04:00.634 INFO [ScheduleEvent a]
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: TERMINATE_EVENT
╠═════════════════════════════════════════════
06-13 09:05:35.104 INFO [TrackingService b]
ℹ️ Location availability: false
06-13 09:05:37.713 INFO [TrackingService b]
ℹ️ Location availability: true
06-13 09:05:37.745 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 300000ms (jobID: -18513055)
06-13 09:05:37.751 INFO [SQLiteLocationDAO persist]
✅ INSERT: bacab488-b83c-4a69-beba-533377ca9a3a
06-13 09:05:37.753 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
06-13 09:05:37.792 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 7
06-13 09:05:37.794 INFO [HttpService a]
🔵 HTTP POST: bacab488-b83c-4a69-beba-533377ca9a3a
06-13 09:05:38.254 INFO [HttpService$f onResponse]
🔵 Response: 200
06-13 09:05:38.265 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 7
06-13 09:07:06.231 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: in_vehicle
╟─ 🎾 ENTER: walking
╚═════════════════════════════════════════════
06-13 09:07:55.013 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: walking
╟─ 🎾 ENTER: still
╚═════════════════════════════════════════════
06-13 09:07:55.020 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: STOP_TIMEOUT in 300000ms (jobID: 2059034116)
06-13 09:07:55.022 WARN [TSScheduleManager oneShot]
ℹ️ Scheduling exact alarms requires android.permission.USE_EXACT_ALARM with SDK >= 34. Oneshot using in-exact Alarm
06-13 09:07:55.025 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: MOTION_ACTIVITY_CHECK
06-13 09:07:55.028 INFO [TSLocationManager d]
🔴 Location-services: OFF
06-13 09:07:55.035 INFO [TSLocationManager requestLocationUpdates]
🎾 Location-services: ON
06-13 09:07:55.081 INFO [TrackingService b]
ℹ️ Distance from stoppedAtLocation: -49.362
06-13 09:08:34.282 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: still
╟─ 🎾 ENTER: in_vehicle
╚═════════════════════════════════════════════
06-13 09:08:34.284 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: STOP_TIMEOUT
06-13 09:10:36.479 INFO [TrackingService b]
ℹ️ Location availability: false
06-13 09:10:38.647 INFO [TrackingService b]
ℹ️ Location availability: true
06-13 09:10:38.675 INFO [SQLiteLocationDAO persist]
✅ INSERT: 05bd1caa-9bc5-4870-aa81-41d5458d99ec
06-13 09:10:38.676 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 300000ms (jobID: -18513055)
06-13 09:10:38.681 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
06-13 09:10:38.720 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 8
06-13 09:10:38.723 INFO [HttpService a]
🔵 HTTP POST: 05bd1caa-9bc5-4870-aa81-41d5458d99ec
06-13 09:10:39.790 INFO [HttpService$f onResponse]
🔵 Response: 200
06-13 09:10:39.797 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 8
06-13 09:14:03.302 INFO [TrackingService b]
ℹ️ Location availability: false
06-13 09:14:03.540 INFO [TrackingService b]
ℹ️ Location availability: true
06-13 09:14:03.571 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: MOTION_ACTIVITY_CHECK
06-13 09:14:03.574 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 261893ms (jobID: -18513055)
06-13 09:14:03.577 INFO [SQLiteLocationDAO persist]
✅ INSERT: 05666cae-3dc1-4ce8-9022-a3e3e553b272
06-13 09:14:03.578 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
06-13 09:14:03.601 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 9
06-13 09:14:03.603 INFO [HttpService a]
🔵 HTTP POST: 05666cae-3dc1-4ce8-9022-a3e3e553b272
06-13 09:14:03.856 INFO [HttpService flush]
ℹ️ HttpService is busy
06-13 09:14:03.881 INFO [HttpService$f onResponse]
🔵 Response: 200
06-13 09:14:03.885 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 9
06-13 09:14:31.807 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
06-13 09:14:41.815 INFO [ScheduleEvent a]
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: TERMINATE_EVENT
╠═════════════════════════════════════════════
06-13 09:14:47.431 INFO [DeviceSettings$a onReceive]
🔴 PowerSaveMode
06-13 09:14:50.036 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: in_vehicle
╟─ 🎾 ENTER: walking
╚═════════════════════════════════════════════
06-13 09:15:43.057 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: walking
╟─ 🎾 ENTER: still
╚═════════════════════════════════════════════
06-13 09:15:43.061 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: STOP_TIMEOUT in 300000ms (jobID: 2059034116)
06-13 09:15:43.063 WARN [TSScheduleManager oneShot]
ℹ️ Scheduling exact alarms requires android.permission.USE_EXACT_ALARM with SDK >= 34. Oneshot using in-exact Alarm
06-13 09:15:43.064 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: MOTION_ACTIVITY_CHECK
06-13 09:15:43.066 INFO [TSLocationManager d]
🔴 Location-services: OFF
06-13 09:15:43.067 INFO [TSLocationManager requestLocationUpdates]
🎾 Location-services: ON
06-13 09:15:43.106 INFO [TrackingService b]
ℹ️ Distance from stoppedAtLocation: -47.704
What specific lines from your logs are you curious about?
If the State from the logs are correct, then those are the values being used.
My main question is why I'm not getting locations every 10 meters with GPS accuracy.
What do you think is gps accuracy?
GPS accuracy is typically less than 10 meters when you have a clear sky visibility. And I drove about 3 miles and only got 2 locations. That's definitely not what I would expect with these settings. Do you disagree?
If you see <40-60 meters, it’s GPS.
OK, let's not over-index on that point and focus on the core problem - it did not track my route with acceptable frequency. How can I troubleshoot and fix it?
Have you had a close look at the api docs for Config.distanceFilter? Are you aware of the default “distance filter elasticity”?
Yes, I did. And the numbers still don't add up. I was driving up to 30mph (<15m/s). So I expect a location at the very least every 30 meters. It's nowhere near that.
I also get similar feedback from our end users where they walk for about a mile and get 1 or 2 location updates.
Are you not testing this yourself?
I suggest you test by toggling between distanceFilter: 0 and 200.
The location API doesn’t provide a guarantee of your distanceFilter.
I think you misread something. This is from my own testing, but I'm saying that I hear the same feedback from other users.
I understand that distance filter is not an absolute guarantee, but it should be close enough when conditions are ideal.
To me it seems like the plugin didn't apply my new configuration. Shouldn't I see something related to configuration change in the logs?
When you call .setConfig, the plug-in persists the latest config in Android SharedPreferences.
The plug-in has listeners in Config changes are applies any changes live.
Whenever the plug-in changes state to moving state, it reconfigures a new LocationRequest instance according to the latest Config settings.
What if it was already in a moving state?
What if it was already in a moving state?
Like I said: “The plug-in has listeners on the Config system: changes are applied live.”.
I read that part, but then it conflicts with your other statement:
Whenever the plug-in changes state to moving state, it reconfigures a new LocationRequest instance according to the latest Config settings.
So is it applied live (aka immediately) or is it applied when next location request is executed? If it is applied immediately, then I'm not sure what did you mean by it being applied on the next state change to moving?
If it is ONLY applied on next change from stopped to moving, what is the way to force config to be applied immediately?
You don’t understand the architecture of the native Android location api.
There is no LocationRequest instance or active location-updates while the plug-in is in the stationary state.
It is 100% guaranteed that when you change distanceFilter via .setConfig, those changes are applied and used in real time.
I am pretty familiar with Android location API.
It seems like you assume that we always call setConfig when plugin is in the stationary state, which is NOT a guarantee, from what I can tell. Am I wrong?
It doesn’t matter when you call .setConfig, moving or stationary.
When you change distanceFilter via .setConfig, the new value is applied and used immediately.
OK, then it is guaranteed that my configuration was applied. Then why is the result so poor? Do you see anything that would indicate the reason in my logs?
I expected more than 100 locations for my trip, but only received 2.
Whenever you change any Config option via .setConfig, you will see this:
D TSLocationManager: [c.t.l.adapter.TSConfig e] ℹ️ Persist config, dirty: [distanceFilter]
This is the plugin persisting the updated Config to SharedPreferences.
When the plugin happens to be in the moving state at that time, you will also see the plugin toggle location-services OFF/ON. This is a new LocationRequest instance being created and requestLocationUpdates being called upon the FusedLocationProviderClient.
I TSLocationManager: 🔴 Location-services: OFF
I TSLocationManager: [c.t.l.l.TSLocationManager requestLocationUpdates]
I TSLocationManager: 🎾 Location-services: ON
The SDK's Location API System has an EventBus listener on Config changes:
@Subscribe(threadMode = ThreadMode.MAIN)
public void onConfigChange(ConfigChangeEvent event) {
if (!mIsUpdatingLocation.get()) return; // <--- Not updating location? nothing to do.
if (event.isDirty("desiredAccuracy") || // <-- do we have changes on any of these Config options?
event.isDirty("distanceFilter") ||
event.isDirty("locationUpdateInterval") ||
event.isDirty("fastestLocationUpdateInterval") ||
event.isDirty("deferTime") ||
event.isDirty("disableElasticity") ||
event.isDirty("elasticityMultiplier")
) {
requestLocationUpdates(); // <-- restart location updates.
}
}
Interesting. I don't see Persist config in my log.
You are either:
A. Not calling .setConfig
B. Calling .setConfig with a value that is the same as currently set (no "dirty" fields)
C. Not using logLevel: bg.Config.LOG_LEVEL_VERBOSE
Would it log it in stationary mode? Or only in moving state?
The SDK's Config system operates independently of its Location API system. It doesn't care if the Location API is ON or OFF.
No matter what, when you call .setConfig, in any state, such that the Config system marks any of its fields as "dirty", you will see in the logs:
D TSLocationManager: [c.t.l.adapter.TSConfig e] ℹ️ Persist config, dirty: [distanceFilter]
Unfortunately it's not happening. Just tried it in debug.
Here's the code:
debugPrint(">>>>> before setConfig");
final res = await bg.BackgroundGeolocation.setConfig(Preferences.geolocationConfig());
debugPrint(">>>>> after setConfig $res");
Here's the log:
I/flutter ( 3838): >>>>> before setConfig
I/TSLocationManager( 3838): [c.t.l.http.HttpService flush]
I/TSLocationManager( 3838): ╔═════════════════════════════════════════════
I/TSLocationManager( 3838): ║ HTTP Service (count: 0)
I/TSLocationManager( 3838): ╠═════════════════════════════════════════════
I/flutter ( 3838): >>>>> after setConfig [State enabled: true, isMoving: false, trackingMode: 1, desiredAccuracy: 10, distanceFilter: 75.0, odometer: 0.0, schedulerEnabled: false, foregroundService: true]
I/flutter ( 3838): >>>>> before setConfig
I/TSLocationManager( 3838): [c.t.l.http.HttpService flush]
I/TSLocationManager( 3838): ╔═════════════════════════════════════════════
I/TSLocationManager( 3838): ║ HTTP Service (count: 0)
I/TSLocationManager( 3838): ╠═════════════════════════════════════════════
I/flutter ( 3838): >>>>> after setConfig [State enabled: true, isMoving: false, trackingMode: 1, desiredAccuracy: -1, distanceFilter: 75.0, odometer: 0.0, schedulerEnabled: false, foregroundService: true]
You can see that the desiredAccuracy in the response from setConfig is changing, so the plugin is receiving the new value, but there's no "Persist config" ever logged.
"logLevel": 3,
You need to use logLevel: bg.Config.LOG_LEVEL_VERBOSE
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.