artem78 / s60-gps-tracker-cli

GPS track recorder for Symbian OS (console version)
GNU General Public License v3.0
3 stars 0 forks source link

Wrong position update interval #4

Open artem78 opened 4 years ago

artem78 commented 4 years ago

The problem is that actual position update interval is different than have been set. For example, look at the listed log:

log_20200309_145837 txt

The blue numbers is the actual interval. As you can see in this example it is often in 2-3 times bigger than must be.

Full log file: log_20200309_145837.txt

artem78 commented 4 years ago

I spent a lot of time for experiments, logs analizing, etc... Finally I found and fixed main, but not the only one reason of this issue.

Until recently, as I discovered processing of each position took too much time (more than a second). Therefore with frequent update period (about 1-3 seconds) they do not have time to be processed. The main part of this time spent to write point to GPX file, because there are too many write operations with small pieces of data in undelying self-written XML writer class.

To fix this, I replaced RFile class with buffered RFileBuf in xml writer (artem78/s60-gps-tracker-cli@ea233e1a704a222a2b0b262033368077a924d54f) and also done the same operation in logger (artem78/s60-logger@29da7970def417a736c6badda29c6e5a5bc5cff0). After this writing became much faster. Now point processing takes not more than several tens of milliseconds and not slow down the program.

That`s nice, but two problems remained:

  1. Sometimes at 1 second update interval it`s one second higher than expected. 20200711_213205
  2. When update interval be changed, actual update interval for one second bigger than expected. I think, this may be due to that I set position update timeout value one second bigger than current update interval. 20200711_214425

Here is new log file: log_20200711_154128.txt and its analize report: log_20200711_154128 analize.txt