Closed tushaagit closed 1 year ago
What you are likely experiencing here is a user walking around a home / office, where the Android MotionActivity API keeps triggering into the "moving" state. The plugin will not return to the "stationary" state until the MotionaActivity API reports the device is still
, when the plugin initiates the stopTimeout
timer (which you've configured to 10 minutes.).
Once the stopTimeout
timer is engaged, it will be cancelled if the MotionActivity
api reports any movement (eg: on_foot
). Only after the stopTimeout
timer expires will the plugin return to the "stationary" state and turn off location-services.
You can add a Config.motionTriggerDelay
(eg: 30000
ms) to help decrease spurious motion-triggers while walking around a house.
foregroundService: true,
Btw, this old Config option is no longer used. You can delete it.
Ok, Sir will delete that option, but if we are setting options: distanceFilter: 50 and stationaryRadius: 25, then ideally it should not record that many locations in a span of 2 hrs even though a little movement on foot is recorded, as user is somewhere in the lift for its maintenance, and there is not much scope for the movement which can exceed 25/50 meters.
It’s not easy to perform distance calculations indoors, where location accuracy is typically 40-60 meters, much greater than your configured stationaryRadius: 25.
No, infact we don't want to calculate the distance travelled, while user is in the premises, thats why we have applied distance filter of 50 meters, as user will be majorly working on maintenance of lifts where movement is minimal, we want to keep the location updates as minimum as possible while user is in any premises, and whenever user starts moving again .i.e leaving the premises, then again we want to track his travel. 2 major issues we are facing right now are: 1] Eventhough user is not moving much i.e beyond 25/50 meter still lot of locations gets uploaded, 2] while user is stationary, the locations captured are inaccurate in premises, i.e locations differ by nearly 1 km or so, and because of this, system considers that the user has travelled that much of distance e.g: 1km for each inaccurate location, so if 25 inaccurate locations are captured then odometer increases by 25 km, which is another major issue which we are facing currently. If user has actually travelled by vehicle suppose a distance of 10 km from his home to premise and returns back to his home 10km, so total odometer km should be something around 20, but as it considers inaccurate locations (whose odometer calculation has gone upto 25km, it sums up that with the to-and fro commuting km value (i.e 20km). So total distance travelled comes as 45. Hopefully you got my point.
No, infact we don't want to calculate the distance travelled, while user is in the premises, thats why we have applied distance filter of 50 meters,
It doesn't matter. When the Motion API detects movement while in the stationary state, location-services are currently OFF and the plugin has no idea where the device is. When movement is detected, the plugin then turns on location-services, records the motionchange location, fires the onMotionChange
event. Now the plugin is in the moving state where location-services are ON.
Simply configure an appropriate Config.motionTriggerDelay
to reduce these "false positive" motion-changes.
Ok Sir, but what about sudden spikes i.e inaccurate locations captured in premises, that can also ignored, but the issue is it increases the odometer value also along with every false location captured by 500 - 700 meter,
See api docs Config.desiredOdometerAccuracy
Sir, Desired odometer accuracy is set to 10 meters, added motion trigger delay of 30 secs, removed foreground service parameter, increased distance filter to 100 meters from 50 meters, With all above changes, most of the time locations are not recorded, only first few points and last few are getting recorded now, so map shows a straight line from start to end, also km not incrementing. Please guide. Also check the attached log and map image
What range of timestamps are you interested in within your logs?
Sir as per the date displayed on map .i.e track of 3rd february (03/02/2023), very few points are captured in this route. especially from 02-03 20:50:22.006 time onwards straight line is coming, no points plotted in between i.e from 02-03 20:50:22.006 till 02-03 21:00:02.213. Also if you observe the whole day's log, odometer km captured is 0 km. i cant see the incrementOdometer value anywhere, please guide, this is affecting our customers faith in the app.
Sir, Please reply, we are getting numerous calls from different technicians, located at different sites, using this tracking feature, every 5-6 technicians out of 10 reported either path issue (i.e locations not recording correctly or records for some period of time then stops recording) OR odometer inaccuracy related issues, which are of course interdependent (location tracking and respective odometer values). This is affecting the faith of the technicians in our app. Please look into it and suggest the solution. I have many logs with me, but just sticking to above log, so that it would not add the confusion. Also i am creating a separate thread where we installed your cordova BG Geo demo app from playstore and our 2-3 person used that app, and faced similar kind of issues.
Hello Sir, referring to the original topic (BG Geolocation keeps on tracking/sending locations continuously even when user/device is still or within the specified distance filter) We are facing such issues every time and again for different devices, just to repoen the discussion i am sending another log, Here too many points (locations) got plotted/uploaded to server, even though user/device was still/sitting in the office, Please observe the log from 03-15 12:53:56.595 to 03-15 13:01:02.350, odometer incremented by nearly 4kms, Please let us know what changes/corrections can be done to avoid such issues
The plugin uses the Motion API to learn when the device is moving. When the device is detected to be moving, the plugin turns on location-services and begins tracking location. When the motion API reports the device is no longer moving, the plugin initiates the Config.stopTimeout
timer. When stopTimeout
timer expires, the plugin turns off location-services and returns to the stationary state. See the wiki Philosophy of Operation.
Yes, if you get up from your desk to go to the washroom, the plugin can trigger location tracking for a short period.
See Config.motionTriggerDelay
to help prevent these short movements throughout one's home/office from triggering location-tracking.
Sir, already applied motionTriggerDelay: 30000, as per your previous suggestion in this thread, also if employee moves just 10-50 meteres, and still his location gets recorded then what is the use of distanceFilter (100mtr) and stationary radius(70 mtr)? Also even if we do agree that motion is detected even for a small movement of 10-50 metres, still if we sum up the total distance travelled by employee in office for 1 hr, it will be hardly 200-300 mteres, then if we go by distance filter, for every 100 mtr, 1 location will be feteched, then max locations fetched should be in limit say (10-15 max), here i am showing you the log, where lot of points are plotted (120-150 locations) eventhough all parameters/filters exist to restrict the indoor movement. This issue is coming continuously for nearly all users, Please this is a request don't close the thresd, and try guide us to resolved our problem, this is affecting the clients trust in us and in turn the plugin used also.
You are free to completely disable motion api triggering with Config.disableMotionActivityUpdates.
Then the plug-in will only use a geofence around the last known position to know when the device is moving and only stationaryRadius will apply.
Hello Sir, added this parameter to disableMotionActivityUpdates:true, to config, as per your suggestion, still we are getting lot of locations (today getting 3-4 locations every minute) even when user/device is still or within the specified distance filter (100) Please check and guide us to some solution. This issue is getting escalated, please help. Attaching todays log, Can check for any particular time period eg: 03-17 15:00:00.755 To 03-17 16:05:45.379.
Your problem is not caused by the plug-in.
YOU are clearly calling .getCurrentPosition()
repeatedly in your own code.
yes Sir that we do call after some point of interval, but its there since 1 year now, we do it to check if gps setting is kept off by the user, if yes, we ask him to enable it before doing any further activity in app. So Don't why this is affecting our regular transistor URL recording interval now. Because as we are already setting 100 meter distance filter and 75 stationary radius, motionTriggerDelay: 30000, and disableMotionActivityUpdates:true, so expected is, though the location is fetched, it should not get stored to sqlite DB neither it should get uploaded to provided URL. This is happening since last 2-3 days only
(today getting 3-4 locations every minute)
Your logs clearly show .getCurrentPosition()
being called repeatedly.
Disable your call to .getCurrentPosition()
and investigate your Timer code.
BG Geolocation keeps on tracking/sending locations continuously even when user/device is still
Your Environment
Plugin version: 4.8
Platform: Android
OS version: 11
Device manufacturer / model: samsung SM-A307FN
Cordova version (
cordova -v
): 11.0.0Cordova platform version (
cordova platform ls
): Installed platforms: android 11.0.0 ios 6.2.0 Available platforms: browser ^6.0.0 electron ^3.0.0 windows ^7.0.0Plugin config provided to
#ready
:bgGeo.setConfig({ url: window.app.config.serviceServicePath + 'RecordUserGeoLocation', params: { "EmployeeID": empID, "UserID": userID, "UserName": userName, "Remarks": "Transistorsoft Recording", "AttendanceID": localStorage.getItem("AttendanceID"), } }