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

Background geolocation sending few location after walking indoor #1840

Closed superyarik closed 5 months ago

superyarik commented 1 year ago

Your Environment

Expected Behavior

Background geolocation works similar on all trip

Actual Behavior

after mall walking it starts in 10 minutes after start driving(please take a look at 21:25:26.802 walking->in_vehicle and only and only in 21:38:12.832 new location was inserted, Distance from last location: 12157)

Steps to Reproduce

start app with listed config on samsung s9, go to mall(no gps inside)

Context

maybe i need to edit config to prevent this situation?

Debug logs

background-geolocation.log

Maps with great track on the way in and weak on the way out

in out
christocracy commented 1 year ago

I have no idea. There is no config option responsible for that.

superyarik commented 1 year ago

@christocracy please take a look, 2 hours i was inside building, but no state change fired, also 2 hours losted in logs 17:34:28.898 -> 18:24:58.510 18:25:06.369 -> 19:26:02.855

Logs ``` ✅ INSERT: 5ceb6052-8020-4396-bacf-36a31d685674 10-07 17:26:44.945 DEBUG [HeadlessTask$2 onHeadlessJsTaskFinish] taskId: 654 10-07 17:27:44.931 INFO [ScheduleEvent a] ╔═════════════════════════════════════════════ ║ ⏰ OneShot event fired: MOTION_ACTIVITY_CHECK ╠═════════════════════════════════════════════ 10-07 17:27:44.933 INFO [ActivityRecognitionService start] 🎾 Start motion-activity updates 10-07 17:27:45.936 DEBUG [AbstractService a] 🎾 START [ActivityRecognitionService startId: 1, eventCount: 1] 10-07 17:27:45.939 DEBUG [ActivityRecognitionService a] 🚘 ️DetectedActivity [type=IN_VEHICLE, confidence=96] 10-07 17:27:45.942 DEBUG [AbstractService a] ⚙️︎ FINISH [ActivityRecognitionService startId: 1, eventCount: 0, sticky: false] 10-07 17:27:45.968 DEBUG [AbstractService a] 🎾 START [ActivityRecognitionService startId: 2, eventCount: 1] 10-07 17:27:45.969 DEBUG [ActivityRecognitionService a] *** wasMoving: true, nowMoving: true, startedMoving: false, justStopped; false 10-07 17:27:45.969 DEBUG [HeadlessTask onHeadlessEvent] 💀 event: activitychange 10-07 17:27:45.969 INFO [ActivityRecognitionService a] ╔═════════════════════════════════════════════ ║ Motion Transition Result ╠═════════════════════════════════════════════ ╟─ 🎾 ENTER: in_vehicle ╚═════════════════════════════════════════════ 10-07 17:27:45.970 DEBUG [AbstractService a] ⚙️︎ FINISH [ActivityRecognitionService startId: 2, eventCount: 0, sticky: false] 10-07 17:27:45.970 DEBUG [HeadlessTask$2 onHeadlessJsTaskStart] taskId: 655 10-07 17:27:45.972 DEBUG [HeadlessTask$2 onHeadlessJsTaskFinish] taskId: 655 10-07 17:27:46.174 DEBUG [AbstractService f] ⚙️︎ ActivityRecognitionService.stopSelfResult(2): true 10-07 17:27:46.176 DEBUG [AbstractService onDestroy] 🔴 ActivityRecognitionService stopped 10-07 17:34:27.277 DEBUG [AbstractService a] 🎾 START [TrackingService startId: 599, eventCount: 1] 10-07 17:34:27.279 INFO [TrackingService b] ℹ️ Location availability: false 10-07 17:34:27.281 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 599, eventCount: 0, sticky: true] 10-07 17:34:28.897 DEBUG [AbstractService a] 🎾 START [TrackingService startId: 600, eventCount: 1] 10-07 17:34:28.898 INFO [TrackingService b] ℹ️ Location availability: true 10-07 17:34:28.898 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 600, eventCount: 0, sticky: true] 10-07 18:24:58.510 DEBUG [HttpService a] ╔═════════════════════════════════════════════ ║ 📶 Connectivity change: connected? false ╠═════════════════════════════════════════════ 10-07 18:24:58.513 DEBUG [HeadlessTask onHeadlessEvent] 💀 event: connectivitychange 10-07 18:24:58.517 DEBUG [HeadlessTask$2 onHeadlessJsTaskStart] taskId: 656 10-07 18:24:58.523 DEBUG [HeadlessTask$2 onHeadlessJsTaskFinish] taskId: 656 10-07 18:25:05.355 DEBUG [HttpService a] ╔═════════════════════════════════════════════ ║ 📶 Connectivity change: connected? true ╠═════════════════════════════════════════════ 10-07 18:25:05.359 DEBUG [HeadlessTask onHeadlessEvent] 💀 event: connectivitychange 10-07 18:25:05.362 DEBUG [HeadlessTask$2 onHeadlessJsTaskStart] taskId: 657 10-07 18:25:05.363 DEBUG [HeadlessTask$2 onHeadlessJsTaskFinish] taskId: 657 10-07 18:25:06.369 INFO [HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 19) ╠═════════════════════════════════════════════ 10-07 19:26:02.855 DEBUG [AbstractService a] 🎾 START [TrackingService startId: 601, eventCount: 1] 10-07 19:26:02.860 DEBUG [TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 59.715251,30.427824 hAcc=6.284 et=+7d1h19m38s495ms alt=49.80000305175781 vAcc=0.8766898 vel=4.6298776 sAcc=0.36055514 bear=31.000027 bAcc=4.295448] ╟─ Age: 49ms, time: 1696695962809 10-07 19:26:02.862 DEBUG [TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════ 10-07 19:26:02.863 INFO [TSLocationManager onLocationResult] 🔵 Re-scaled distanceFilter: 150.0->100.0) 10-07 19:26:02.863 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 300000ms (jobID: -18513055) 10-07 19:26:02.865 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 601, eventCount: 0, sticky: true] 10-07 19:26:02.867 DEBUG [TSLocationManager d] Distance from last location: 153.64734, apparent speed: 0.021465184 10-07 19:26:02.868 DEBUG [TSLocationManager a] Median accuracy: 3.9 10-07 19:26:02.869 DEBUG [TSLocationManager c] Odometer: 95409.195 10-07 19:26:02.882 DEBUG [HeadlessTask onHeadlessEvent] 💀 event: location 10-07 19:26:02.885 DEBUG [HeadlessTask$2 onHeadlessJsTaskStart] taskId: 658 10-07 19:26:02.891 DEBUG [HeadlessTask$2 onHeadlessJsTaskFinish] taskId: 658 10-07 19:26:02.945 DEBUG [AbstractService a] 🎾 START [TrackingService startId: 602, eventCount: 1] 10-07 19:26:02.946 DEBUG [TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 59.715251,30.427824 hAcc=6.284 et=+7d1h19m38s495ms alt=49.80000305175781 vAcc=0.8766898 vel=4.6298776 sAcc=0.36055514 bear=31.000027 bAcc=4.295448] ╟─ Age: 136ms, time: 1696695962809 10-07 19:26:02.947 INFO [TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: MOTION_ACTIVITY_CHECK 10-07 19:26:02.949 INFO [TSScheduleManager oneShot] ⏰ Scheduled OneShot: MOTION_ACTIVITY_CHECK in 60000ms (jobID: -18513055) 10-07 19:26:02.951 DEBUG [AbstractService a] ⚙️︎ FINISH [TrackingService startId: 602, eventCount: 0, sticky: true] 10-07 19:26:02.952 INFO [SQLiteLocationDAO persist] ✅ INSERT: 37045e19-ba11-4cf9-8b72-2d30ed449b8c ```
christocracy commented 1 year ago

See https://dontkillmyapp.com.

The OS is responsible for firing events from the motion api.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 5 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.