Shearwater Teric

Dirk Hohndel dirk at hohndel.org
Sat Sep 8 21:14:51 PDT 2018


> On Sep 8, 2018, at 1:58 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> 
> I have a first version of the "Petrel Native Format" log parser working.

And this can now be found here for libdivecomputer (sorry, it's the Subsurface flavor with string support)
https://github.com/Subsurface-divelog/libdc/commits/teric
and here
https://github.com/Subsurface-divelog/subsurface/tree/teric

Test binaries should be available soon here
https://github.com/Subsurface-divelog/subsurface/releases/tag/continuous-teric

> It turns out that while the Teric is the first Shearwater computer that no longer provides the old "Predator-like" log format, the new format was actually added way back for the Petrel, it just hadn't been documented before.
> Based on the new documentation we received last week I have modified the parser to figure out which log format the dive computer can provide and updated it to parse the PNF log if that is available.

This is all still true, and downloads of dives from the Teric appear correct and download of dives from two older Shearwater divecomputers still appear to work as expected.

> Downloads from my Teric look sane (but I have only a few dives on it and nothing really exciting in those dives). I'll clean up the code and post it on GitHub so people can take a look, and I'll also make test binaries available so people can try it. The interesting part is that this code will be used on most every current Shearwater dive computer because as I said, all but the oldest of them support this format and Shearwater recommends using it instead of the older format. Which means there's a LOT of testing we need to do to ensure that nothing got broken.

It turns out this was a misreading of the documentation. Indeed, since Firmware v40 a lot of the older Shearwater dive computers support log version 7 and a slightly different version of the Petrel Native Format. But even the latest firmware of the Perdix AI does not support the "Petrel Native Format with Final Record" that the Teric supports (I need to put a new dive on it to see if it will now report log version 9 otherwise). But my assumption is that newer firmware might change this and that the older dive computers may eventually also support the new Teric format.  

> One of the new things in this log format is a free diving mode that allows storing sample at sub-one-second intervals. I am not decoding those samples, yet. And I am trying to figure out what to do about them in the first place, as a lot of the libdivecomputer (and Subsurface) code assumes a 1 second granularity...
> 
> Should we drop the additional samples? Should we add them all, just with the same time stamp? Should we increase the time stamp resolution?

For now I error out on those.

I haven't gone through this with a fine tooth comb to see if there are more fields that we should parse. One thing that jumps out is the better battery voltage measurement (that only applies to the Subsurface flavor of libdivecomputer - upstream doesn't do strings and therefore doesn't provide that information in the first place).
I did, however, notice two bugs in the existing code - at least based on the documentation: the maxdepth field needs to be decided by 10 in log version 9 (but from the docs it looks like that should be the same in earlier log versions - but I don't think that's true). Also, the dive time should be three bytes in seconds, but the current code reads two bytes and assumes that to be minutes.

Jef, can you take a look at that and help me figure out what's going on? I'm confused.

Anyway, with all that said - looks like Teric support is pretty much there...

/D


More information about the subsurface mailing list