FitContributor with Data Field WITHOUT having to create entire App?

I need to do something very simple without having to write the code for an entire app. I've created a ConnectIQ Data Field which can easily be added to the pre-existing Garmin Run activity to show ANT+ sensor Power in watts from a force sensor in the running shoe, just like you would inside the Bike activity if you were riding with an ANT+ power meter. This combination with the Run activity allows combination of watts with Running Dynamics fields already available from the Garmin run strap. It works just find for display on the watch, but does not save to the pre-existing .FIT file generation within Garmin's own Run activity. Of course, it can work with the Bike app and save the power in watts, but then the running dynamics are not available there.

Is there any way to use the FitContributor module to simply add this additional Power field to all the other ones already being recording in the Run activity .FIT file? I know you can do this by writing a complete app like the Moxy Sample, but this is for lots of fields in a truly unique configuration and I just need to add one field to the one-second record for power in watts.

It says in the documentation that FitContributor works for a Data Field and App, but it does not say a Data Field WITHOUT creating a custom Watch App.

Any thoughts? Great stuff in the forum on how to use FitContributor with Apps like Moxy sample, but not something simpler. Before I try it on my own, to strip Moxy way down to work as a Data Field for only one value, I'd like to know if it's even possible.

Thanks,

Ironman.Texas
  • This should give you the basis of what you need, https://github.com/lcj2/ciq_monkeyfuel. It won't include the ANT piece you have but shows the FIT contributor in a data field. Since you are using power, you'll want to brush up on the use of native field mapping so that sites like strava, training peaks, sporttracks will use your power data in calculations. If after you review it and have more questions let me know but the answer to your question is that FIT contributor supports data fields.

    **NOTE** There are a couple FIT recording issues depending on the device for session and last lap but those are outside the developers control and have been reported for correction. You can review the bug report thread for the information.
  • It says in the documentation that FitContributor works for a Data Field and App, but it does not say a Data Field WITHOUT creating a custom Watch App.


    A Data field is one of the 4 "app types" in CIQ. Watch-App is another (a full blown, stand-alone app) (watchface and widget are the other two)

    You can use FitContrib in a data filed that's used in something like the native cycling app. A CIQ (or native) DF actually can not be used in a CIQ watch-app.
  • Thanks for the code references from GitHub. These are proving very helpful--I can just cut out most of what I don't need, because I only need ANT+ Power and its derivatives like Average Power.

    So if I successfully implement the FitContributor code segments for ANT+ Power, Average Power, and Lap Power in a DATA FIELD App, such as the Monkey Fuel example, will I then be able to load these 3 as Connect IQ data fields into the NATIVE Run app data screens. In other words, I would have a display that would show things like Average HR, Power, Lap Power and Average Pace (Run) on one data screen, and then save all of these to a .FIT file that would show up in Garmin connect as a RUN Activity? I want to avoid having to recalculate and/or recode all the other native data elements of the run app like Cadence, Average Cadence, Vertical Oscillation, Ground Contact Time, etc., and just develop my own additional Power data fields.

    Thanks,

    IronmanTexas
  • will I then be able to load these 3 as Connect IQ data fields into the NATIVE Run app data screens.

    Yes.

    You are implementing a data field. It just displays a bit of data to be shown inside a native app. You control the data that is shown in your data field on the watch screen, and you control what additional data is written to the .FIT file and displayed in Garmin Connect.
  • Can't get MonkeyFuel to record anything viewable from Garmin Connect

    This should give you the basis of what you need, https://github.com/lcj2/ciq_monkeyfuel. It won't include the ANT piece you have but shows the FIT contributor in a data field. Since you are using power, you'll want to brush up on the use of native field mapping so that sites like strava, training peaks, sporttracks will use your power data in calculations. If after you review it and have more questions let me know but the answer to your question is that FIT contributor supports data fields.

    **NOTE** There are a couple FIT recording issues depending on the device for session and last lap but those are outside the developers control and have been reported for correction. You can review the bug report thread for the information.


    I'm new to the Connect IQ environment, so forgive me if I seem stupid. At first, I seemed to able to follow your code, but I still can't seem to get any additional data fields into a .FIT file for pre-existing Garmin Run App (on a 735xt or 920xt, the two I own and can test on) to show up from FIT files recorded either from the watch with a sideloaded data field or from the Connect IQ Simulator when I record the data. All that show up are there pre-existing run data fields. The MonkeyFuel app successfully builds, and creates the PRG and debug files, but also creates two more .JSON files in the bin folder (what are these for? I can guess, but no other sample app I've seen uses these). It loads into the watch and runs on the simulator, but I can't find any evidence of that field getting recorded. Is there some way I can check for this other than Garmin Connect or other web-based apps that read FIT files?

    As with my own SimpleDataField app, the MFuel displays fine and shows data in the simulator or while doing a Run workout from the watch, since it's based on a simple calorie version, which I understand. But like my own Power data field, there is no recording that I can find in the .FIT file. Could it be in there but just not showing up in GarminConnect? Does Garmin Connect make a prior restraint on adding any new data displays to something like a Running workout? Will I have to make up my own new sport, write a dedicated Watch App just get the one Power data field to record with traditional running metrics?

    Laps seem to have no effect, either, do not show up at all, just the regular Run lap like time or average pace for the lap. No way to see Monkey Fuel per lap that I can find or average MFuel for a session, not on the watch itself of the FIT file.
  • I still can't seem to get any additional data fields into a .FIT file for pre-existing Garmin Run App

    How are you looking for the data? Are you loading it up in monkeygraph utility or dumping it with one of the FIT file utilities that come with the FIT SDK?
  • As with my own SimpleDataField app, the MFuel displays fine and shows data in the simulator or while doing a Run workout from the watch, since it's based on a simple calorie version, which I understand. But like my own Power data field, there is no recording that I can find in the .FIT file. Could it be in there but just not showing up in GarminConnect? Does Garmin Connect make a prior restraint on adding any new data displays to something like a Running workout? Will I have to make up my own new sport, write a dedicated Watch App just get the one Power data field to record with traditional running metrics?


    Garmin Connect can't be used to test the data field because it relies on the FIT contributor definition file from the store when an app is published. All of your FIT file analysis for the simulator or side loaded apps will need to happen with Monkey Graph or the FIT to CSV tool from the FIT SDK. How are you determining that no data is in the file?

    Laps seem to have no effect, either, do not show up at all, just the regular Run lap like time or average pace for the lap. No way to see Monkey Fuel per lap that I can find or average MFuel for a session, not on the watch itself of the FIT file.


    Assuming the lap information made it into the FIT file, they are not currently showing in Garmin Connect. This issue has been reported and hopefully is being worked on.
  • Problems getting monkeygraph to work with ANY app

    How are you looking for the data? Are you loading it up in monkeygraph utility or dumping it with one of the FIT file utilities that come with the FIT SDK?


    Thanks for all the help. After using the FitSDK tools, I can now see my Power data fields for Record and Lap in the .FIT file once its converted to CSV form. Everything looks fine. But now, I can't seem to get ANY sample app or my own app to work with monkeygraph. I have used the App Export Wizard to create the IQ zipped up package, started monkeygraph from within Eclipse, then loaded both the exported IQ and generated FIT file using the File command in that window (FIT file generated from app sideloaded to the 735xt watch, not from the Simulator). Nothing happens in the PC window for Monkeygraph. I did the same thing with the Monkey Fuel sample app you suggested, which like my own is showing up fine in the .FIT file tabulation, but does nothing within monkeygraph.

    Then I tried running monkeygraph.bat from the command line, and I got a rather long list of not-good looking output which I don't fully understand (see output below). So apparently, I'm just not using monkeygraph right. Do all files like IQ, FIT and monkeygraph need to be in the same directory? Do I need to be passing other command line parameters to monkeygraph? Is there some more comprehensive documentation on monkeygraph? All I can find is in the forum, where no one seems to have trouble, and the main HTML documentation just a few suggestions to use it--not how or how to fix problems with it.

    One more question: many people in the forum get monkeygraph to work fine, then do NOT get Garmin Connect to show the FIT charts successfully. When I export to the IQ and upload to the store, is there a way to submit NOT for publication checking by Garmin but just show I can check as a developer if it truly works.

    I am doing everything in my resource and manifest file just like Monkey Fuel and the other sample apps--though mine is much simpler, just one data field, power as an integer, and one unit, watts.

    Really, my data field app is very simple, and treats running power just as if it came from a bike power meter--and it will work/test with a bike-connected ANT+ power meter as well. Really, I'm just taking a bike native field, Power in watts, and moving it into the Run native app as a ConnectIQ data field so it can be shown with things like cadence, GCT and Vertical Oscillation from the HRM/Run strap. No problem displaying or even averaging, since these are already available in the info object.

    Thanks,
    IronmanTexas

    OUTPUT FROM MONKEYGRAPH.BAT processing IQ and FIT files:

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at com.garmin.monkeybrains.fitgraphs.graph.FitGraphXYDataset.<init>(FitGraphXYDataset.java:63)
    at com.garmin.monkeybrains.fitgraphs.ui.MainUiController.buildCharts(MainUiController.java:163)
    at com.garmin.monkeybrains.fitgraphs.ui.MainUiController.buildTabs(MainUiController.java:145)
    at com.garmin.monkeybrains.fitgraphs.ui.MainUiController.actionPerformed(MainUiController.java:134)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
  • Are you providing a resource file to describe the fit contributions? In the sample project, you'd want to look at fit.xml.

    I had absolutely no problem getting this to work. The steps I followed...

    • Download the project by executing git checkout https://github.com/lcj2/ciq_monkeyfuel.git monkeyfuel from the command line.
    • Inside eclipse...
      • Import the project by clicking File > Import > General > Existing Projects Into Workspace > Next > Browse, picking the project folder and then clicking Next.
      • Build the .iq file by clicking ConnectIQ > App Export Wizard..., then selecting monkeyfuel from the Choose the project to export dropdown and clicking Finish.
      • Configure a run configuration by clicking Run > Run Configurations... > Choose a Project > monkeyfuel and then clicking the Run button.
      • The project is built and the simulator starts.

    • Inside the simulator...
      • Start activity simulation by clicking Simulation > Fit Data > Simulate Data...
      • Start activity recording by clicking the start button on the simulated device, or clicking Data Fields > Timer > Start Timer.
      • Let the simulation run for a while.
      • Insert a lap marker in the fit file by clicking the lap button on the simulated device, or by clicking Data Fields > Timer >
      • Stop activity recording by clicking the start button on the simulated device, or clicking Data Fields > Timer > Stop Timer.
      • Save the activity recording by clicking Data Fields > Timer > Save Activity.
      • Close the simulator.
      • [/list]

    • Inside eclipse start monkeygraph by clicking ConnectIQ > Start Monkeygraph.
    • Inside monkeygraph...
      • Load the .iq file by clicking File > Open IQ File, and selecting the .iq file from step 3.
      • Load the .fit file by clicking File > Open FIT file, and browsing to the .fit file in %TEMP%\Garmin\Activities.

    • [/list]


    Travis
  • FIT file generated from app sideloaded to the 735xt watch, not from the Simulator

    Sorry, I missed this before I posted above.

    Do all files like IQ, FIT and monkeygraph need to be in the same directory?

    No. I didn't need to do this in my testing.

    Do I need to be passing other command line parameters to monkeygraph?

    No, just start monkeygraph and select the files from the UI.

    Is there some more comprehensive documentation on monkeygraph?

    Not really. Just what is in the programmer's guide.

    When I export to the IQ and upload to the store, is there a way to submit NOT for publication checking by Garmin but just show I can check as a developer if it truly works.

    Yes. Put DO NOT APPROVE in the app title or description when you submit it. Once you've got it all worked out, remove that and it'll get approved.

    Travis