Category Archives: Blog Post

Beyond the SDK: Uncovering Undocumented Garmin FIT File Information

Introduction: The Challenge of Undocumented FIT File Data

Decoding all the data within Garmin’s FIT files can be a challenge due to the presence of undocumented messages, fields, and values. Garmin developed the FIT file format to store data on its devices, including activity data, courses, workouts, monitoring data, goals, and more. While much of this data is viewable in the Garmin Connect app or website, and activities can often be exported to FIT format by other brands and imported into apps like Strava, there are reasons to develop custom applications. These reasons include accessing data not shown in standard apps, creating personalized data visualizations, or performing more in-depth analysis.

The Garmin FIT SDK: An Incomplete Resource

To aid developers, Garmin provides an SDK (available on their developer website) with tools to extract information from FIT files in various programming languages. However, this SDK isn’t exhaustive, meaning not all information within FIT files can be accessed through it.

FIT Files: Messages, Fields, and the Profile Spreadsheet

A FIT file is a compact, binary format organizing information into messages and fields. For example, a “lap” message contains summary information for each lap, and a “device info” message details the devices and sensors used. Each message comprises several fields, such as start time and total elapsed time in a lap message.

Messages and fields are identified by numerical codes. Also the value of a field may be a numerical code. For example, an “event” field may have value 0 for a timer event, 9 for a lap event, 22 for a battery low alert, etc.

The SDK includes a spreadsheet, profile.xlsx, which documents the meaning of many of these numbers.

The Problem: Undocumented Elements

When working with FIT files, you’ll quickly encounter undocumented numbers. You might decode a message but not know its purpose, or find undocumented fields within documented messages, leaving their meaning unclear. Even when a field’s purpose is known, it can contain undocumented values. For instance, an “event” field might have an undocumented value like 39, so you don’t know what type of event it is.

Strategies for Deciphering Undocumented Data

Several methods can be used to decipher these undocumented elements. One crucial tool is an application like FIT File Viewer, which displays all messages, fields, and values within a FIT file, including those not officially documented (accessible via developer mode in FIT File Viewer).

A practical approach is to record an activity and then compare the values in the FIT file with the information presented in the Connect app/website or your device’s app. If you find a match in a field labeled like “field {number}” (where {number} is the specific field’s numerical identifier), it suggests this is the corresponding data point. Repeating this process with different activities can help confirm your findings.

Another useful technique is to change settings on your device one at a time and observe the resulting changes in the FIT file. This helps isolate the impact of each setting modification.

Good to know: if you go to https://www.fitfileviewer.com/develop, you have some extra features: you will see the fields for which I have already figured out the type, but not the meaning yet, and there is a button to log the undocumented fields (if any) in the debugger console: the field definition number, base type, size and value in the first row.

A Community-Driven Resource: Undocumented Data for FIT File Viewer

Through these investigations and the shared knowledge of others, I have compiled a list of undocumented messages, fields, and values specifically for use in FIT File Viewer. This list follows the same format as the profile.xlsx file in the FIT SDK.

I am now sharing this document to benefit others developing their own FIT file decoders. Simultaneously, I encourage them to share any undocumented values they discover, so I can incorporate them into this resource.

You can find the list of undocumented values in this Google Sheet.

Call for Contribution

If you discover other undocumented messages, fields, or values, or identify any errors in this sheet, please contribute!

You can do so by opening a FIT file demonstrating the value in FIT File Viewer, clicking the “Contact Me” link at the bottom, and completing the form.

Getting your Zwift ID the easy way

Zwift is an online training app for cycling (and running). If you have an account at Zwift, you can also use other web apps, such as Zwift Power and Zwift GPS. You connect these apps to your Zwift account using your Zwift ID.

Getting your Zwift ID can be a bit tricky. For some reason, Zwift is not simply listing it in your profile, but you can figure it out if you analyse the link of a downloaded activity (.FIT) file.

It can be much easier using a bookmarklet. A bookmarklet is a small tool that is installed in your bookmarks bar and that can do simple tasks, such as getting information from the current web page.

Continue reading

New version of Gmail to Evernote now in spreadsheet

A new version of the Gmail to Evernote script has been released. It is now embedded in a spreadsheet, so you have all the relevant information together and can easily view it. Moreover, you have your own copy of the script now: much more secure, but it is not to update automatically anymore. Therefore, current users are advised to install the latest version and use this instead of the old version. The old version may stop working in the course of the next week (end of April 2019).

Continue reading

Changing the settings for a Garmin Connect IQ App

Update: Garmin has now a page on their support site explaining How to Access the Settings of Downloaded Connect IQ Content Using the Garmin Connect App.

Garmin has a range of sports watches, on which you can install Apps, both provided by Garmin and by the community. You can find the  Apps developed by HarryOnline in the Connect IQ store.

From the feedback I received, I noticed that many people find it hard to change the settings for an App. This can be done on the watch itself, if it provides such an option via the Menu, or using a connected computer or smartphone. On a computer  you use Garmin Express, on a smartphone there is the Connect Mobile App. For both I will describe how the settings can be changed.

Continue reading

ObjDB: the easy way to store data with Google Apps Script

There are various ways in Google Apps Script to store data, a common way is to store data in a spreadsheet. Spreadsheet data is relatively easy to access, and sample code is provided to read data from a spreadsheet into an array of JavaScript objects, and to write from objects to the spreadsheet. For more advanced database functions (update, select, delete), you have to do some more programming.

For larger applications, you may want to use MySQL or other databases via JDBC, Again, some sample code is provided, but this time not to read/write to and from JavaScript objects. A lot more coding is required, especially to link the fields in each record to the field name, instead of just the offset in the results rows.

To make it easier to work with data in Google Apps Script, both from spreadsheets and from JDBC databases, I have developed the ObjDB library. This is a set of functions, with which you can open a spreadsheet or database, and do all the basic operations: select, update, insert, delete. Functions are the same for spreadsheets and for JDBC databases, except the different parameters for the open() function, so if you start with data in a spreadsheet, and later move the data to a database, there is hardly any code to change.

To show how the library works, I prepared a demo spreadsheet with script. Open the link, it should create a new copy of the spreadsheet, if not, copy it yourself. Then go to ToolsScript editor…, and run any of the functions to see it in action.

Note that the script in this spreadsheet includes the objDB library, see under ResourcesManage Libraries….

For more documentation, reference and source code, go to http://googlescripts.harryonline.net/objdb.

How to index Project Gutenberg files

project_gutenberg_logoProject Gutenberg offers over 40,000 free ebooks: choose among free EPUB books, free kindle books, download them or read them online. Recently, they have added support for Dropbox, so you can download ebooks directly to your Dropbox account. It will create a folder ‘Apps/gutenberg’, and will store all ebooks in that folder.

After a while, this Dropbox folder will have a long list of files, all with names like pg1234.epub and pg5678-images.epub. They have some meaning, but which file contains which title? Of course, you can rename each ebook  after downloading, but this is extra work, and I want a smart solution.

pg_filelist

So I created a script to create an index for all ebooks–at least, for those in EPUB format. Now there is simply an index.html file, which will open in any browser. It shows the file name, together with the creator, title and language. Depending on how you view the index.html file, the links may be clickable, In any case, you can quickly see which file is which book.

pg-index

The script works on any set of EPUB file, but usually, they will have a more meaningful name and there will be less need for a script like this.

Continue reading