All Projects → mrihtar → Garmin-FIT

mrihtar / Garmin-FIT

Licence: other
Perl code for reading and conversion of Garmin FIT binary files

Programming Languages

perl
6916 projects

Projects that are alternatives of or similar to Garmin-FIT

garmin-connect-export
Downloads gpx, tcx or original fit files from your Garmin Connect Account.
Stars: ✭ 42 (-36.36%)
Mutual labels:  gpx, garmin, fit
peloton-to-garmin
Convert workout data from Peloton into JSON/TCX/FIT files that can be uploaded to Garmin Connect
Stars: ✭ 121 (+83.33%)
Mutual labels:  garmin, fit
FITfileR
R package for reading data from FIT files using only native R code, rather than relying on external libraries.
Stars: ✭ 33 (-50%)
Mutual labels:  garmin, fit
fitparse-rs
Rust library to parse FIT formatted files
Stars: ✭ 20 (-69.7%)
Mutual labels:  garmin, fit
fit-parser
Parse your FIT files easily, directly from JS (Garmin, Polar, Suunto)
Stars: ✭ 43 (-34.85%)
Mutual labels:  garmin, fit
FitFileParser
This provide a swift package to parse Fit File and have access to the information in swift.
Stars: ✭ 21 (-68.18%)
Mutual labels:  garmin, fit
xavc rtmd2srt
Extract real time meta-data and GPS tracks from Sony XAVC video
Stars: ✭ 29 (-56.06%)
Mutual labels:  gpx
rayshaderanimate
Animate GPX data on a 3D map
Stars: ✭ 27 (-59.09%)
Mutual labels:  gpx
iOS-Geofence-Demo
Setup Geofences and get notifications when the device enters or leaves the geofence.
Stars: ✭ 71 (+7.58%)
Mutual labels:  gpx
gpx-converter
python package for manipulating gpx files and easily converting gpx to other different formats
Stars: ✭ 54 (-18.18%)
Mutual labels:  gpx
GpsPrune
GpsPrune is a map-based application for viewing, editing and converting coordinate data from GPS systems.
Stars: ✭ 46 (-30.3%)
Mutual labels:  gpx
gpxstudio.github.io
The online GPX file editor
Stars: ✭ 233 (+253.03%)
Mutual labels:  gpx
gpx-interpolate
Python function to interpolate GPX data using piecewise cubic Hermite splines
Stars: ✭ 35 (-46.97%)
Mutual labels:  gpx
d3.gpx
A lightweight GPS track viewer for GPX files
Stars: ✭ 26 (-60.61%)
Mutual labels:  gpx
django-for-runners
Store your GPX tracks of your running (or other sports activity) in django.
Stars: ✭ 49 (-25.76%)
Mutual labels:  gpx
gpx-builder
Builder of GPX files
Stars: ✭ 25 (-62.12%)
Mutual labels:  gpx
togeojson
convert KML, TCX, and GPX to GeoJSON, without the fuss
Stars: ✭ 315 (+377.27%)
Mutual labels:  gpx
garmin health
Python 3.x library to access Garmin Connect Health API
Stars: ✭ 32 (-51.52%)
Mutual labels:  garmin
X-TRACK
A GPS bicycle speedometer that supports offline maps and track recording
Stars: ✭ 3,736 (+5560.61%)
Mutual labels:  gpx
Meditate
Meditation app for Garmin smartwatches
Stars: ✭ 42 (-36.36%)
Mutual labels:  garmin

Garmin FIT Conversion Perl Library and Scripts

This repository is a collection of Garmin FIT Perl library and scripts for converting Garmin FIT files to other formats.
Currently the following conversions are supported:

Source Destination Extension
Garmin FIT GPX v1.1 .gpx
Garmin FIT SigmaSport log file .slf
Garmin FIT JavaScript Object Notation .json
Garmin FIT Text dump of all data records .txt

Main library for reading and parsing Garmin FIT file is a modified/updated version of Garmin::FIT library by Kiyokazu Suto. If you want to update Garmin::FIT library to the latest protocol/profile, use documentation from the official FIT SDK from thisisant.com Web site.

Currently supported FIT protocol and profile in this version of library is:

FIT Protocol FIT Profile Released
2.4 21.32 28-May-2020

Some of the messages and fields used in this implementation are not described in the latest official FIT SDK documentation and are therefore experimental/unsupported. This implementation was tested on FIT files from Garmin Edge device only. Other devices might produce FIT files which don't have all required fields. Scripts work in both Windows and Unix environments. Support for 64-bit integers is not tested at all.

