Missing Cresta PM808 support #17

Open
jomu opened this Issue Jul 28, 2012 · 16 comments

Projects

None yet

2 participants

@jomu

I bought a Cresta PM808 GPS watch and I think that the watch is from the NEWCO family. I can read data from the included software (from NEWCO) and from the MIO software. So I think my watch has the same communication like the MIO. I have installed the CP210x USB to UART Bridge and can communicate via this port.

But your software replies mistakes. Maybe the same problem like MIO.

I made this on you advice:
...
Another alternative is to leave everything as is and make sure you have a --debug option in your schwinn810.cmd . With that option you should get schwinn810.bin in your temporary folder like %USERPROFILE%\Local Settings\TEMP . See [2] for details. Apparently this file is incomplete but there is a chance that it has enough data for me to see what needs to be adjusted. Just send me that file. It is probably just 72 bytes long or alike.
...
Send you the schwinn810.bin via mail

@mlt mlt added a commit that referenced this issue Jul 30, 2012
@mlt An attempt to split into classes
+ Initial support towards #17
* Things may be broken
f79d895
@mlt
Owner

Does this watch have support for elevation and waypoints? I can't find that data.

@jomu

elevation:
don't think so. If I export data from NEWCO software (MapMyRun) the elevation value is every time the same (0).

waypoints:
yes, but until now I don't save one.

@jomu

I have compaired the log I send with the dates on my Cresta watch, here is my result!

Download metadata is the same as with Schwinn

Track metadata:
00210F16070C datum 00 33 15 22 07 12 Jul 22, (20)12 15:33:00
0002 laps +1 1
004D Max Speed 7,7
0017 AV Speed 2,3
65 Max HR 101
42 ?? 66
00 Track Points 00
79 ?? 121
0005 ??
30373232313031 Track name 0722101
51 Av HR 81
0910000000FD ??

Lap metadata:
00241420 Cum. Time 0 36 20 32
0001B49C Cum. Dist. 1117,72 (1,11 km)
001BA9EC Cum. Cal. 181,2972
004D Max Speed 7,7
0017 AV Speed 2,3
00 0 User lap
02B819 Cum. HR 2 184 25
0885 Num. Sec.
65 Max HR
42 Av HR
00000000 in Zone
00

01 Lap 1
00 Track 0 (1st)
FD

@mlt
Owner

Something appears shifted in your decoding, e.g., 121 is the number of points, 9 is the number of tracks. I don't know what are 66 & 5 for track.

For laps, cumulative HR is 178201, Num Sec is 2181 which roughly matches to 36:20.32 = 2180.32

Data format wiki page needs some reviewing even for Schwinn :-) So source code for now is the best reference. You can find formats in read_cresta.py.

Try to download current version either using git or as a zipball. I was able to replay dump you sent me. Though I had to unhexlify it with python's binascii.

waypoints:
yes, but until now I don't save one.

Could you create some?

@jomu

Get error message send you by mail!

@mlt
Owner

You are missing some modules as those are not a part of standard python installation on MS Windows. It is a bit involving on that platform. What you want is to install pip, then using pip install pyserial, and pytz. It is mentioned in README on the main page but perhaps it is buried under other stuff so it is not noticeable.

See http://stackoverflow.com/a/4921215/673826 on pip installation.

Or wait a couple of days till I package Windows version as I'm busy these days.

P.S. There are links in this thread on how to copy'n'paste from "DOS" window.

@jomu

It runs!
Why did I get only 3 tcx files (0722101,0728102,0729101) ? kml and gpx the same!

Here the output:

schwinn810  Copyright (C) 2012 Mikhail Titov

This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under the terms of GPL-3 or later version.

WARNING:device:File a bug if you are not using Cresta or Mio watch!
INFO:device:Found M10487 011751 E 11 01 10 00 02 03
INFO:device:We've got 10 tracks and 0 waypoints to download
INFO:device:There are 1 laps in 0722101
INFO:device:There are 1 laps in 0722102
INFO:device:There are 1 laps in 0722103
INFO:device:There are 3 laps in 0723101
INFO:device:There are 2 laps in 0723102
INFO:device:There are 1 laps in 0724102
INFO:device:There are 1 laps in 0725101
INFO:device:There are 1 laps in 0728101
INFO:device:There are 1 laps in 0728102
INFO:device:There are 1 laps in 0729101
Fetching track 0/9
INFO:device:Fetching 121 points from 0722101
0%
83%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0722101
Fetching track 1/9
INFO:device:Fetching 201 points from 0722102
0%
d:\gps\My Runs\0722101.kmz konnte nicht gefunden werden
50%
100%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0722102
Fetching track 2/9
INFO:device:Fetching 1043 points from 0722103
0%
unicsv: Invalid latitude 10000000000000001000000000.000000 in waypoint .
d:\gps\My Runs\0722102.kmz konnte nicht gefunden werden
10%
19%
29%
38%
48%
58%
67%
77%
86%
96%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0722103
Fetching track 3/9
INFO:device:Fetching 685 points from 0723101
0%
Invalid longitude 166666666666668110000000.000000 in waypoint .
d:\gps\My Runs\0722103.kmz konnte nicht gefunden werden
15%
29%
44%
58%
73%
88%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0723101
Fetching track 4/9
INFO:device:Fetching 236 points from 0723102
0%
unicsv: Invalid latitude 10000000000000001000000000.000000 in waypoint .
d:\gps\My Runs\0723101.kmz konnte nicht gefunden werden
42%
85%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0723102
Fetching track 5/9
INFO:device:Fetching 578 points from 0725101
0%
unicsv: Invalid latitude 10000000000000001000000000.000000 in waypoint .
d:\gps\My Runs\0723102.kmz konnte nicht gefunden werden
17%
35%
52%
69%
87%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0725101
Fetching track 6/9
INFO:device:Fetching 293 points from 0728101
0%
unicsv: Invalid latitude 10000000000000001000000000.000000 in waypoint .
d:\gps\My Runs\0725101.kmz konnte nicht gefunden werden
34%
68%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0728101
Fetching track 7/9
INFO:device:Fetching 1294 points from 0728102
0%
unicsv: Invalid latitude 10000000000000001000000000.000000 in waypoint .
d:\gps\My Runs\0728101.kmz konnte nicht gefunden werden
8%
15%
23%
31%
39%
46%
54%
62%
70%
77%
85%
93%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0728102
Fetching track 8/9
INFO:device:Fetching 1008 points from 0729101
0%
d:\gps\My Runs\0728102.kmz konnte nicht gefunden werden
10%
20%
30%
40%
50%
60%
69%
79%
89%
99%
INFO:writer:Calling D:\gps\mlt-schwinn810-f79d895\src\\babelize.cmd
        with d:\gps\My Runs\0729101
