Suunto Downloader: Version 3 Beta /w Vyper2/Cobra2 support

3rd party extensions (phpDivingLog, dive computer downloader,...)
Post Reply
James Connell
Posts: 103
Joined: Fri Dec 08, 2006 05:33
Location: Alaska, USA
Contact:

Suunto Downloader: Version 3 Beta /w Vyper2/Cobra2 support

Post by James Connell »

Well, I finished it.

And immediately found a bug :oops:

I have an Beta release of version 3.0 on my site.

It's V 2.9.4.6 and it should work with all models of Suunto dive computers from vyper/cobra to D to the new V/C2 models -Yes you read that right!!!!
The Cobra2/Vyper2 are now supported!

And all with DivingLog 4.0.

I need someone to at least try to run this and report if it does anything!
Let me explain, I use an IDE ( Integrated Development Envirorment) for the programming. That's fine, except the IDE in order to save time uses a lot of DLLs, the worst part of this is making sure all the DLLs got into the release package. I have trouble checking this as they are all on my system so I'll get no errors. I have a program to check, but it sometimes misses.

Well give it a try and let me know if it works, please.

I should mention that those of you with the new "CustomIdea" cable ( the type with a straight plug ) are out of luck for the new C2/V2. There is a design flaw in that cable and it will not trigger the C2/V2 to go into download mode.
The good news is - if you have an old style 'CustomIdea' cable, It will work fine with the downloader, but not with Suunto's SDM.
Last edited by James Connell on Thu Nov 15, 2007 01:52, edited 2 times in total.
JConn Inv.
Software Tools for Suunto Dive Computers
http://LiquidImagePhoto.com
James Connell
Posts: 103
Joined: Fri Dec 08, 2006 05:33
Location: Alaska, USA
Contact:

Lastest Version

Post by James Connell »

I have a new build on the site.
I have tested this with all basic computer types and it seems to be fine.
It has been tested with a Vyper, a Vytec, a D9, and a Cobra2. but only the Vyper and Vytec had dives on them. I need reports from users of the other types, please.

If it gives any trouble - please report this and send me this file : c:\CDBLOG.txt
JConn Inv.
Software Tools for Suunto Dive Computers
http://LiquidImagePhoto.com
mhedstrom
Posts: 46
Joined: Wed Jun 06, 2007 23:21

Post by mhedstrom »

