fit parsing with custom fields

Hello another questions here

I need custom field in the user fit. So :

1. Can we add custom field with langage like Python?

and

2.Can we parse those fields in monkey C, I've found https://developer.garmin.com/downloads/connhttps://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/ActivityRecording/Session.htmlct-iq/monkey-c/doc/Toybox/FitContributor/Field.html for creating field but how to parse them? I know Persisted Content but with DataField it failed (I've tried to do it in Background also but with no succes)

I speak about fit format because it seems that gpx is not supported on some devices (am I wrong?) and if I'm wrong, same question, how to parse custom fields?

Thanks in advance

Greetings

  • From Connect IQ, you can cause a .fit to be written (recording an activity) but you can not read a .fit file.

    The API allows writing a user defined field to the .fit while recording.

  • OK Jim if I understand well it will be easier to get those field via a custom json. Then, the only constraint is that the user must be connected to the internet, is that right?
    Also, I've heard about dialoguing with the phone, in that case can we send one specific file?

  • To answer, tell us what it is you're trying to do - maybe a bigger picture.  It sounds like you have some data you want to make available to your app, so the most straight forward way to do that may be to just use app settings, for example.

  • Jim, I'm making an app for a company with the aim to improve and optimize cycling training.
    What is displayed is helping info, current and targeted power / speed / percent of the targeted heart rate and some more complicated data.
    So we will have a site which will parse fit and generate Json with all the extra infos for optimizing the training.
    This is that Json we need to be available and after thinking download the Json may not be a possibility anymore because this file is personalized. Also, I'm open to another format than Json if needed

  • Ok, if you can get the data in a json format, from your app, you can use a makeWebRequest to get it and not actually pull a file.

    To get the correct data for a specific user, you could do something like OAuth (I admit I've never used this, but there are deatils in the programmer's guide), or supply an identifier in the makeWebRequest itself to get the correct data. 

  • Thanks Jim for OAuth I've founded this :www.programmableweb.com/.../05 Not so simple but it seems well explained.

  • Are you having issues parsing the FIT file to find these data fields?  Sounds like your team already has the capability to parse FIT files.

    Who is the consumer?  Is it a watch app that is making the request for this data?  Or is it just a web site or phone/desktop app that is making use of this data?

    What is the actual flow of data? This is what I'm getting from the thread above.

    1. You have a CIQ app or data field that adds custom fields to the FIT file.

    2. You have a server that can parse FIT files - presumably understands how to parse the custom fields you've added.

    3. You have client apps that want to get access to this data and you've provided a mechanism to get them through JSON.  Or is this where you are stuck?  If it isn't a CIQ app or data field that is wanting to request this data, this no longer has anything to do with Connect IQ.

  • Hello ekutter thanks for your reply. We have a website wich parse standard fit files and compute some personalized data like the targetted power for each section of a training section. Then those new data are stored in a json which will be available after user login.
    So we need both standard data fields like speed and distance and some non-standard ones

  • once you’ve gotten the JSON Data (converted from FIT) how are you then using those data? Can the JSON data be used within a datafield?

  • You can do makeWebRequest() calls in the background process for a DF.