Done
INFO:writer:Writer destroyed
Drücken Sie eine beliebige Taste . . . d:\gps\My Runs\0729101.kmz konnte nicht gefunden werden
@mlt
Owner

Wow! That was fast!

unicsv: Invalid latitude 10000000000000001000000000.000000 in waypoint .

I've noticed that as well. I did not figure out yet what is causing this. I feel like if I manually call gpsbabel, then it works okay. First time I thought it is empty columns in charge.

There is also a chance that it is because I don't close files explicitly after I reorganized the code. I'd say this chance is high.

Why did I get only 3 tcx files (0722101,0728102,0729101) ? kml and gpx the same!

Unfortunately, I have no answer yet. Could you visually inspect, perhaps with MS Excel, if dot track, dot laps, and dot points files look okay and if there is some other information that is missing that is reported otherwise with Cresta/Mio software?

Could you try manually call babelize.cmd with any those dot track files for which TCX, KML, and GPX are missing?

I will adjust the code to close files explicitly.

@mlt mlt added a commit that referenced this issue Jul 31, 2012
@mlt Code cleanup
* Writer closes files before calling a hook

Should help with #17
7589729
@jomu

try to import 0729101.tcx to sport tracks (2.1)
2 problems:
AverageHeartRateBpm 139.878
have to change to
AverageHeartRateBpm 139
then the import runs
Time is wrong.
Here the correct time from 0729101.track

Start,End,Laps,MaxHeart,Heart,MaxSpeed,Speed,x4,x5,Points,Track
2012-07-29 19:29:00,,1,235,142,40.9,27.2,96,864,1008,0729101

Here thr wrong result in 0729101.tcx:

      <Lap StartTime="2012-07-30T00:29:42Z">
@jomu

Why did I get only 3 tcx files (0722101,0728102,0729101) ?
I found error in dot kmz files.
for example 0725101.kmz look like this:
PK####################
No Data!

@mlt
Owner
mlt commented Aug 1, 2012

Time is wrong

As the matter of fact, it is not. You are in a different time zone namely UTC+1 and not UTC-5. Many online services erroneously require time stamps in TCX to be in UTC. Therefore conversion is performed.

Strictly speaking this should be based on the TimeZone data you SET in your watch, let's say for T1. However, settings format reported by watch is still something that needs investigation. If you don't mind exposing your personal data (height, weight, age) as you entered those in your watch, you can send me yet another log based on READ SETTINGS command. Feel free to use fake data but I'm not going to expose it if you have concerns. Just sent me a log by mail and data you entered with SET.

So for now, you can just use --tz Europe/Berlin when using csv2tcx.py (or exe). It is mentioned in another issue.

Why did I get only 3 tcx files

Is it still the same with latest code revision? I feel like closing files before calling a hook helped. Set up TortoiseGit it would be easier to pull code updates rather than downloading and unpacking zip files.

for example 0725101.kmz look like

KMZ is just compressed KML. Make sure KML looks correct first.

@jomu

TimeZone was wrong in my watch, you are right. I adjust it right now to +1 and will test it later at home.
I haven't install the code reversion. Try it later at home too.

@jomu

With new code all tcx files creating. No errormessage.
Time problem don't solve with change settings in watch.
Here is the result from READ SETTINGS command: 11101110 11101110
Where is csv2tcx.py (or exe) used? Can't find it.

@jomu

Find the time problem:
Calling gpsbael with option utc=5 have to be deleted

Last problem:
AverageHeartRateBpm 139.878
have to change to
AverageHeartRateBpm 139

How to do it?

@mlt
Owner
mlt commented Aug 3, 2012

Here is the result from READ SETTINGS command: 11101110 11101110

What? It was supposed to return either 36 bytes (for Schwinn) or perhaps 32 bytes in case of Cresta/Mio.

Di you issue CONNECT command first?

Where is csv2tcx.py (or exe) used? Can't find it.

It can be used in a hook that you provide to download.py, it is likely it is named babelize.cmd. I feel like I left it out of babelize.cmd but you can see the idea in babelize.sh. You are free to call any postprocessing code in hook script, e.g. upload data to on-line services.

Calling gpsbael with option utc=5 have to be deleted

I believe, you still want to use utc=-1 or so.

I'll fix rounding for AverageHeartRateBpm.

@mlt
Owner
mlt commented Aug 3, 2012

AverageHeartRateBpm 139.878

It appears that you are using gpsbabel to get TCX. There are some limitations with that. Use csv2tcx.py instead of gpsbabel for TCX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment