Tigge / antfs-cli

Extracts FIT files from ANT-FS based sport watches such as Garmin Forerunner 60, 405CX, 310XT, 610 and 910XT.
MIT License
311 stars 76 forks source link

Incorrect dates in file index #16

Open Tigge opened 12 years ago

Tigge commented 12 years ago

The dates of the files in the index seems to be incorrect. Newer files seem to be more correct then older ones, and after a while my old files just seem to be from the same date. This is of course not correct and should be investigated.

The date inside of the FIT files are still correct.

(CC @rkistner)

christofferholmstedt commented 12 years ago

I have the same issue. Cut-off date is the 29th of may 2012. I'm not sure but that might be the day I upgraded my Garmin Forerunner 610 firmware to 2.70...had 2.40 before.

On the 29th of may I have several activities between 08:31:58 and 08:35:26. 2 or 4 seconds between each activity.

christofferholmstedt commented 11 years ago

Just got home from my winter vacation and I think all of my runs (not just the once from this vacation) on my watch are being downloaded again but now with a timestamp from the 22th of december 2012. I'll update this when I have downloaded all 146 of them. (At least Garmin-extractor is really stable now, no crashes but alot slower).

Using the d6f119e commit.

Any idea what could cause this and where I can start trying to find the fault?

amcnabb commented 11 years ago

I'm having what seems to be the same problem. I'm getting dates that show up in the 1989-12-30 through 1990-01-01. If I upload it to the Garmin Connect web site, it shows the right dates, but Endomondo gives the wrong dates. I'm happy to share any logs or example files that might be helpful.

potomak commented 11 years ago

I have the same issue with a Garmin Swim.

potomak commented 11 years ago

I fixed the bug empirically, but this is only a dirty hack to push who really knows how the protocol works (@Tigge) to fix this bug.

File names are built using file_date attribute, see https://github.com/Tigge/Garmin-Forerunner-610-Extractor/blob/master/garmin.py#L157-160

file_date attribute is a datetime object built at https://github.com/Tigge/Garmin-Forerunner-610-Extractor/blob/master/ant/fs/file.py#L103 using the expression:

file_date  = datetime.datetime.fromtimestamp(file_date + 631065600)

I know exact dates of my workout sessions so I empirically extracted a working constant:

>>> import datetime
>>> import time
>>> real_workout_ts = time.mktime(datetime.datetime(2013, 6, 20, 19, 6).timetuple())
>>> real_workout_ts
1371747960.0
>>> wrong_workout_ts = time.mktime(datetime.datetime(1990, 1, 15, 11, 27).timetuple())
>>> wrong_workout_ts
632399220.0
>>> real_workout_ts - (wrong_workout_ts - 631065600)
1370414340.0

My last session was at 20th June 2013 at 7:06 PM and I compared it to the youngest file in the list dated at 15th January 1990 at 11:27 AM.

I changed the constant 631065600 with 1370414340 from the empirical result and now file names seem right.

interskh commented 10 years ago

Hmm this seems to happen to my 310xt as well.. All the old files are in wrong date but newer files are fine.

pszypowicz commented 10 years ago

garmin 910xt, happening to me as well

waltersom commented 9 years ago

I realise this hasn't been touched for a while, but I have had this problem* happen to me on several occasions. I thought maybe something had gotten corrupted, but now I think the common factor is the time zone has changed just before each problem. That is, I moved from New Zealand to England, or changed from eg NZDT to NZST, or BST to GMT.

*by problem, I mean antfs-cli redownloads all files on the watch, but the filenames have the current time (or maybe the time of the latest file), not the time from when those activities were recorded.

My watch is a Forerunner 610. I am assuming it's the same issue, judging by the other comments, but if not I'll raise another issue.