Fenix 3 does not record Session message in FIT file

I'm trying to save a session message in a FIT file using the FIT Contributor.

It works fine on an Edge device.

However, it doesn't show up when I run this on a Fenix 3.

7.60 firmware on the Fenix3
2.1.5 SDK

I'm using the 20.14.00 FITtoCSV.bat converter to verify if the session data is present. The record messages do show up like they are supposed to.

Here's the FIT contributor code.

using Toybox.Application as App;
using Toybox.WatchUi as Ui;
using Toybox.System as Sys;
using Toybox.FitContributor as Fit;

const SMO2_FIELD_ID = 0;
const THB_FIELD_ID = 1;
const DEVICE_INFO_ID = 2;

class MO2FitContributor {

// FIT Contributions variables
hidden var mSmO2 = null;
hidden var mThb = null;
hidden var mDeviceInfo = null;

// Constructor
function initialize(dataField, sensor) {
var label = " Sensor " + sensor.deviceNumber.toString() + " on " + get_sensor_location_name(App.getApp().getProperty("SensorLx"));
mSmO2 = dataField.createField(G_AppSensor + " " + G_currentHemoPercentLabel + label, SMO2_FIELD_ID, Fit.DATA_TYPE_FLOAT, { :nativeNum=>57, :mesgType=>Fit.MESG_TYPE_RECORD, :units=>G_currentHemoPercentUnits });
mThb = dataField.createField(G_AppSensor + " " + G_totalHemoConcentrationLabel + label, THB_FIELD_ID, Fit.DATA_TYPE_FLOAT, { :nativeNum=>54, :mesgType=>Fit.MESG_TYPE_RECORD, :units=>G_totalHemoConcentrationUnits });
mDeviceInfo = dataField.createField("CIQ_device_info", DEVICE_INFO_ID, Fit.DATA_TYPE_UINT8, { :count=>8, :mesgType=>Fit.MESG_TYPE_SESSION });

mSmO2.setData(0);
mThb.setData(0);
}

function compute(sensor) {
if( sensor != null ) {
var SmO2 = sensor.currentHemoPercent;
var THb = sensor.totalHemoConcentration;
if( SmO2 != null && THb != null) {
mSmO2.setData(SmO2.toFloat());
mThb.setData(THb.toFloat());
}
else {
mSmO2.setData(0);
mThb.setData(0);
}
}
}

function setDeviceInfo(deviceInfo) {
mDeviceInfo.setData([31,(deviceInfo[0]),(deviceInfo[1]),(deviceInfo[1] >> 8),(deviceInfo[1] >> 16),(deviceInfo[1] >> 24),(deviceInfo[2]),(deviceInfo[2] >> 8)]);
}

}
  • Can someone from Garmin acknowledge this bug? I just want to make sure it gets on your log.

    The MoxyDataField sample shows the problem. Record and Lap CIQ data are in the FIT file, but not Session CIQ data.

    Thanks!
  • The vivoactive seems to have the same bug. It saves the session message on the Simulator, but not on the device.

    VA firmware 4.30
  • The following devices work as expected for writing the session data to the FIT file

    Simulator
    Edge 1000
    Edge 520
    FR735XT
    FR235

    I don't have the following devices available to test.

    920XT
    FR230
    FR630
    Edge 820
    vivoactive HR
    Fenix3 HR
  • Hey,

    I have created a ticket to check into this. Thanks for letting us know.

    -Coleman
  • I've got a bit more complexity to add to this issue.

    The Fenix 3 does Not store the session message when running a Data Field but it does for the session message when running an App.

    The vivoactive is the opposite. The VA does store the session message when running a Data Field but it does Not store the session message when running an App.

    Just to be clear.... I'm concluding that the session message is not in the FIT file because when I run the FIT file through the FITtoCSV.bat operation, neither the session message nor the field definition message for the session message are present in the resulting .csv file. I'm using 20.16.00 verision of the FIT SDK today. I have not manually parsed the fit file bit by bit to verify that it's not actually there so there is a remote possibility that this is a FIT SDK issue but that would be really strange to be device dependent like this is.

    I've repeated this several times on both devices so I don't think it's a random occurrence.

    The Fit Contributor code is nearly identical for the App and the Data Field and the same App and Data Field were run on both devices (minus some simple build excludes for screen formatting)

    The Edge 520, Edge 1000, 235, and 735xt all saved the session message for both the data field and the app.

    All devices have latest released firmware.
  • I've got a bit more complexity to add to this issue.

    The Fenix 3 does Not store the session message when running a Data Field but it does for the session message when running an App.

    The vivoactive is the opposite. The VA does store the session message when running a Data Field but it does Not store the session message when running an App.

    Just to be clear.... I'm concluding that the session message is not in the FIT file because when I run the FIT file through the FITtoCSV.bat operation, neither the session message nor the field definition message for the session message are present in the resulting .csv file. I'm using 20.16.00 verision of the FIT SDK today. I have not manually parsed the fit file bit by bit to verify that it's not actually there so there is a remote possibility that this is a FIT SDK issue but that would be really strange to be device dependent like this is.

    I've repeated this several times on both devices so I don't think it's a random occurrence.

    The Fit Contributor code is nearly identical for the App and the Data Field and the same App and Data Field were run on both devices (minus some simple build excludes for screen formatting)

    The Edge 520, Edge 1000, 235, and 735xt all saved the session message for both the data field and the app.

    All devices have latest released firmware.


    I wanted to give you an update and point it out here so others could see. This is now in the hands of the device team so they can work on addressing the root cause.

    -Coleman
  • I wanted to give you an update and point it out here so others could see. This is now in the hands of the device team so they can work on addressing the root cause.

    -Coleman


    any update on this? Vivoactive users are reporting this on an app of mine
  • I did a little checking on this. I do see that the device teams needed have tickets that have been assigned, but I don't have any definitive timelines as of now.

    Thanks,
    -Coleman
  • FYI

    i have found a workaround so that session data is written in the fit file for the vivoactive.

    In apps, I use to create fields using the session method:

    mSessionP0 = session.createField("P0", 0, Fit.DATA_TYPE_FLOAT, { :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"bpm" });


    this is not working for the vivoactive.

    Instead, i have created this class:

    class DicksonField extends Ui.DataField
    {
    // Label Variables
    // Fit Contributor


    // Constructor
    function initialize() {


    }
    }


    I instantiate the class:
    dataField = new DicksonField();

    And this way, I can create the field using the datafield method (which is the common way to create fields when developing a data field)


    mSessionP0 = dataField.createField("P0", 0, Fit.DATA_TYPE_FLOAT, { :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"bpm" });


    this works fine.