Android Client missing updates

andi6 years ago

From time to time my Android client is having gaps seen in the chart of updates. For example if I select altitude, or any other persistent chart parameters to visualize on the server, I can see that are blank periods of an hour or less, or more.
The Traccar client is not crashed or stopped during that time and begins updating again without any intervention from me.
I would like to contribute on solving this with my phone logs or whatever is needed, but I need advice what to look for, and how to I enable or find the logs.

Another issue I observed is that when the weather is bad, or when inside buildings, probably because GPS is hard to lock or precision is bad, I have positioning errors. Is the android client able to switch from GPS location to cell tower location or wifi in case GPS fails? Can I enable this sort of fallback to the less accurate (towers and wifi) in care GPS signal is bad or missing?
Is the Client able to forcefully reenable GPS location if other app disables it?
If the client has root access and necessary permissions can it keep itself alive, keep gps enabled, wifi enabled, and data enabled?

Anton Tananaev6 years ago

GPS does work indoors. Sometimes you can get weak reflected signal, but it general it just doesn't work. GPS needs clear sky visibility to get a good signal. Traccar Client already has a fallback to cell and wifi location.

No app can enable or disable GPS location. Only user can do it from Android settings. With root access it might be possible, but regular apps can't do it.

andi6 years ago

So what could be the causes for periods when it does not report anything and later resuming? In events it logs "Device status is unknown" and later on it reports "Device is online" and starts reporting location again.
I was thinking:

  1. device/app cannot determine location and no updates are sent anymore.
    or
  2. internet connection on the phone is not working - But once internet is available shouldn't all the location reports missed during the offline period be sent to the server?
    or
  3. app was forcefully closed by the system or by other memory cleaning/battery saving app - But then how it heals/restarts later without user intervention?
    or
  4. some bug in the app halting it's reporting for a while.

Is there a way I can troubleshoot and pinpoint the fault?

Thank you

Anton Tananaev6 years ago
  1. Possible.
  2. Only connected it should upload old data.
  3. Very unlikely, but I think it's potentially possible.
  4. Also unlikely. App is used by thousands of people and bugs like this would be identified very quickly.
andi6 years ago
  1. But even if gps cannot lock, then it should fall back to cell towers or wifi. I know for sure that are lots of wifi in the building that could locate the device, and the phone does not loose network, so cell tower should provide location.
    Device has frequency set to 300s this means that every 5 minutes should send an update with or without location data. For example update should contain other parameters like battery level. But if I look at battery level chart there is no update/data during periods when location is missing too.
  2. no data is uploaded to server for the inactive time after device starts to be online again.
  3. If the program is closed, how it re-spawns by itself? How can i check/log locally traccar client status?
    When I look into traccar serve sometimes I see the client with status unknown and last update more then 30 minutes ago, even if the traccar client is set to 300s frequency.
Anton Tananaev6 years ago

It's all just guesses. If you want to know what really happens you need to get Android system logs and see.

andi6 years ago

Can you recommend a tool to save the android log, preferably with a filter to only capture what could affect traccar app?. I checked real time android logs (tools like tail) and I think a day of logs will be huge and very hard to search.
Looking real time at the logs will not help, because interaction with the phone will affect the outcome(will not close the display, and so on).

I reinstalled the app and used following settings:
Frequency: 600s
Distance: tried 7m, then 5, then reduced to 4
Angle: tried 45 then reduced to 30

My intention is that app to send less updates to server if not moving and to send many location updates(route/path) when device starts to move.
With the above settings while moving the updates are sent with a rate of an update every few hundred meters while driving slowly instead of on update every 7 meter or direction change(angle) update.

Can you advise why is not updating based on distance and angle?

Anton Tananaev6 years ago

For getting logs I would recommend Android Studio and Android SDK tools.

Have you configured high accuracy? Is GPS location fixed?

andi6 years ago

I don't know how to use Android Studio or Android SDK tools on a real phone, used without connection to pc.

I first tried to use low accuracy and then changed to medium accuracy to spare the battery when the phone is not moving. Cell tower and wifi should locate it on a 4G network more precise than hundreds of meters. I used 4G cell towers location for navigation and was precise.

Anton Tananaev6 years ago

Angle will never work with cell/wifi location because it's always zero.

As for distance, you are very optimistic about quality of location. You can barely get 7 meters with GPS. You will never get anything close to that accuracy with cell/wifi.

andi6 years ago

Now with medium accuracy I have location reported with accuracy ranging from 0.02 km to 0.10 km. This is location based on cell towers only because is in traffic in area where are no wifi APs. At least this is logged in Traccar server.
Indeed I see all points are pointing north so no angle is reported in medium accuracy.

I will try to reduce even more the update interval to 30min or one hour, to spare the battery and increase accuracy to maximum.