Di2 battery level

I want to display the Di2 battery level in my application, it is displayed in my Garmin Edge 1030 and is from the Di2 D-Fly.

I found this field com.garmin.fit.ExdDescriptors.DI2_BATTERY_LEVEL which may contain the value which I'm looking for.

This field is available in the message listener public ExdDescriptors com.garmin.fit.ExdDataConceptConfigurationMesg.getDescriptor() which is called from this message com.garmin.fit.MesgNum.EXD_DATA_CONCEPT_CONFIGURATION = 202, however in my .fit files I cannot see this message number 202.

Is there any other possibility to get the Di2 battery level from a .fit file or is is just not written into this file?

  • There is battery_level field in the device_info message. It is newish and not in the public SDK yet. But we will add it to the public SDK later this year. Probably November or December. It is too late to get it into the upcoming October release.

    The field id is 32, it is an uint8, and is a whole number percent. That is what you need to know to read the value, even before it is documented in the public SDK.

    Shimano's manufacturer id is 41, which you can use to filter the device_info messages. Then sort those results by the timestamp and pick the most recent message. Then call the GetFieldValue method. Depending on the SDK you are using it may look like this.

    Java:
    device_info_mesg.getFieldShortValue(32, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD)

    or this in C#

    device_info_mesg.GetFieldValue(32, 0, Fit.SubfieldIndexMainField)

    Look at the other getter methods on the device_info message in the SDK that you are using for a more complete example of what to do.

  • This sounds great, I'll test it in the next few days

  • I can confirm that I get the field num 32, however I had to update my Edge 1030 firmware from 9.50 to 12.20. With the old firmware it was not written into the .fit file -> currently I've only one file to test it. The current value is 100 which is the same as on the Edge display.