transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.64k stars 425 forks source link

Location stopped by android and ios after nearly exactly 2 hours #2177

Open mbuttin opened 3 days ago

mbuttin commented 3 days ago

I test this plugin for my app. What interseting me is the battery efficiency and the robust capacity to get location when app is in the background or screen is off. My app track location of the user for long walks, up to 5h. The app looks to work fine when fieldtesting it (ios still got some "gps jumps" that looks to be solved in android with speedJumpFilter), but suddenly after 2 hours (I can't get the exact time, but it should be really close from 2hrs), the app cease to get position on the 3 devices I was testing, at the same time (2 androids phones and 1 ios phone). When checking on the phones, I had to "restart" the app, but then, the geolocation didn't start again. So, is the problem from os that terminate the app after 2hrs ? Or is it something with the plugin ? And why the plugin didn't start again ? After a delay (testing again 2hrs after termination), when launching the app, the plugin start again.

Your Environment


## Expected Behavior
The app should continue to work after 2hrs.
Bonus if there is a way to check periodically if app is terminated and relaunch it.

## Actual Behavior
The app stop working after 2hrs

## Steps to Reproduce
<!--- reproduce this issue; include code to reproduce, if relevant -->
1. Start the plugin
2.Get position for 2 hrs
3.No more position after 2hrs
4.Plugin didn't restart if app is relaunched.
Note : on ios, I noticed that the last "notification" before the app stopped sending location was : "authorization status changed 3"

## Context
Track position for long walks.

## Debug logs
<!-- include iOS / Android logs
- ios XCode logs,
- use #getLog #emailLog methods (@see docs)
- Android: $ adb logcat -s TSLocationManager
-->
<details><summary>Logs</summary>

``` <!-- Syntax highlighting:  DO NOT REMOVE -->
PASTE_YOUR_LOGS_HERE

christocracy commented 3 days ago

See wiki “Debugging” and learn to fetch the plug-in log database using .emailLog (search the api docs).

the plug-in has no trouble tracking for an infinite time, regardless if stopped for any length of time. I’ve been field-testing daily for over 10 years.

here I am travelling throughout France in trains and cars for over 2 weeks this past summer:

https://www.transistorsoft.com/lab/france

mbuttin commented 3 days ago

Ok, got it. As I uninstalled/reinstalled the app for other debugging purpose, I think that the log from that event have disappeared ? I'll do an other field test soon, and will post the logs if it appends again. Thx for support. Just for question : during you travel, did you keep the plugin active all time, or only start it before moving from place to place ? Let me know next time you stop to Lyon :)

christocracy commented 2 days ago

during you travel, did you keep the plugin active all time,

I had the demo app running. I always have the demo app running on my phones. I almost never interact with the app. The Android device was stuffed in my suitcase and never interacted with other than recharging.

Let me know next time you stop to Lyon :)

There’s some big hills in that city.

mbuttin commented 22 hours ago

Hi. I'm now trying to understand the debug logs. For example, here, I've ready/start the plugin at 11:51 and then I have a TrackingService stopped log (did nothing for that)... So it goes to heartbeat mode 5 min later but that does nothing, and then heartbeat again 5 min later (still nothing), and then at 12:02, this occurs : 10-19 12:02:01.650 DEBUG [LifecycleManager onStart] ☯️ onStart 10-19 12:02:01.656 DEBUG [LifecycleManager onResume] ☯️ onResume and then everything works fine for a while, get my position updates and could use them with my app.

Could you help me understand how to read those logs and what happened ? I should do something wrong... Why I got a trackingservice stop ? 10-19 11:51:01.953 DEBUG [AbstractService onDestroy] 🔴 LocationRequestService stopped 10-19 11:51:01.997 DEBUG [AbstractService f] ⚙️︎ TrackingService.stopSelfResult(1): true 10-19 11:51:01.999 DEBUG [AbstractService onDestroy] 🔴 TrackingService stopped 10-19 11:56:40.575 INFO [ScheduleEvent a]

And why does it restart "by itself" 11 minutes later ?

Here is the full log of that timeline :

10-19 11:50:59.109 INFO [LoggerFacade$a a] ╔═════════════════════════════════════════════ ║ TSLocationManager version: 3.5.5 (434) ╠═════════════════════════════════════════════ ╟─ Xiaomi M2101K7BNY @ 13 (react) { "activityRecognitionInterval": 10000, "allowIdenticalLocations": false, "authorization": {}, "autoSync": true, "autoSyncThreshold": 0, "backgroundPermissionRationale": { "title": "Permettre à {applicationName} d'accéder à votre localisation en arrière plan ?", "message": "Pour permettre le fonctionnement d'iMarshall, vous devez valider la permission {backgroundPermissionOptionLabel}", "positiveAction": "Modifier pour {backgroundPermissionOptionLabel}", "negativeAction": "Annuler" }, "batchSync": false, "configUrl": "", "crashDetector": { "enabled": false, "accelerometerThresholdHigh": 20, "accelerometerThresholdLow": 4.5, "gyroscopeThresholdHigh": 20, "gyroscopeThresholdLow": 4.5 }, "debug": true, "deferTime": 0, "desiredAccuracy": -1, "desiredOdometerAccuracy": 100, "disableAutoSyncOnCellular": false, "disableElasticity": true, "disableLocationAuthorizationAlert": false, "disableMotionActivityUpdates": false, "disableProviderChangeRecord": false, "disableStopDetection": false, "distanceFilter": 10, "elasticityMultiplier": 1, "enableHeadless": false, "enableTimestampMeta": false, "extras": {}, "fastestLocationUpdateInterval": 5000, "foregroundService": true, "geofenceInitialTriggerEntry": true, "geofenceModeHighAccuracy": false, "geofenceProximityRadius": 1000, "geofenceTemplate": "", "headers": {}, "headlessJobService": "com.transistorsoft.rnbackgroundgeolocation.HeadlessTask", "heartbeatInterval": 300, "httpRootProperty": "location", "httpTimeout": 60000, "isMoving": true, "locationAuthorizationRequest": "Always", "locationTemplate": "", "locationTimeout": 60, "locationUpdateInterval": 1000, "locationsOrderDirection": "ASC", "logLevel": 5, "logMaxDays": 3, "maxBatchSize": -1, "maxDaysToPersist": 1, "maxMonitoredGeofences": 97, "maxRecordsToPersist": 0, "method": "POST", "minimumActivityRecognitionConfidence": 75, "motionTriggerDelay": 0, "notification": { "layout": "", "title": "iMarshall", "text": "iMarshall suit votre position pour permettre au club de golf d'optimiser le rythme de jeu. Votre position n'est pas enregistrée en dehors du périmètre du golf et les données ne sont pas stockées plus de 24h. Vos données ne sont communiquées à aucun autre utilisateur.", "color": "", "channelName": "TSLocationManager", "channelId": "", "smallIcon": "", "largeIcon": "", "priority": -1, "sticky": false, "strings": {}, "actions": [] }, "params": {}, "persist": true, "persistMode": 2, "schedule": [], "scheduleUseAlarmManager": false, "speedJumpFilter": 100, "startOnBoot": false, "stationaryRadius": 25, "stopAfterElapsedMinutes": 300, "stopOnStationary": false, "stopOnTerminate": false, "stopTimeout": 10, "triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking", "url": "", "useSignificantChangesOnly": false, "enabled": true, "schedulerEnabled": false, "trackingMode": 1, "odometer": 13558.8251953125, "isFirstBoot": false, "didLaunchInBackground": false, "didDeviceReboot": false } 10-19 11:50:59.110 INFO [LoggerFacade$a a] ╔═════════════════════════════════════════════ ║ DEVICE SENSORS ╠═════════════════════════════════════════════ ╟─ ✅ ACCELEROMETER: {Sensor name="ACCELEROMETER", vendor="icm40607_acc", version=1, type=1, maxRange=78.453606, resolution=0.0012, power=0.001, minDelay=5000} ╟─ ✅ GYROSCOPE: {Sensor name="GYROSCOPE", vendor="icm40607_gyro", version=1, type=4, maxRange=34.9063, resolution=0.0011, power=0.001, minDelay=5000} ╟─ ✅ MAGNETOMETER: {Sensor name="MAGNETOMETER", vendor="MTK", version=1, type=2, maxRange=4912.0503, resolution=0.15, power=0.001, minDelay=20000} ╟─ ✅ SIGNIFICANT_MOTION: {Sensor name="SIGNIFICANT_MOTION", vendor="MTK", version=1, type=17, maxRange=1.0, resolution=1.0, power=0.001, minDelay=-1} ╚═════════════════════════════════════════════ 10-19 11:50:59.112 DEBUG [LoggerFacade$a a] ℹ️ Load last odometer location: Location[TSLocationManager 45.821949,4.706833 hAcc=3.925 et=0 {Bundle[{odometer=13558.825}]}] 10-19 11:50:59.147 DEBUG [HttpService startMonitoringConnectivityChanges] 🎾 Start monitoring connectivity changes 10-19 11:50:59.194 INFO [TSProviderManager startMonitoring] 🎾 Start monitoring location-provider changes 10-19 11:50:59.195 DEBUG [HttpService a] ╔═════════════════════════════════════════════ ║ 📶 Connectivity change: connected? true ╠═════════════════════════════════════════════

10-19 11:50:59.210 INFO [TSLocationManager requestLocationUpdates] 🎾 Location-services: ON 10-19 11:50:59.241 DEBUG [TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1 10-19 11:50:59.256 INFO [TSGeofenceManager start] 🎾 Start monitoring geofences 10-19 11:50:59.288 DEBUG [TSConfig e] ℹ️ Persist config, dirty: [isMoving] 10-19 11:50:59.303 DEBUG [SQLiteLocationDAO prune] ℹ️ PRUNE -1 days 10-19 11:50:59.307 INFO [HeartbeatService start] 🎾 Start heartbeat (300s) 10-19 11:50:59.315 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 11:50:59.332 INFO [TSLocationManager d] 🔴 Location-services: OFF 10-19 11:50:59.338 INFO [TrackingService changePace] 🔵 setPace: true → false 10-19 11:50:59.381 INFO [TSLocationManager a] ╔═════════════════════════════════════════════ ║ motionchange LocationResult: 1 (249077ms old) ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.821949,4.706833 hAcc=3.925 et=+12d16h20m9s781ms alt=362.20001220703125 vAcc=12.408764 vel=0.9651481 sAcc=0.5 bear=84.99252 bAcc=15.8 {Bundle[{battery_level=0.9, is_charging=false, odometer=13558.825}]}], time: 1729331210302

10-19 11:50:59.448 DEBUG [TSLocationManager a] Median accuracy: 3.925 10-19 11:50:59.515 DEBUG [LocationAuthorization withPermission] ℹ️ LocationAuthorization: Permission granted 10-19 11:50:59.591 DEBUG [AbstractService a] 🎾 start [LocationRequestService startId: 1, eventCount: 1] 10-19 11:50:59.598 INFO [SingleLocationRequest startUpdatingLocation] 🔵 [SingleLocationRequest start, action: 1, requestId: 1] 10-19 11:50:59.604 DEBUG [AbstractService a] ⚙️︎ FINISH [LocationRequestService startId: 1, eventCount: 0, sticky: true] 10-19 11:51:01.658 DEBUG [AbstractService a] 🎾 1:1 [LocationRequestService startId: 2, eventCount: 1] 10-19 11:51:01.666 INFO [TSLocationManager a] ╔═════════════════════════════════════════════ ║ motionchange LocationResult: 1 (190ms old) ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.822313,4.708938 hAcc=3.7 et=+12d16h24m20s953ms alt=362.20001220703125 vAcc=14.920484 vel=0.69281614 sAcc=2.9 bear=19.0 bAcc=137.0], time: 1729331461474

10-19 11:51:01.672 INFO [TSLocationManager onSingleLocationResult] 🔵 Acquired motionchange position, isMoving: false 10-19 11:51:01.675 DEBUG [TSLocationManager a] Median accuracy: 3.8125 10-19 11:51:01.693 DEBUG [AbstractService b] 🎾 STOP [LocationRequestService startId: 3, eventCount: 2] 10-19 11:51:01.694 DEBUG [AbstractService a] ⚙️︎ FINISH [LocationRequestService startId: 3, eventCount: 1, sticky: false] 10-19 11:51:01.741 DEBUG [AbstractService a] ⚙️︎ FINISH [LocationRequestService startId: 2, eventCount: 0, sticky: false] 10-19 11:51:01.743 DEBUG [TSGeofenceManager startMonitoringStationaryRegion] 🎾 Start monitoring stationary region (radius: 150.0m 45.8223133,4.7089383 hAcc=3.7) 10-19 11:51:01.774 DEBUG [AbstractService a] 🎾 motionchange [TrackingService startId: 1, eventCount: 1] 10-19 11:51:01.778 INFO [TrackingService k] ╔═════════════════════════════════════════════ ║ TrackingService motionchange: false ╠═════════════════════════════════════════════

10-19 11:51:01.786 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 1, eventCount: 0, sticky: false] 10-19 11:51:01.951 DEBUG [AbstractService f] ⚙️︎ LocationRequestService.stopSelfResult(3): true 10-19 11:51:01.953 DEBUG [AbstractService onDestroy] 🔴 LocationRequestService stopped 10-19 11:51:01.997 DEBUG [AbstractService f] ⚙️︎ TrackingService.stopSelfResult(1): true 10-19 11:51:01.999 DEBUG [AbstractService onDestroy] 🔴 TrackingService stopped 10-19 11:56:40.575 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 11:56:40.579 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 11:56:40.586 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 12:01:41.262 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 12:01:41.266 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 12:01:41.272 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 12:02:01.650 DEBUG [LifecycleManager onStart] ☯️ onStart 10-19 12:02:01.656 DEBUG [LifecycleManager onResume] ☯️ onResume 10-19 12:02:04.098 DEBUG [TSConfig e] ℹ️ Persist config, dirty: [backgroundPermissionRationale, backgroundPermissionRationale.title, backgroundPermissionRationale.message, backgroundPermissionRationale.positiveAction, backgroundPermissionRationale.negativeAction, debug, desiredAccuracy, disableElasticity, extras, fastestLocationUpdateInterval, headers, headlessJobService, heartbeatInterval, logLevel, maxRecordsToPersist, notification, notification.title, notification.text, params, schedule, speedJumpFilter, stopAfterElapsedMinutes, stopOnTerminate, stopTimeout] 10-19 12:02:04.118 DEBUG [TSConfig e] ℹ️ Persist config, dirty: [backgroundPermissionRationale, backgroundPermissionRationale.title, backgroundPermissionRationale.message, backgroundPermissionRationale.positiveAction, backgroundPermissionRationale.negativeAction, debug, desiredAccuracy, disableElasticity, fastestLocationUpdateInterval, headlessJobService, heartbeatInterval, isMoving, logLevel, maxRecordsToPersist, notification, notification.title, notification.text, speedJumpFilter, stopAfterElapsedMinutes, stopOnTerminate, stopTimeout] 10-19 12:02:04.129 DEBUG [LocationAuthorization withBackgroundPermission] ℹ️ LocationAuthorization: Permission granted 10-19 12:02:04.134 DEBUG [HttpService startMonitoringConnectivityChanges] 🎾 Start monitoring connectivity changes 10-19 12:02:04.137 DEBUG [DeviceSettings startMonitoringPowerSaveChanges] 🎾 Start monitoring powersave changes 10-19 12:02:04.138 DEBUG [TSGeofenceManager$e run]

mbuttin commented 22 hours ago

My second case is : at 13:01, I stay stationnary long enough to fire the stop_timeout. I start to move physically around 13:05, but I have no detection of movements up to 13:36. So I should do something wrong when the plugin goes to "still" mode and only got heartbeat... Could you help me understand what's going on and what I should change ?

╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: STOP_TIMEOUT ╠═════════════════════════════════════════════

10-19 13:01:40.586 DEBUG [TSConfig e] ℹ️ Persist config, dirty: [isMoving] 10-19 13:01:40.600 INFO [HeartbeatService start] 🎾 Start heartbeat (300s) 10-19 13:01:40.605 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 13:01:40.618 INFO [TSLocationManager d] 🔴 Location-services: OFF 10-19 13:01:40.625 INFO [TrackingService changePace] 🔵 setPace: true → false 10-19 13:01:40.661 INFO [TSLocationManager a] ╔═════════════════════════════════════════════ ║ motionchange LocationResult: 4 (358ms old) ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.824047,4.713852 hAcc=1.6 et=+12d17h34m59s780ms alt=359.3 vAcc=4.7 vel=0.0 sAcc=0.9], time: 1729335700301

10-19 13:01:40.664 INFO [TSLocationManager onSingleLocationResult] 🔵 Acquired motionchange position, isMoving: false 10-19 13:01:40.666 DEBUG [TSLocationManager a] Median accuracy: 1.8 10-19 13:01:40.667 DEBUG [TSLocationManager c] Odometer: 15240.054 10-19 13:01:40.742 DEBUG [TSGeofenceManager startMonitoringStationaryRegion] 🎾 Start monitoring stationary region (radius: 150.0m 45.8240467,4.7138517 hAcc=1.6) 10-19 13:01:40.760 DEBUG [AbstractService a] 🎾 motionchange [TrackingService startId: 152, eventCount: 1] 10-19 13:01:40.760 INFO [TrackingService k] ╔═════════════════════════════════════════════ ║ TrackingService motionchange: false ╠═════════════════════════════════════════════

10-19 13:01:40.767 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 152, eventCount: 0, sticky: false] 10-19 13:01:40.975 DEBUG [AbstractService f] ⚙️︎ TrackingService.stopSelfResult(152): true 10-19 13:01:40.979 DEBUG [AbstractService onDestroy] 🔴 TrackingService stopped 10-19 13:06:40.614 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 13:06:40.618 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 13:06:40.625 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 13:11:41.269 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 13:11:41.273 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 13:11:41.279 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 13:16:42.267 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 13:16:42.271 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 13:16:42.280 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 13:21:40.548 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 13:21:40.553 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 13:21:40.559 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 13:26:42.272 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 13:26:42.276 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 13:26:42.282 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 13:31:41.272 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 13:31:41.278 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 13:31:41.285 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 13:36:42.265 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: HEARTBEAT ╠═════════════════════════════════════════════

10-19 13:36:42.270 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: HEARTBEAT in 300000ms (jobID: -1307475748) 10-19 13:36:42.279 DEBUG [HeartbeatService onHeartbeat] ❤️ 10-19 13:36:51.359 DEBUG [AbstractService a] 🎾 STATIONARY_GEOFENCE [GeofencingService startId: 1, eventCount: 1] 10-19 13:36:51.365 DEBUG [TSConfig e] ℹ️ Persist config, dirty: [isMoving] 10-19 13:36:51.370 INFO [HeartbeatService stop] 🔴 Stop heartbeat 10-19 13:36:51.372 INFO [TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: HEARTBEAT 10-19 13:36:51.376 DEBUG [TSGeofenceManager stopMonitoringStationaryRegion] 🔴 Stop monitoring stationary region 10-19 13:36:51.381 INFO [TrackingService changePace] 🔵 setPace: false → true 10-19 13:36:51.401 DEBUG [AbstractService a] 🎾 motionchange [TrackingService startId: 1, eventCount: 1] 10-19 13:36:51.402 INFO [TrackingService k] ╔═════════════════════════════════════════════ ║ TrackingService motionchange: true ╠═════════════════════════════════════════════

10-19 13:36:51.404 INFO [TSScheduleManager oneShot] ⏰ Oneshot STOP_AFTER_ELAPSED_MINUTES is already pending 10-19 13:36:51.405 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 1, eventCount: 0, sticky: true] 10-19 13:36:51.414 INFO [TSLocationManager a] ╔═════════════════════════════════════════════ ║ motionchange LocationResult: 5 (238201ms old) ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.827273,4.712661 hAcc=64.1 et=+12d18h6m12s690ms alt=335.20001220703125 vAcc=37.696053], time: 1729337573211

10-19 13:36:51.416 DEBUG [TSLocationManager a] Median accuracy: 1.8 10-19 13:36:51.424 DEBUG [LocationAuthorization withPermission] ℹ️ LocationAuthorization: Permission granted 10-19 13:36:51.440 INFO [GeofencingService b] ╔═════════════════════════════════════════════ ║ GeofencingService: Stationary geofence EXIT ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.827273,4.712661 hAcc=64.1 et=+12d18h6m12s690ms alt=335.20001220703125 vAcc=37.696053]

10-19 13:36:51.442 DEBUG [AbstractService a] ⚙️︎ FINISH [GeofencingService startId: 1, eventCount: 0, sticky: false] 10-19 13:36:51.470 DEBUG [AbstractService a] 🎾 start [LocationRequestService startId: 1, eventCount: 1] 10-19 13:36:51.472 INFO [SingleLocationRequest startUpdatingLocation] 🔵 [SingleLocationRequest start, action: 1, requestId: 5] 10-19 13:36:51.476 DEBUG [AbstractService a] ⚙️︎ FINISH [LocationRequestService startId: 1, eventCount: 0, sticky: true] 10-19 13:36:51.648 DEBUG [AbstractService f] ⚙️︎ GeofencingService.stopSelfResult(1): true 10-19 13:36:51.649 DEBUG [AbstractService onDestroy] 🔴 GeofencingService stopped

mbuttin commented 20 hours ago

And last subject for this field test : from 14:30 to 14:34, the gps location recorded did jumps far away from the location where the phone was, despite the "prevent jump" in the ready function. Is there any reason it did that ? Question : is it possible to have the same "prevent jump" for ios ? During my field test with an iphone, the gps location jumped a lot more than the android ones...

Here are the logs : 10-19 14:30:04.191 DEBUG [AbstractService a] 🎾 start [TrackingService startId: 502, eventCount: 1] 10-19 14:30:04.194 DEBUG [TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.825730,4.715996 hAcc=899.999 et=+2d23h42m22s768ms alt=338.0 vAcc=9.0] ╟─ Age: 106ms, time: 1729341004086

10-19 14:30:04.196 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════

10-19 14:30:04.198 DEBUG [TSLocationManager a] Median accuracy: 1.5 10-19 14:30:04.200 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 214120ms (jobID: -18513055) 10-19 14:30:04.204 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 502, eventCount: 0, sticky: true] 10-19 14:30:12.712 DEBUG [AbstractService a] 🎾 start [ActivityRecognitionService startId: 1, eventCount: 1] 10-19 14:30:12.715 DEBUG [ActivityRecognitionService a] *** wasMoving: true, nowMoving: false, startedMoving: false, justStopped; true 10-19 14:30:12.722 INFO [ActivityRecognitionService a] ╔═════════════════════════════════════════════ ║ Motion Transition Result ╠═════════════════════════════════════════════ ╟─ 🔴 EXIT: on_bicycle ╟─ 🎾 ENTER: still ╚═════════════════════════════════════════════ 10-19 14:30:12.723 DEBUG [AbstractService a] ⚙️︎ FINISH [ActivityRecognitionService startId: 1, eventCount: 0, sticky: false] 10-19 14:30:12.728 DEBUG [AbstractService a] 🎾 STOP_TIMEOUT [TrackingService startId: 503, eventCount: 1] 10-19 14:30:12.789 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: STOP_TIMEOUT in 600000ms (jobID: 2059034116) 10-19 14:30:12.792 WARN [TSScheduleManager oneShot] ℹ️ Scheduling exact alarms requires android.permission.USE_EXACT_ALARM with SDK >= 34. Oneshot using in-exact Alarm 10-19 14:30:12.800 INFO [TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: MOTION_ACTIVITY_CHECK 10-19 14:30:12.805 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 503, eventCount: 0, sticky: true] 10-19 14:30:12.940 DEBUG [AbstractService f] ⚙️︎ ActivityRecognitionService.stopSelfResult(1): true 10-19 14:30:12.943 DEBUG [AbstractService onDestroy] 🔴 ActivityRecognitionService stopped 10-19 14:30:34.415 DEBUG [AbstractService a] 🎾 start [TrackingService startId: 504, eventCount: 1] 10-19 14:30:34.419 DEBUG [TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.820265,4.704374 hAcc=899.999 et=+2d23h42m52s948ms alt=338.0 vAcc=9.0] ╟─ Age: 151ms, time: 1729341034267

10-19 14:30:34.420 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════

10-19 14:30:34.420 INFO [TrackingService b] ℹ️ Distance from stoppedAtLocation: -150.87805 10-19 14:30:34.421 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 504, eventCount: 0, sticky: true] 10-19 14:30:34.421 DEBUG [TSLocationManager d] Distance from last location: 1088.4325, apparent speed: 36.064697 10-19 14:30:34.422 DEBUG [TSLocationManager a] Median accuracy: 1.5 10-19 14:30:39.411 DEBUG [AbstractService a] 🎾 start [TrackingService startId: 505, eventCount: 1] 10-19 14:30:39.414 DEBUG [TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.826436,4.708415 hAcc=1140.976 et=+2d23h42m57s977ms alt=338.0 vAcc=9.0] ╟─ Age: 118ms, time: 1729341039296

10-19 14:30:39.415 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════

10-19 14:30:39.415 INFO [TrackingService b] ℹ️ Distance from stoppedAtLocation: -1146.213 10-19 14:30:39.416 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 505, eventCount: 0, sticky: true] 10-19 14:30:39.416 DEBUG [TSLocationManager a] Median accuracy: 1.5 10-19 14:30:59.577 DEBUG [AbstractService a] 🎾 start [TrackingService startId: 506, eventCount: 1] 10-19 14:30:59.578 DEBUG [TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.820265,4.704374 hAcc=899.999 et=+2d23h43m18s123ms alt=338.0 vAcc=9.0] ╟─ Age: 136ms, time: 1729341059442

10-19 14:30:59.579 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════

10-19 14:30:59.579 INFO [TrackingService b] ℹ️ Distance from stoppedAtLocation: -150.87805 10-19 14:30:59.580 DEBUG [TSLocationManager a] Median accuracy: 5.237 10-19 14:30:59.580 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 506, eventCount: 0, sticky: true] 10-19 14:31:09.638 DEBUG [AbstractService a] 🎾 start [TrackingService startId: 507, eventCount: 1] 10-19 14:31:09.640 DEBUG [TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.826436,4.708415 hAcc=1322.176 et=+2d23h43m28s177ms alt=338.0 vAcc=9.0] ╟─ Age: 144ms, time: 1729341069496

10-19 14:31:09.641 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════

10-19 14:31:09.641 INFO [TrackingService b] ℹ️ Distance from stoppedAtLocation: -1327.4131 10-19 14:31:09.641 DEBUG [TSLocationManager a] Median accuracy: 5.237 10-19 14:31:09.642 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 507, eventCount: 0, sticky: true] 10-19 14:31:13.091 DEBUG [AbstractService a] 🎾 start [ActivityRecognitionService startId: 1, eventCount: 1] 10-19 14:31:13.094 DEBUG [ActivityRecognitionService a] *** wasMoving: true, nowMoving: true, startedMoving: false, justStopped; false 10-19 14:31:13.096 INFO [ActivityRecognitionService a] ╔═════════════════════════════════════════════ ║ Motion Transition Result ╠═════════════════════════════════════════════ ╟─ 🔴 EXIT: still ╟─ 🎾 ENTER: on_bicycle ╚═════════════════════════════════════════════ 10-19 14:31:13.097 DEBUG [AbstractService a] ⚙️︎ FINISH [ActivityRecognitionService startId: 1, eventCount: 0, sticky: false] 10-19 14:31:13.098 INFO [TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: STOP_TIMEOUT 10-19 14:31:13.362 DEBUG [AbstractService f] ⚙️︎ ActivityRecognitionService.stopSelfResult(1): true 10-19 14:31:13.367 DEBUG [AbstractService onDestroy] 🔴 ActivityRecognitionService stopped 10-19 14:31:34.794 DEBUG [AbstractService a] 🎾 start [TrackingService startId: 508, eventCount: 1] 10-19 14:31:34.797 DEBUG [TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 45.825730,4.715996 hAcc=899.999 et=+2d23h43m53s353ms alt=338.0 vAcc=9.0] ╟─ Age: 125ms, time: 1729341094671

10-19 14:31:34.798 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════

10-19 14:31:34.799 DEBUG [TSLocationManager a] Median accuracy: 899.999 10-19 14:31:34.806 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 85176ms (jobID: -18513055) 10-19 14:31:34.815 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 508, eventCount: 0, sticky: true] 10-19 14:32:18.610 DEBUG [AbstractService a] 🎾 start [ActivityRecognitionService startId: 1, eventCount: 1] 10-19 14:32:18.612 DEBUG [ActivityRecognitionService a] *** wasMoving: true, nowMoving: false, startedMoving: false, justStopped; true

christocracy commented 15 hours ago

hAcc=899.999

These “jumps” are due to poor accuracy locations being returned by your device.

TrackingService stopped log (did nothing for that)

This is perfectly normal. That service stays active only when the device is in the “moving” state. That service is supposed to stop when the plug-in in the stationary state.

read the wiki “Philosophy of Operation”.

mbuttin commented 14 hours ago

hAcc=899.999

These “jumps” are due to poor accuracy locations being returned by your device.

That's what I was thinking. What's strange is that it appears only for this small amount of time, it works fine rest of the time. From your experience, is that normal to encounter brief periods of bad gps positionning ? (samsung phone on android).

I've seen that the plugin is able to take several gps location in order to have a more accurate prositionning (probably removing those "jumps"?). My app suscribed to onLocation events. Is it possible for the plugin to use several gps location to calculate a good position, but fire only once onLocation ? Or will it be fired on each of those several gps points ? I don't need the positionning to be fast, severall seconds are ok.

Thanks for support on sunday :)