How to create valid dive_summary message?

Is there any documentation on how to create a valid dive_summary message in a FIT file? I'm using the latest FIT SDK to write a simple Java program to convert some old Suunto dive log files into FIT format so that I can import them into Garmin Connect. I have other message types working correctly and can import a dive to see the depth chart. But as soon as I add a dive_summary message, the Garmin Connect web site refuses to import the FIT file with this error message: "An error occurred with your upload. Please try again." There's no indication about what's wrong with the message.

  • Hey nradov,

    Nice one on the Suunto conversion program!
    It sounds like you have most of the hard work done already. Looking at the Dive Summary info, I would think it should not be that hard to create/convert.
    Looking at mine (for descent mk2) I can see each fit file contains 2 rows for Dive Summary.
    One for Lap and One for Session (reference_mesg).

    The most amount of detail is in the “session” where it contains values for: timestamp, avg_depth, max_depth, surface_interval, dive_number, bottom_time, field 15, field 16, avg_ascent_rate, reference_mesg, start_n2, end_n2, o2_toxicity, field 12, field 13, field 14, start_cns, end_cns, field 21.

    I would not think that most of those are required fields however some may be like “dive_number”.

    I presume you have dives already completed on your Garmin device?
    If so I would suggest getting the fit file you have from one of the “Garmin device” dives and then putting it into an online tool like https://www.fitfileviewer.com/ (I know you can pull all this via Java, but some times its good to see it with an external tool to remove any programming bias Blush )
    Then having a look at the fields filled out in the “Garmin device” fit file, try and reverse engineer it?

  • I did eventually get it working just by trial and error (no thanks to the lack of documentation and useless error messages). The fit file viewer site is indeed helpful. The dive_summary message code is here if anyone wants to take a look.

    github.com/.../SdeToFit.java

  • Well done on getting it completed.

    I feel your pain on the documentation side.

    Thanks for sharing the code also.