php-fit-file-analysis icon indicating copy to clipboard operation
php-fit-file-analysis copied to clipboard

Garmin Product Information is incorrect

Open riccode opened this issue 3 years ago • 2 comments

In the FIT files there are two fields "product" and "garmin_product" which are not interchangeable. Therefore, when pulling out the device information for Garmin devices some values that are returned are incorrect. The code does not distinguish between the "product" fields and the "garmin_product" fields in the FIT file. . I reached out to Garmin directly and they noted that "product" has something to do with Garmin Connect and does not reference the product list from the FIT SDK. I had thought I could simply line up the manufacturer array ( with "1" representing Garmin manufacturer), but this doesn't work either. I'll illustrate with an example. If I run the code on a FIT file I will get a ['device_info]['product] array with 8 entries. However, I will get a manufacturer array with only 7 entries. It seems some values of 'product' in the FIT file do not have a corresponding 'manufacturer' value (while all 'garmin_product" ones do). I manually went through the FIT file and pulled the values to illustrate this point:

manufacturer 1 garmin_product 2050 manufacturer 1 garmin_product 2050 product 558 manufacturer 1 garmin_product 1620 manufacturer 1 garmin_product 2050 manufacturer 1 garmin_product 2050 manufacturer 1 garmin_product 1620 manufacturer 25165 product 3

note no manufacturer for 'product' 558.

Therefore without knowing which values in the ['device_info']['product'] array correspond to 'product' or 'garmin_product' it is impossible as far as I can tell to line these arrays up.

Therefore, $this->data_mesgs['device_info']['product'] should NOT contain values pulled from the "product" field. Is there some small change to the code that can be made to only pull the "garmin_product" field and ignore the "product" field?

riccode avatar Oct 08 '20 16:10 riccode

Hi @riccode

The issue is thanks to it not be clear whether the field contains product, garmin_product or favero_product as they all have the same field number in a device_info message.

From the Profile.xlsx file in the FIT SDK

Screen Shot 2020-10-10 at 9 51 44 am

Same goes for file_id messages. Not sure how this can be overcome - i.e. how do we know which of the three Field Names is present in a device_info message? I don't see any clue in the documentation.

Cheers, Adrian.

adriangibbons avatar Oct 10 '20 01:10 adriangibbons

Adrian,

I reached out to Garmin, who in turn reached out to the FIT team and have made them aware of this. We will wait and see if they get back to me. So far the best solution I've found is using the software_version field. It seems that Garmin devices have a software_version below 1000, while software versions relating to 'product' had a software_version > 10,000.

riccode

riccode avatar Oct 14 '20 16:10 riccode