Conversion scripts need to be run from the command line (there's no GUI).

Prerequisites

You'll need the following Perl prerequisites:

  • POSIX::strftime::GNU
  • Data::UUID
  • Config::Simple

You can install them with ppm on Windows (if you are using ActivePerl) or with cpan:

$ cpan install POSIX::strftime::GNU  
$ cpan install Data::UUID  
$ cpan install Config::Simple

Conversion

Getting the FIT files

You have to copy FIT files from your Garmin (or other) device to your computer. You'll need the activity FIT files only. On Garmin Edge devices these files are stored in \Garmin\Activity subdirectory. You can also do it via Garmin Connect Export option.

Config (ini) file

All conversion scripts can optionaly use config file in Windows ini format, which must be named as the script name with extension .ini and must reside in the current working directory. If the config file is not found, some reasonable defaults are applied.

Config file example (fit2slf.ini):

[default]
;SigmaSport: cycling, mountainbike, racing_bycicle (road bike), running, ...
sport = mountainbike
training_type = Riding
bike = bike1

[personal]
name = John Smith
gender = male
age = 40
height = 183
weight = 75

[bike1]
name = Ibis Ripley 29 LS
type = MTB
weight = 12.3
wheel_size = 2326

Units used in config file and in scripts are metric (kg, cm, mm, ...).

Detailed syntax and parameters used in ini file is described in Config (ini) File Syntax.

FIT to GPX (GPS Exchange Format)

Use fit2gpx.pl with optional config file fit2gpx.ini:

$ fit2gpx.pl input.fit

This produces file input.gpx in the current directory. If the file input.gpx already exists, it will not be overwritten. To force overwrite, use:

$ fit2gpx.pl -y input.fit

By default a GPX file compatible with Garmin's Track Point Extension Format v1 is produced. If you want to produce a GPX file compatible with a Cluetrust GPX Extension Format, use the following:

$ fit2gpx.pl -c input.fit

Difference between them is in the syntax how heart rate, cadence, temperature & power data is stored in the file. In both cases a Cluetrust extension <gpxdata:lap> (one for each lap) will be added to the end of file, where the following average/min/max values are stored:

startPoint, endPoint, startTime, elapsedTime, calories, distance, avg_speed, max_speed, min_altitude, avg_altitude, max_altitude, total_ascent, total_descent, distance_uphill, distance_downhill, avg_incline_uphill, avg_incline_downhill, avg_rise_rate_uphill, avg_rise_rate_downhill, min_heart_rate, max_heart_rate, min_percent_hrmax, avg_percent_hrmax, max_percent_hrmax, time_under_target_zone, time_in_target_zone, time_over_target_zone, avg_power, avg_power_KJ, avg_power_W_per_Kg, max_power, avg_cadence, max_cadence, min_temperature, avg_temperature, max_temperature, total_cycles, total_records

If input.fit contains power data from power meter, the real power average will be used instead of calculated one.

FIT to SLF (SigmaSport log file)

Use fit2slf.pl with optional config file fit2slf.ini:

$ fit2slf.pl input.fit

This produces file input.slf in the current directory. If the file input.slf already exists, it will not be overwritten. To force overwrite, use:

$ fit2slf.pl -y input.fit

A lot of calculation of average/min/max values is done in addition to the data found in FIT file. Specifically, power is calculated according to the formulas described in J.C. Martin's paper Validation of a Mathematical Model for Road Cycling Power from 1998. You can change some of the parameters used for power calculation in ini file (see Config (ini) File Syntax). If input.fit contains power data from power meter, the real power measurements will be used instead of calculated ones.

Resulting input.slf can be directly imported in SigmaSport Data Center, which is a perfect software for offline evaluation of cycling statistics and training sessions.

FIT to JSON (JavaScript Object Notation)

Use fitdump.pl:

$ fitdump.pl -print_json=1 input.fit > input.json

If you want to include the units, which are switched off by default for JSON, add command line switch -without_unit=0.

FIT to Text dump

fitdump.pl reads the contents for Garmin .FIT files given on command line (or standard input if no file is specified), and prints them in human readable form. Usage:

$ fitdump.pl input.fit > input.txt
or
$ cat input.fit | fitdump.pl > input.txt

The following command line switches are available (see example for JSON above):

-semicircles_to_deg=(0|1)       default: 1
-mps_to_kph=(0|1)               default: 1
-use_gmtime=(0|1)               default: 0
-maybe_chained=(0|1)            default: 0
-print_json=(0|1)               default: 0
-without_unit=(0|1)             default: 0 (1 for print_json)
-skip_invalid=(0|1)             default: 0 (1 for print_json)
-numeric_date_time=(0|1)        default: 0
-show_version=(0|1)             default: 0

Fields in .FIT files, which are not documented in FIT SDK, are named as unknown<field_number>. New fields, which typically appear in newer versions of FIT Profiles and Garmin::FIT library doesn't know them yet, are named as xxx<field_number>.

fitdump.pl is written in a generic way and will read all versions of .FIT files (past and future).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].