Issue trying to log a custom field using the simulator

I'm trying to log a custom fit field from a data field and test it using the simulator. Whenever I try and run the resulting fit file through Fit2CSV, I am getting a CRC error with the fit file.

if I just do a createField and an initial setData, the fit file comes out fine (except without my logged data). As soon as I add a setData in the compute function (I'm just incrementing an integer for now), then I run into the problem.

Convinced it was a problem with my code, I went to the sample site mentioned in the sticky post and tried the ciq_monkeyfuel sample as it seems to do the logging just as I want - it turns out, I have the same issues with the fit file from the sample.

Any thoughts on how to get this to work properly?

Thanks!
Scott
  • I'm trying to log a custom fit field from a data field and test it using the simulator. Whenever I try and run the resulting fit file through Fit2CSV, I am getting a CRC error with the fit file.

    if I just do a createField and an initial setData, the fit file comes out fine (except without my logged data). As soon as I add a setData in the compute function (I'm just incrementing an integer for now), then I run into the problem.

    Convinced it was a problem with my code, I went to the sample site mentioned in the sticky post and tried the ciq_monkeyfuel sample as it seems to do the logging just as I want - it turns out, I have the same issues with the fit file from the sample.

    Any thoughts on how to get this to work properly?

    Thanks!
    Scott


    I've seem to have similar problem as I am trying to add custom fields also, and my fit file from simulator came without any data in monkeygraph, and as you I only increment numbers for now !
  • scottsk vald70 I had the same problem when I started CIQ development and it was equally bewildering.

    In the simulator you have to select Data Fields > Timer > Save Activity to finalize the FIT file, before you select Save FIT Session..., or your file will be corrupt.

    The first thing is analogous to saving the activity on the watch, the second thing just copies the FIT file (whether it's finalized or not).

    I don't like the UX either, but I understand why it is the way it is.


    --

    If anyone from Garmin is reading this, maybe disable "Save FIT Session..." until the user selects Save Activity? Or pop-up a dialog asking the user whether the activity should be automatically saved? (Otherwise the FIT file won't be saved). Or maybe just do what everyone expected in the first place and save the activity silently when the user selects Save FIT Session?

    I realize this is tough to do because there are situations where none of the above is possible, like when the timer is still running. However, the dialog could ask whether the sim should "stop and save the activity" in that case.

    But I think this is one of those "tiny" quality-of-life UX issues that many devs seem to run into, and maybe it could be rethought.

    I just don't see the utility in allowing a dev to save a corrupt/unfinalized FIT file from the simulator, without any warning or explanation. From the user's (dev's) POV, their first reaction is "it's broken". Right or wrong, that's usually an indication of UX that could be improved. (I also realize it's not always practical or feasible to do so. I have the same kind of issue in some of my own apps. But where it can be improved, it would be nice.)
  • In my case it's a watch app, and I call save() myself in the app,
    I only got my last field (session) with unknown values, and none of the record value

    scottsk vald70 I had the same problem when I started CIQ development.

    In the simulator you have to select Data Fields > Timer > Save Activity to finalize the FIT file, before you select Save FIT Session..., or your file will be corrupt.

    The first thing is analogous to saving the activity on the watch, the second thing just copies the FIT file (whether it's finalized or not).

    I don't like the UX either, but I understand why it is the way it is.


    --


  • Okay, well to be clear, my post was referring to a CRC error when recording a FIT file from a data field app in the simulator, as referenced in the first post. Sorry for assuming that the first and second post were talking about the same thing.

    vald70 Monkeygraph can be a little finicky and it doesn't always show the correct data. Make sure that your FitContributor XML is defined properly (this is why MonkeyGraph needs the IQ file.)

    Try using FitToCSV from the FIT SDK and make sure the internal data matches (or doesn't match) what you expect.

    https://www.thisisant.com/resources/fit
  • FlowState Thanks! This was my exact problem. I can now see the my data is being logged into the fit file...now I need to figure out why monkeygraph isn't working for me (probably because I kept tweaking my code to try and fix the corruption issue and now things don't match up with my resources).
  • Monkey Graph uses a .iq file, as that's where "how to display the user data" comes from (It's in the app store for a published app). So you want to make sure you rebuild the .iq if something changes.