Just tried it with my Cobra 2 (sorry, been way busy and haven't had a chance to test it before), and got the following error:

15:48:21_922_5D8: Debug:: CommandLine = "C:\Program Files\Diving Log 4.0\SuuntoXML.exe" -File="C:\Program Files\Diving Log 4.0\SuuntoXML.xml" -Port="COM3" -version=1
15:48:21_937_5D8: Detail:: TsAPIThread: Create()
15:48:21_969_5D8: Detail:: Gradient "ON"
15:48:21_984_5D8: Detail:: TsAPIThread: Set() with: file="C:\Program Files\Diving Log 4.0\SuuntoXML.xml" port="\\.\COM3" delay=6 DeviceOptions=0xF OutputOptions=0x46
15:48:34_906_600: Info:: Did Not Find Device Type 1
15:48:38_094_600: Detail:: sAPI_Device_TypeD::getheader: Exception Caught
15:48:41_594_600: Detail:: sAPI_Device_TypeD::getheader: Exception Caught
15:48:45_109_600: Detail:: sAPI_Device_TypeD::getheader: Exception Caught
15:48:48_609_600: Detail:: sAPI_Device_TypeD::getheader: Exception Caught
15:48:49_109_600: Info:: Did Not Find Device Type 2
15:48:51_094_600: Info:: Found Device Type 3
15:48:51_094_600: Info:: Downloading Device
15:48:56_578_600: Error:: sAPI_Device_TypeCV2::Read: Exception Raised
15:48:56_578_600: Error:: Download Device with - Listen: Partial Read Time Out
15:48:59_078_5D8: Detail:: TsAPIThread: Destroy()
15:48:59_078_5D8: Info:: FormClose(): Returning 16
TnT
Posts: 262
Joined: Thu Nov 29, 2007 14:53
Contact:

Re: Lastest Version

Post by TnT »

James Connell wrote:I have a new build on the site.
I have tested this with all basic computer types and it seems to be fine.
It has been tested with a Vyper, a Vytec, a D9, and a Cobra2. but only the Vyper and Vytec had dives on them. I need reports from users of the other types, please.
I'm also writing an application for downloading data from a suunto dive computer. Unfortunately, I don't own a D6/D9 to test with. Could you send me some example memory dumps? I'm particularly interested in a memory dump from one of those DC without any dives. Thanks.

BTW, I already have a test application for the suunto vyper (and all compatible computers: Cobra, Stinger, Mosquito, Vytec en Gekko) and the D6/D9 on my website:

http://users.telenet.be/sacn/suunto/vyper.exe
http://users.telenet.be/sacn/suunto/d9.exe

The test application for the vyper creates two memory dumps and collects some additional information. For the D9 only a memory dump is created, which I need for further analysis. If someone wants to help me, you can run the provided test application and email the created files. If the divecomputer is not attached to COM1, the correct port can be specified on the commandline like this:

vyper.exe COMx
James Connell
Posts: 103
Joined: Fri Dec 08, 2006 05:33
Location: Alaska, USA
Contact:

Re: Lastest Version

Post by James Connell »

TnT wrote:I'm also writing an application for downloading data from a suunto dive computer. Unfortunately, I don't own a D6/D9 to test with. Could you send me some example memory dumps? I'm particularly interested in a memory dump from one of those DC without any dives. Thanks.
I have a few, send me an email address and I'll get them to you.

It's a real bugger trying to do this without MULTIPLE computers to work with.
There are timing variations between individuals of each model that are difficult to get around.

You are doing things the slow way, reading memory byte by byte (or even 32 bytes at a time) is not effective on the Vyper models. You'll find it is the slowest way to get the dives out and you must parce them yourself. Better to use the 8/9 commands and let the dive computer do the work ;-) That method is not available on the D series however.
How did you decode the profile on the Ds? Suunto did a good job with obfuscating that.


Speaking of which - I have a new version on the site that MAY work with the C2V2s and seems to solve the last problem with the D profiles.
JConn Inv.
Software Tools for Suunto Dive Computers
http://LiquidImagePhoto.com
TnT
Posts: 262
Joined: Thu Nov 29, 2007 14:53
Contact:

Re: Lastest Version

Post by TnT »

James Connell wrote:I have a few, send me an email address and I'll get them to you.
You can send the memory dumps to jefdriesen_at_hotmail.com.
James Connell wrote:It's a real bugger trying to do this without MULTIPLE computers to work with.
There are timing variations between individuals of each model that are difficult to get around.
I didn't noticed very large timing variations so far. Only many variations in the types of interfaces.
James Connell wrote:You are doing things the slow way, reading memory byte by byte (or even 32 bytes at a time) is not effective on the Vyper models. You'll find it is the slowest way to get the dives out and you must parce them yourself. Better to use the 8/9 commands and let the dive computer do the work ;-) That method is not available on the D series however.
The test program uses both methods (for verification). First the fast one, than the slow one.
James Connell wrote:How did you decode the profile on the Ds? Suunto did a good job with obfuscating that.
I didn't implemented that yet. However a large part is already documented here: http://www.sarnau.info/papers:suunto_protocol
James Connell wrote:Speaking of which - I have a new version on the site that MAY work with the C2V2s and seems to solve the last problem with the D profiles.
Are the commands different than for the D models?
James Connell
Posts: 103
Joined: Fri Dec 08, 2006 05:33
Location: Alaska, USA
Contact:

Re: Lastest Version

Post by James Connell »

TnT wrote: You can send the memory dumps to <removed>
I wouldn't do that, this forum has been mined for addresses before.
TnT wrote:
James Connell wrote:It's a real bugger trying to do this without MULTIPLE computers to work with.
There are timing variations between individuals of each model that are difficult to get around.
I didn't noticed very large timing variations so far. Only many variations in the types of interfaces.
James Connell wrote:You are doing things the slow way, reading memory byte by byte (or even 32 bytes at a time) is not effective on the Vyper models. You'll find it is the slowest way to get the dives out and you must parce them yourself. Better to use the 8/9 commands and let the dive computer do the work ;-) That method is not available on the D series however.
The test program uses both methods (for verification). First the fast one, than the slow one.
James Connell wrote:How did you decode the profile on the Ds? Suunto did a good job with obfuscating that.
I didn't implemented that yet. However a large part is already documented here: http://www.sarnau.info/papers:suunto_protocol
James Connell wrote:Speaking of which - I have a new version on the site that MAY work with the C2V2s and seems to solve the last problem with the D profiles.
Are the commands different than for the D models?
Not commands - you still use command 0x5 to read memory, what does seem to vary is the 'recovery' time. The time needed to wait before a second command is given.
The Interfaces all use different signal levels, even the C2/V2 which uses the same cable as the Vyper has differences and not just baud rate.

Don't rely to heavily on the source you site - it has a number of errors. Some worse than others; for instance you can ignore the part about 'AT' as an interface check - that hasn't worked in years - and that is just the beginning.
JConn Inv.
Software Tools for Suunto Dive Computers
http://LiquidImagePhoto.com
WARLOCK
Posts: 25
Joined: Wed Nov 21, 2007 12:53

Post by WARLOCK »

I have tried this app and it fails to find my D9 I know the D9 is connected because SDM connects and downloads the logs,

my USB is emulated onto COM4
James Connell
Posts: 103
Joined: Fri Dec 08, 2006 05:33
Location: Alaska, USA
Contact:

Post by James Connell »

WARLOCK wrote:I have tried this app and it fails to find my D9 I know the D9 is connected because SDM connects and downloads the logs,

my USB is emulated onto COM4
Which App?? His or Mine?

If it's mine, then you really need to run it from inside Diving Log as the "Suunto Transfer" option.

You do this by opening the Diving Log program folder - default is "C:\Program Files\Diving Log 4.0".
Start by renaming the SuuntoXML.exe file to (as a sugestion: SuuntoXML.bac.exe).
Than extract the downloaded file to the same directory.
Now start DivingLog4.0 and run the 'Suunto Transfer' function.
The reasons for all this are because the downloader is designed to be a 'child' program spawned by a parent. It needs a lot of info sent to it in the command line to fully function.
Last edited by James Connell on Fri Nov 30, 2007 06:57, edited 1 time in total.
JConn Inv.
Software Tools for Suunto Dive Computers
http://LiquidImagePhoto.com
divinglog
Site Admin
Posts: 5768
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Post by divinglog »

You can use the private message function of the forum to exchange email addresses to avoid spam bots to scan them. It's really a pain with these bots.
TnT
Posts: 262
Joined: Thu Nov 29, 2007 14:53
Contact:

Re: Lastest Version

Post by TnT »

James Connell wrote:You are doing things the slow way, reading memory byte by byte (or even 32 bytes at a time) is not effective on the Vyper models. You'll find it is the slowest way to get the dives out and you must parce them yourself. Better to use the 8/9 commands and let the dive computer do the work ;-) That method is not available on the D series however.
I suppose suunto does not use the fast transfer method for the D models anymore because there are some problems with it:

1. Since the size of a dive profile is not known in advance, there is no 100% reliable method to know where the profile ends.

One solution is reading until you receive a data packet that is smaller than 32 bytes. In that case you know it was the last packet of data. But it does not work if the last packet is exactly 32 bytes long.

Another solution is reading until a timeout occurs. This works for all packet sizes, but makes it impossible to know the difference between a real timeout (e.g. connection problems) and the end-of-profile timeout (e.g. all data has been received). Thus if a real timeout occurs, it will be considered as the end of the profile and you end up with an incomplete profile. The end marker (byte 0x80) does not help here, because the data is transfered in reverse order. This is not ideal, but it's the only method I know of that works if the last packet is exactly 32 bytes long. This method it is used by many if not all transfer applications (including the one from suunto, mine and also yours).

Of course both methods can be combined.

2. There is no way to retry downloading a particular dive profile after a temporary error (timeout, checksum error) is detected. You can only restart the entire transfer.
TnT
Posts: 262
Joined: Thu Nov 29, 2007 14:53
Contact:

Re: Lastest Version

Post by TnT »

James Connell wrote:Not commands - you still use command 0x5 to read memory, what does seem to vary is the 'recovery' time. The time needed to wait before a second command is given.
The Interfaces all use different signal levels, even the C2/V2 which uses the same cable as the Vyper has differences and not just baud rate.
I noticed SDM versions 2.2 (and later) is using this code to download from the vyper:

Sleep (500);
EscapeCommFunction (SETRTS);
WriteFile (command);
Sleep (200);
EscapeCommFunction (CLRRTS);
ReadFile (answer);

Reading is made more complicated than necessary by using additional threads (one for reading and one for watching events). But in the end the timeouts are 1000ms for a "read memory" command, 2000ms for the first packet of a "read profile" command and 750ms for all following packets.

I'm using exactly the same sequence. I only added an extra call to PurgeComm before clearing RTS, to make it work with interfaces that send an echo. I suppose Suunto knows what they are doing, so I believe those timings should work well.

I don't know if they are using something different for the later types (D series and vyper2). If that's the case, it's quite easy to obtain the new values by monitoring a download session.
James Connell wrote:Don't rely to heavily on the source you site - it has a number of errors. Some worse than others; for instance you can ignore the part about 'AT' as an interface check - that hasn't worked in years - and that is just the beginning.
Why not share your information and publish your corrections? So everyone can benefit from it.

The 'AT\r' command does still work for the older serial interface. I don't know about the newer USB versions. It is not supposed to work with a DC already attached. It doesn't really matter, because I'm using it in my test application only to have some extra debugging information.
WARLOCK
Posts: 25
Joined: Wed Nov 21, 2007 12:53

Post by WARLOCK »

James Connell wrote:
WARLOCK wrote:I have tried this app and it fails to find my D9 I know the D9 is connected because SDM connects and downloads the logs,

my USB is emulated onto COM4
Which App?? His or Mine?

If it's mine, then you really need to run it from inside Diving Log as the "Suunto Transfer" option.

You do this by opening the Diving Log program folder - default is "C:\Program Files\Diving Log 4.0".
Start by renaming the SuuntoXML.exe file to (as a sugestion: SuuntoXML.bac.exe).
Than extract the downloaded file to the same directory.
Now start DivingLog4.0 and run the 'Suunto Transfer' function.
The reasons for all this are because the downloader is designed to be a 'child' program spawned by a parent. It needs a lot of info sent to it in the command line to fully function.
Yours and cool that's what I was doing wrong, also the Project1 app for setting the D9 is not connecting to my watch, must this run under dive log too?
TnT
Posts: 262
Joined: Thu Nov 29, 2007 14:53
Contact:

Post by TnT »

divinglog wrote:You can use the private message function of the forum to exchange email addresses to avoid spam bots to scan them. It's really a pain with these bots.
The email address is already available to the bots through the email button on this forum. So it was already there. Anyway, I have my hotmail address for using it on public forums, so I can keep my personal email address safe.
James Connell
Posts: 103
Joined: Fri Dec 08, 2006 05:33
Location: Alaska, USA
Contact:

Post by James Connell »

WARLOCK wrote:Yours and cool that's what I was doing wrong, also the Project1 app for setting the D9 is not connecting to my watch, must this run under dive log too?
No, Project1 will not work with the D models. That program is for the old Cobra/Vyper computers ONLY! There is almost nothing on a D ( and, it seems, on the new C2/V2 even less) that can be set (or even read) via software. The 'Personal info', Units, and, if you so wish, the reported 'serial number/date of manufacture' is all there is. You can change the total dives,accumulated time and max depth too, but that is problematic as it is checksummed.
JConn Inv.
Software Tools for Suunto Dive Computers
http://LiquidImagePhoto.com
Post Reply