Hi there,
I am using Subsurface and it reports all my salt water dives deeper than they really are. So I downloaded the latest libdivecomputer sources and looked at the code. The tec2g_header claims that the salinity setting of this dive computer is not supported.
After looking at the dumps included in my SmartTRAK log where the dives are correctly reported (SmartTRAK is nice enough to store the original dc data), I am most certain to have located the salinity field in byte 62 of the header. Another indication is that it is also bit 0x10 as it is for the others (see get water in uwatec_smart_parser_cache).
Just tried out setting the salinity field to 62 and works perfectly fine for me.
Similarly, the timezone field most likely is 16. However, that one I cannot test so well because the immersion time seems to be relative to the dive computers system time which seems to be missing in the SmartTRAK logs. But manually looking at the time zones, it matched for the first 50+ of my dives.
I also figured out the max ppo2 configuration and partially the tissue saturation before the dive --- if anybody is interested that data as well. See http://tomsblog.gschwinds.net/2016/08/uwatec-smarttrak-and-aladin-tec2g/ for details.
Best, Thomas
On 2016-08-05 00:03, Thomas Gschwind wrote:
I am using Subsurface and it reports all my salt water dives deeper than they really are. So I downloaded the latest libdivecomputer sources and looked at the code. The tec2g_header claims that the salinity setting of this dive computer is not supported.
After looking at the dumps included in my SmartTRAK log where the dives are correctly reported (SmartTRAK is nice enough to store the original dc data), I am most certain to have located the salinity field in byte 62 of the header. Another indication is that it is also bit 0x10 as it is for the others (see get water in uwatec_smart_parser_cache).
Just tried out setting the salinity field to 62 and works perfectly fine for me.
Similarly, the timezone field most likely is 16. However, that one I cannot test so well because the immersion time seems to be relative to the dive computers system time which seems to be missing in the SmartTRAK logs. But manually looking at the time zones, it matched for the first 50+ of my dives.
I also figured out the max ppo2 configuration and partially the tissue saturation before the dive --- if anybody is interested that data as well. See http://tomsblog.gschwinds.net/2016/08/uwatec-smarttrak-and-aladin-tec2g/ for details.
Your investigation for the timezone and salinity fields appear correct to me. Will you submit a patch?
BTW, in your blog you write libdivecomputer "prefers to read the data from the dive computer itself", but parsing dives "offline" is fully supported too. Take a look at libdivecomputer's dctool application:
$ dctool help parse Parse previously downloaded dives
Usage: dctool parse [options] <filename>
Options: -h, --help Show help message -o, --output <filename> Output filename -d, --devtime <timestamp> Device time -s, --systime <timestamp> System time -u, --units <units> Set units (metric or imperial)
The "devtime" and "systime" options are there to synchronize the device and system (host) clocks. During a download libdivecomputer will get those two values, and take care of them internally. But when you intend to parse the dives at a later time, you should preserve those two values yourself. As you already discovered, smarttrak doesn't do that (it stores the parsed date/time, so it no longer need those two clock synchronization values). But there is no reason why you can't use the values of another download.
# Download the dives: dctool -l dctool-download.log -f smart download -f raw -o dive.%n.bin
# Get the clock synchronization values: grep -e systime -e devtime dctool-dowload.log
# Parse the dives (or the ones in your smarttrak database): dctool -l dctool-parse.log -f smart parse -d $DEVTIME -s $SYSTIME -o dctool.xml dive.%n.bin
Jef
Hi Jef,
On Fri, Aug 5, 2016 at 9:26 AM, Jef Driesen jef@libdivecomputer.org wrote:
Your investigation for the timezone and salinity fields appear correct to me. Will you submit a patch?
I can create one tonight. I did not know which was the preferred way so I chose the cheapest solution first.
BTW, in your blog you write libdivecomputer "prefers to read the data from the dive computer itself", but parsing dives "offline" is fully supported too. Take a look at libdivecomputer's dctool application:
In case of the Uwatec, there were a few nits, mostly related to the salt/fresh water problem which is fixed with the above, so should be solved already. I removed the sentence from the blog since I plan (no promises when or ever finished) to write a SmartTRAK importer for subsurface I will look again at dctool parse. Should there be something left where the external API is insufficient, I would let you know.
Best, Thomas
On 05-08-16 11:44, Thomas Gschwind wrote:
On Fri, Aug 5, 2016 at 9:26 AM, Jef Driesen jef@libdivecomputer.org wrote:
Your investigation for the timezone and salinity fields appear correct to me. Will you submit a patch?
I can create one tonight. I did not know which was the preferred way so I chose the cheapest solution first.
Patch has been applied. Thanks for your contribution!
BTW, in your blog you write libdivecomputer "prefers to read the data from the dive computer itself", but parsing dives "offline" is fully supported too. Take a look at libdivecomputer's dctool application:
In case of the Uwatec, there were a few nits, mostly related to the salt/fresh water problem which is fixed with the above, so should be solved already. I removed the sentence from the blog since I plan (no promises when or ever finished) to write a SmartTRAK importer for subsurface I will look again at dctool parse. Should there be something left where the external API is insufficient, I would let you know.
Everything should be there to implement an importer, but if there is something missing, or your need some help, just let me know!
Jef
--- src/uwatec_smart_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index eaa72d6..1920245 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -209,8 +209,8 @@ uwatec_smart_header_info_t uwatec_smart_aladin_tec2g_header = { 28, /* temp_maximum */ 32, /* temp_surface */ UNSUPPORTED, /* tankpressure */ - UNSUPPORTED, /* salinity */ - UNSUPPORTED, /* timezone */ + 62, /* salinity */ + 16, /* timezone */ };
static const
On 2017-06-01 20:46, Stefan Molitor wrote:
I cant download the dives with dctool on COM5?
Can you tell me what i make false :-)
dctool -l dctool-download.log -f perdix -d COM5 download -f raw -o dive.%n.bin
dctool -l dctool-download.log -d "Shearwater Perdix" download -f raw -o dive.%n.bin COM5
or
dctool -l dctool-download.log -f petrel download -f raw -o dive.%n.bin COM5
Jef