Fit Contributor

Hi,

just a question to the FitContributor: If I calculate the average values of an high-intensity period of an interval and write those values to the Fit file, does Garmin connect web make those values somehow visible or is it just a value in the Fit file?
  • There's a post here someplace about strings and the default length being 1. I('ll see if I can find it. Here it is: https://forums.garmin.com/showthread.php?359132-FitContributor-DATA_TYPE_STRING-char-limits!&highlight=DATA_TYPE_STRING Not only how to set the size, but data on the max size.

    In the API doc, it does say this:

    options (Dictionary) — Optional parameters that can be specified for field creation @option [:count] The number of elements to add to the field if it is an array.
    This is also the maximum combined size of strings plus null
    terminators if the type is DATA_TYPE_STRING (Default 1)
  • Former Member
    Former Member over 8 years ago
    i tried running the moxyfield sample (not modified) and couldnt get it to run in the simulator (edge1000 ciq 2.1.x).. i get this:

    Device id 1 name "A garmin device"
    Shell Version 0.1.0
    Failed invoking <symbol>
    Out Of Memory Error
    in initialize (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MO2FitContributions.mc:38)
    in initialize (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MoxyField.mc:61)
    in getInitialView (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MoxyField.mc:241)
    Connection Finished
    Closing shell and port


    any ideas?
  • i tried running the moxyfield sample (not modified) and couldnt get it to run in the simulator (edge1000 ciq 2.1.x).. i get this:

    Device id 1 name "A garmin device"
    Shell Version 0.1.0
    Failed invoking <symbol>
    Out Of Memory Error
    in initialize (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MO2FitContributions.mc:38)
    in initialize (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MoxyField.mc:61)
    in getInitialView (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MoxyField.mc:241)
    Connection Finished
    Closing shell and port


    any ideas?


    I don't have any ideas on this off the top of my head. It runs fine for me on my PC. I tried a few things, but couldn't make it error like that.
  • Could it be the target device picked in the sim? Seems I saw the "Out of Memory" on one of the generic devices (which wasn't the case) (generic - like "Round Watch"). Maybe try an actual device as a target in the sim?
  • Former Member
    Former Member over 8 years ago
    The data won't appear in Garmin Connect until you upload your app to the app store. If you're not ready to upload to the store, you should be able to use the monkeygraph utility to display the data from fit files captured in the simulator and from the device.


    Travis, so I can't view Fit developer fields on Garmin Connect unless is the up is submitted to the app store and approved ?

    Thanks
    Jesus
  • Former Member
    Former Member over 8 years ago
    Could it be the target device picked in the sim? Seems I saw the "Out of Memory" on one of the generic devices (which wasn't the case) (generic - like "Round Watch"). Maybe try an actual device as a target in the sim?


    i tried all the device target and sdk target combinations already (in simulator). I will try in a pc instead of a mac.
  • i tried running the moxyfield sample (not modified) and couldnt get it to run in the simulator (edge1000 ciq 2.1.x).. i get this:

    Device id 1 name "A garmin device"
    Shell Version 0.1.0
    Failed invoking <symbol>
    Out Of Memory Error
    in initialize (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MO2FitContributions.mc:38)
    in initialize (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MoxyField.mc:61)
    in getInitialView (/Users/xyz/connectiq-sdk-mac-2/samples/MoxyDataField/source/MoxyField.mc:241)
    Connection Finished
    Closing shell and port


    any ideas?


    I tried the same on my Mac, and got the same error.

    The Mac build of the simulator seems very unstable. I have another thread here about the info.elapsedDistance field not being updated, and it also seems to be specific to the Mac (others have tried my source code using Windows, and it works).

    Regards,
    JF
  • Hi,

    writing to the FIT-file works now for me. Nevertheless, I got several issues with the graph:


    I have coded the following:
    In the resources file:
    <fitContributions>
    <fitField id="0" displayInChart="true" sortOrder = "0" precision="0" chartTitle="@Strings.AvHrGraphLabel" dataLabel="@Strings.AvHrGraphLabel" unitLabel="@Strings.AvHrUnits" fillColor="#FF0000"/>
    </fitContributions>


    In the constructor of my datafield:
    avHrField = createField("average_heartrate", 0, FitContributor.DATA_TYPE_UINT8, { :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"bpm" });


    And in compute(info):
    avHrField.setData(hiAvHrField.toNumber());


    Any help on that issues?

    Edit: Furthermore I did download the .FIT-file and the .GPX file and tried both to import to sporttracks, which ended up with a corrupted map view and funny data. I tried then downloading any other gpx file which I did not contributed with my datafield to and this gpx file loaded just fine in sporttracks. Then I changed the tool and tried to upload the gpx file, I contributed to, to a online viewer. The same results as with sporttracks. Now my question: Could it be that the fit-contributor breaks the gpx and fit files?
  • Here is an example run

    https://connect.garmin.com/modern/activity/1372956586

    Hope you can help me with that:

    writing to the FIT-file works now for me. Nevertheless, I got several issues with the graph:
    On Garmin Connect Web the graph is black instead of red: https://www.dropbox.com/s/z0ix1amxlu...Graph.JPG?dl=0
    On Garmin Connect Web if I click on the little diagonal arrows to enlarge the graph nothing at all is shown: https://www.dropbox.com/s/a3vhorhla0...0Zoom.JPG?dl=0
    On Garmin Connect Mobile the color of the graph looks good but I get a strange number under the graph's name: https://www.dropbox.com/s/owblnffeqq...obile.png?dl=0
  • Hi, I have double checked the entire code of the fit contribution and have changed the following:
    I included the first setData() in the constructor so that the data is set from the beginning. Nevertheless, the problems are the same.

    Could it be that the fillcolor of #ff0000 is not assignable? Must have the strings, defined in the resources file, no spaces? I really have no clue why the problems occur.