Skip to content

Frequently Asked Questions (FAQ)

Adrian Gibbons edited this page Jul 16, 2017 · 20 revisions

Below are the following FAQs:

  1. What is a FIT file?
  2. Why isn't there altitude/elevation data in my FIT file?
  3. Which Devices and Sensors has phpFITFileAnalysis been tested with?
  4. Where are my FIT files?
  5. Why aren't all Messages and Fields identified in 'profile.xls' (from the FIT SDK) included?
  6. Why is the power_metrics() function taking so long?
  7. Why won't phpFITFileAnalysis work with PHP versions earlier than v5.4?

1. What is a FIT file?

FIT or Flexible and Interoperable Data Transfer is a file format used for GPS tracks and routes. It is used by newer Garmin fitness GPS devices, including the Edge and Forerunner series, which are popular with cyclists and runners.

The FIT format is similar to Garmin's Training Center XML (.TCX) file format, which extends the GPS Exchange Format (.GPX). It enables sensor data (such as heart rate, cadence, and power) to be captured along with GPS location and time information; as well as providing summary information for an activity and its related sessions and laps.

FIT files are binary-encoded rather than being bloated XML-like ASCII documents. This means that they have a much smaller file size, but are not human-readable with a text editor such as Notepad. For example, a FIT file of 250Kb may have an equivalent TCX file of approximately 5Mb. This enables them to be uploaded to websites such as Garmin Connect, Strava, MapMyRide, Runkeeper, etc relatively quickly.

2. Why isn't there altitude/elevation data in my FIT file?

Not all devices record altitude/elevation data, so it may not be present in a FIT file.

For example, Garmin's Forerunner 10 and 15 GPS watches do not record or display elevation. Instead, when an activity is uploaded to a site such as Garmin Connect / Strava / MapMyRide, altitude/elevation data is looked-up for each GPS position in the file and an elevation profile is generated. To mimic this behaviour Google's Elevation API can be used to achieve the same effect.

To check whether altitude/elevation data is contained in a FIT file, you can use the phpFITFileReader's show_debug() function and see which fields are present in record messages.

3. Which Devices and Sensors has phpFITFileAnalysis been tested with?

Devices

  • Garmin Edge 1000
  • Garmin Edge 500
  • Garmin Fenix 2
  • Garmin Forerunner 110
  • Garmin Forerunner 225
  • Garmin Forerunner 310XT
  • Garmin Forerunner 910XT

Sensors

  • Garmin Cadence and Speed
  • Garmin Foot Pod (cadence)
  • Garmin Heart Rate Strap (soft material version)
  • Mio Optical Heart Rate sensor (built into Garmin Forerunner 225)
  • Shimano D-Fly Data Management system (transmit Di2 gear data to cycling computers)
  • Stages Power Meter If you have a different device or sensor and would like to submit a file for testing, please get in touch or create an issue on the GitHub project page!

4. Where are my FIT files?

You may find your FIT files in one of two locations:

  • On the GPS device in the folder Garmin > Activities (plug it into your computer using a USB cable).
  • C:\ drive > Users > Username > Application Data > Garmin > Devices > Device Number > Activities.

Alternatively, if you have uploaded to a site like Garmin Connect, you could Export Original and save the file to disk.

5. Why aren't all Messages and Fields identified in 'profile.xls' (from the FIT SDK) included?

After analysing FIT files from various Garmin devices, only the FIT Messages and Fields that have actually been observed (and thought to be most useful) have been defined within $data_mesg_info[]. Messages not defined within $data_mesg_info[] are dropped silently and should not create an error, however they will not be available in data_mesgs[]. Sometimes global message types are contained in files that are not defined in the FIT standard documentation (e.g. message numbers 22 and 79). If there are Messages and/or Fields, which would be useful to include in the class, then they can be added in a future release.

6. Why is the power_metrics() function taking so long?

Chances are you have a large data set and do not have the PHP Trader PECL extension installed on your server. A 3 hour bike ride recording data every second will contain over 10,000 data points. If the PHP Trader extension is not available, then the class will use its own Simple Moving Average algorithm, sma(), which will create rolling averages for the data set and may require a while to complete.

Refer to issue #16 for some stats.

The PHP Trader extension is much quicker at performing these calculations (probably because it is compiled C code!) and certainly the preferred method if you are able to install it on the server. You can use the following PHP code to test if the extension is available:

<?php echo extension_loaded('trader') ? 'PHP Trader installed' : 'PHP Trader NOT installed'; ?>

7. Why won't phpFITFileAnalysis work with PHP versions earlier than v5.4?

phpFITFileAnalysis uses the short array syntax i.e. []. It may be possible to adapt for use with earlier versions of PHP by replacing [] with array() throughout. Though this has not been tested.