jonasoreland / runnerup

A open source run tracker
GNU General Public License v3.0
753 stars 275 forks source link

Wrong date on Galaxy S6 #1121

Closed Jbb2811 closed 1 year ago

Jbb2811 commented 2 years ago

Hi, I am using runnerup on my old Samsung Galaxy S6. It is really a nice app, but since the beginning of September I have wrong dates in tcx files:

It could be easily fixed in the code.

Thanks,

Capture d’écran_2022-09-14_22-20-33

gerhardol commented 2 years ago

It could be easily fixed in the code.

What did you have in mind? If time is before 2022, add certain time? How much exactly? How to ensure the bad time is not another issue?

Jbb2811 commented 2 years ago

I thought something like:

  1. if (gpstime - systemtime) ~= 7168 days: add 7168 days to gps time
  2. if gpstime < 6april2019 : add 7168 days to gps time ( 6april2019 = last GPS week rollover) or simplier and safer:
  3. add an setting option : "use system time instead of GPS Time (can fix some old GPS issues)"

Anyway, not many of RunnerUp users should still have a Galaxy S6, and I won't keep mine for years. I may be the only one having this problem. So don't waste to much time on it until others users claim for it.

manualbashing commented 2 years ago

I am seeing what I take to be the same issue on my Galaxy S20. Since August all timestamps for my tracked activities are set to January 2003:

image

gerhardol commented 2 years ago

An S20 with bad firmware too... With the number of S20 Samsung has produced they should have some quality control...

The solution is probably regardless to use the system time instead of the GPS time, with a setting (maybe default).

RickvanderS commented 2 years ago

Just want to add that I am also experiencing this with Galaxy S7. A workaround with a feasibility check using system time would be appreciated.

gerhardol commented 2 years ago

Plan to chang this in #1114

zarandya commented 1 year ago

I'm also impacted by this and I have a modern device, and not a Samsung. It was still correct in last September but since the start of 2023 I'm also getting incorrect timestamps in TCX files. The time difference is the same, 7168 days.

Also impacts Strava uploads.

RickvanderS commented 1 year ago

I am still having the same issue in v2.5.2.0. The option "Time from GPS points" is turned off.

berdosi commented 1 year ago

tl;dr; The issue might be solved by removing the SIM card, starting the phone, and checking the GPS (afterwards, the card can be inserted anew)

The issue is not with RunnerUp, since GPSTest also shows the date to be off by 7*1024 days.

GPSTest also sent me to this link (and the second one below has been found separately): https://github.com/barbeau/gpstest/blob/master/FAQ.md#why-is-my-gps-time-wrong https://wheelercat.com/gps-1024-explained/ , which can be summarized as follows: GPS transmits time as the number of the week since 1980, and the number of seconds passed within in the week. As the number of the week is stored as a 10 bit number, so it has already overflown, twice.

Based on Fairphone's user support forum, the issue can as well be related to the SIM card, which gave me the idea to just remove the SIM and insert it again.

Since it is solved by fiddling with the SIM card, the issue might be with the cache received from the A-GPS server ran by the network operator. Reinserting the card might trigger the phone to download a fresh set of data.

gerhardol commented 1 year ago

If Time from GPS points is not set, the time should be overridden.

While I have no phone with this behavior, I have tried to simulate it. The setting worked for me, but a real life scenario could be different. I do not see any obvious issues in the code. However, I am currently removing support for Android before 5.0, as this release is no longer available in Play (f-droid version had to update even before). With this some strange workarounds (from before I was involved) can be removed, the logic is cleaner. In best case, this is added as a Play beta (2.6.0 or so) in some days. If it still does not work with the update, there is something else with the Android versions. (Later.)

berdosi commented 1 year ago

If Time from GPS points is not set, the time should be overridden.

This setting doesn't appear to work for me: I set my phone's clock back by 1 hour, but despite the above being unchecked, the TCX file contains the "correct" time (presumably from GPS).

(Android 12, RunnerUp v2.5.2.0 (F-Droid))

gerhardol commented 1 year ago

1156 has a fix