Perusal, Synthesis, Bliss

June 30, 2021: corrupted file on a Garmin GPS watch (Forerunner 35)

I use Turtle Sport as software to fetch GPS data on my watch. It works nicely but today I have experienced a problem when clicking on the icon to fetch sport activities on the watch
turtle_sport_fetch_files_icon.png
Indeed the hour glass "turns forever" instead of listing the activities on the watch. Starting Turtle Sport in a console allows to know more about that:
fr.turtlesport.UsbProtocolException: Couldn’t detect a GPS       device.
        at fr.turtlesport.UsbProtocol.init(Native Method)
        at fr.turtlesport.device.garmin.GarminUsbDevice.<init>(GarminUsbDevice.java:46)
        at fr.turtlesport.device.garmin.GarminUsbDevice.init(GarminUsbDevice.java:77)
        at fr.turtlesport.device.garmin.GarminDevices.list(GarminDevices.java:33)
        at fr.turtlesport.device.Devices.list(Devices.java:25)
        at fr.turtlesport.ui.swing.MainGui$RetreiveAction$1.construct(MainGui.java:1604)
        at fr.turtlesport.ui.swing.SwingWorker$2.run(SwingWorker.java:108)
        at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-5" com.garmin.fit.FitRuntimeException: FIT decode error: Endian 59 not supported. Error at byte: 14528
        at com.garmin.fit.Decode.read(Decode.java:762)
        at com.garmin.fit.Decode.resume(Decode.java:365)
        at com.garmin.fit.Decode.read(Decode.java:344)
        at com.garmin.fit.Decode.read(Decode.java:339)
        at fr.turtlesport.geo.garmin.fit.FitFile.retreiveDate(FitFile.java:111)
        at fr.turtlesport.device.garmin.GarminFitDevice.isFitAlreadyImport(GarminFitDevice.java:135)
        at fr.turtlesport.device.garmin.GarminFitDevice.getNewFitFiles(GarminFitDevice.java:109)
        at fr.turtlesport.device.garmin.GarminFitDevice.getNewFiles(GarminFitDevice.java:49)
        at fr.turtlesport.ui.swing.MainGui$RetreiveAction$1.construct(MainGui.java:1630)
        at fr.turtlesport.ui.swing.SwingWorker$2.run(SwingWorker.java:108)
        at java.lang.Thread.run(Thread.java:748)
To solve this problem I have found the corrupted activity file (ending with a ".FIT" extension in the "ACTIVITY" directory at the root of the watch file system) by a trial-and-error procedure: restart Turtle Sport after moving one of them at a safe place, one after the other until it works correctly:
$ cd /run/media/jscordi/GARMIN/GARMIN/ACTIVITY
$ ls -l
total 479K
-rw-r--r-- 1 jscordi users  12K 2021-06-23 20:19 B6NI0340.FIT
-rw-r--r-- 1 jscordi users 162K 2021-06-25 20:20 B6PG1307.FIT
-rw-r--r-- 1 jscordi users  59K 2021-06-28 20:57 B6SI1521.FIT
-rw-r--r-- 1 jscordi users  70K 2021-06-29 21:27 B6TI3511.FIT
-rw-r--r-- 1 jscordi users 178K 2021-06-30 17:47 B6UD2720.FIT
One of these files was corrupted; I just removed it to solve the problem; of course the data inside was lost, I have not tried to repair it.