Pitmairen / bryton-gps-linux

An attempt to read Bryton GPS devices on Linux
GNU General Public License v3.0
29 stars 14 forks source link

Rider 50 not supported #16

Open katterfelto opened 11 years ago

katterfelto commented 11 years ago

The rider 50 seems similar to the rider 20p the differences that I can see are:

The contents for /dev/disk/by-id are: usb-Bryton_Flash_Disk_PRAHA_Device-0:0@ usb-Bryton_Flash_Disk_PRAHA_Device-0:0-part1@ usb-Bryton_Flash_Disk_PRAHA_Device-0:0-part5@ usb-Bryton_MicroSD_PRAHA_Device-0:1@

The files are in a different directory structure. The cycling data is stored in the following path below the mount point:

thalia/applications/CYCLING/DATA/TRACELOG

This folder seems to have all the data for each run. Each run contains 4 files, the first part of the name is numeric and unique to that recording and the second half finish as follows: .-GPS.dat -STA.xml -TRN.dat -USR.xml

If I can figure out how I will attach an archive with a set of sample files.

I've emailed you the 4 files, but read a bit more of the 20p issue thread. So the following link has the 4 data files already sent to you plus the matching exported bdx file.

http://mail.sim-soft.co.uk/~dm/Rider50data.zip

Pitmairen commented 11 years ago

I should be able to figure out the data format with the files you have sent, but it would be great if you could also send me a dump of the whole partition using this command: dd if=/dev/sdxx of=rider50.img

Where /dev/sdxx is the device partition which contains the data. You can find the device using "df thalia", it should be listed under "Filesystem".

I use this to simulate having a real device.

Pitmairen commented 11 years ago

I have figured out the format of the data files, i can read the files now.

But it would be great if you could record a couple of new tracks and use the pause function or make it autopause, and record some laps (To plan > Lap). I need to see how the pauses and laps are recorded.

And it's probably some kind of index file somewhere on the device with a list of all the tracks recorded, i need this file if it's there. It's probably easier if you use dd as in my previous comment or just create a zip of the whole directory structure.

And also can you post the output of "ls -l /dev/disk/by-id" and "mount"?

katterfelto commented 11 years ago

Hi

I've done a dd image, but i will record some laps and use the pause tomorrow lunch time then generate another image. I can't do anything today I have a 7 year old using my PC as she has just broken up for her summer vacation.

I'll sort out the outputs of the other functions as as well.

Thanks for looking at this.

Dave

Sent via EmailTray, my personal email concierge. Get yours at http://www.emailtray.com

-----Original Message----- From: Pitmairen notifications@github.com To: Pitmairen/bryton-gps-linux bryton-gps-linux@noreply.github.com Subject: Re: [bryton-gps-linux] Rider 50 not supported (#16)

I have figured out the format of the data files, i can read the files now. But it would be great if you could record a couple of new tracks and use the pause function or make it autopause, and record some laps (To plan > Lap). I need to see how the pauses and laps are recorded. And it's probably some kind of index file somewhere on the device with a list of all the tracks recorded, i need this file if it's there. It's probably easier if you use dd as in my previous comment or just create a zip of the whole directory structure. And also can you post the output of "ls -l /dev/disk/by-id" and "mount"? — Reply to this email directly or view it on GitHub.

Pitmairen commented 11 years ago

Have you uploaded the dd image somewhere? I haven't seen it.

katterfelto commented 11 years ago

It is on my web space in the office:

http://mail.sim-soft.co.uk/rider50img.zip

I'm not sure how to add data files to the issue on git.

Dave

Sent via EmailTray, my personal email concierge. Get yours at http://www.emailtray.com

-----Original Message----- From: Pitmairen notifications@github.com To: Pitmairen/bryton-gps-linux bryton-gps-linux@noreply.github.com Subject: Re: [bryton-gps-linux] Rider 50 not supported (#16)

Have you uploaded the dd image somewhere? I haven't seen it. — Reply to this email directly or view it on GitHub.

katterfelto commented 11 years ago

Sorry the link was wrong :)

It is on my web space in the office:

http://mail.sim-soft.co.uk/~dm/rider50img.zip

I'm not sure how to add data files to the issue on git.

Dave

Sent via EmailTray, my personal email concierge. Get yours at http://www.emailtray.com

-----Original Message----- From: Pitmairen notifications@github.com To: Pitmairen/bryton-gps-linux bryton-gps-linux@noreply.github.com Subject: Re: [bryton-gps-linux] Rider 50 not supported (#16)

Have you uploaded the dd image somewhere? I haven't seen it. — Reply to this email directly or view it on GitHub.

Sent via EmailTray, my personal email concierge. Get yours at http://www.emailtray.com

Pitmairen commented 11 years ago

I have created a new branch for the rider50: https://github.com/Pitmairen/bryton-gps-linux/tree/rider50

It seems to be working, but i need to know which of the ids in "/dev/disk/by-id" that points to the device with the data.

And if you records more tracks i don't need the whole image anymore i just need the files in the TRACELOG folder.

katterfelto commented 11 years ago

Hi

In the attached zip file there is a recording of some laps along with the directory listing and the output from mount. The BDX file is saved from the Bryton Sport website because today the Bryton Bridge software doesn't want to save the rides to my hard disk (but it will upload).

Hopefully I'll do a ride tonight as well and I'll stop for a pause for you.

Thanks again.

Dave

Sent via EmailTray, my personal email concierge. Get yours at http://www.emailtray.com

-----Original Message----- From: Pitmairen notifications@github.com To: Pitmairen/bryton-gps-linux bryton-gps-linux@noreply.github.com Subject: Re: [bryton-gps-linux] Rider 50 not supported (#16)

I have created a new branch for the rider50: https://github.com/Pitmairen/bryton-gps-linux/tree/rider50 It seems to be working, but i need to know which of the ids in "/dev/disk/by-id" that points to the device with the data. And if you records more tracks i don't need the whole image anymore i just need the files in the TRACELOG folder. — Reply to this email directly or view it on GitHub.

Pitmairen commented 11 years ago

The zip wasn't attached. You have to upload it somewhere or send it directly to my email: progrper -> gmail.com

katterfelto commented 11 years ago

Hi

Sorry about that, I'll try again. I also have attached a session with a couple of pauses in it (@1.75 miles and 2.73 miles).

I've also uploaded both files to my web server http://mail.sim-soft.co.uk/~dm/ if you don't get them the files are called Rider50Laps.zip and Rider50pause.zip

Dave

Sent via EmailTray, my personal email concierge. Get yours at http://www.emailtray.com

-----Original Message----- From: Pitmairen notifications@github.com To: Pitmairen/bryton-gps-linux bryton-gps-linux@noreply.github.com Subject: Re: [bryton-gps-linux] Rider 50 not supported (#16)

The zip wasn't attached. You have to upload it somewhere or send it directly to my email: progrper -> gmail.com — Reply to this email directly or view it on GitHub.

Pitmairen commented 11 years ago

I have updated the code and i think everything should work with the rider50 now. But it needs to be tested with a real device.

The code is in the rider50 branch: https://github.com/Pitmairen/bryton-gps-linux/tree/rider50

chronossc commented 10 years ago

Will test it :)

chronossc commented 10 years ago

@DaisyDave @Pitmairen, application is working as expected, and thx very much for that!

However, I found a bug with some of my tracks, I get that exception:

$ ../brytongps.py -T5 --gpx --tcx --gpxx
Traceback (most recent call last):
  File "../brytongps.py", line 484, in <module>
    sys.exit(main())
  File "../brytongps.py", line 404, in main
    export_tracks(tracks, gpx.track_to_plain_gpx, 'gpx', args)
  File "../brytongps.py", line 206, in export_tracks
    out = export_func(t, pretty=args.no_whitespace)
  File "/home/felipe/projects/bryton/bryton-gps-linux/code/gpx.py", line 142, in track_to_plain_gpx
    for seg in track.trackpoints:
  File "/home/felipe/projects/bryton/bryton-gps-linux/code/utils.py", line 63, in __get__
    value = self.func(obj)
  File "/home/felipe/projects/bryton/bryton-gps-linux/code/rider50.py", line 159, in trackpoints
    return _read_trackpoint_segments(buf)
  File "/home/felipe/projects/bryton/bryton-gps-linux/code/rider50.py", line 313, in _read_trackpoint_segments
    segment_type, timestamp, count)
  File "/home/felipe/projects/bryton/bryton-gps-linux/code/rider50.py", line 347, in _read_trackpoint_segment
    return s, num_read
UnboundLocalError: local variable 'num_read' referenced before assignment

I fixed with following:

diff --git a/code/rider50.py b/code/rider50.py
index 48fc968..bb4b9df 100644
--- a/code/rider50.py
+++ b/code/rider50.py
@@ -338,6 +338,7 @@ def _read_trackpoint_segment(buf, start_timestamp, segment_type,
     s.timestamp = segment_timestamp
     s.segment_type = segment_type

+    num_read = 0
     if count > 0:

         track_points, num_read = _read_trackpoints(buf, start_timestamp, count)
@@ -446,6 +447,7 @@ def _read_logpoint_segment(buf, start_timestamp, segment_type,

     s.segment_type = segment_type

+    num_read = 0
     if count > 0:

         log_points, num_read = _read_logpoints(buf, start_timestamp, count)

But don't know if that is correct fix.

I also added a shebang, so I can run with ./brytongps.py instead python brytongps.py:

diff --git a/code/brytongps.py b/code/brytongps.py
old mode 100644
new mode 100755
index d2118fa..49966fe
--- a/code/brytongps.py
+++ b/code/brytongps.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 #
 # Copyright (C) 2012  Per Myren
 #
Pitmairen commented 10 years ago

Thanks, I've added the patches. Please report if you find any more bugs :)

piggz commented 8 years ago

@DaisyDave sorry to hi-jack this thread....ive just got a rider 50 and am a linux user/dev ... but, on my 50, the maps dont load, with errors about the map engine being too old .... if its no trouble, are you able to zip up your sd card and upload it somewhere so that I might get this working properly. mine is the navteq version and there seems no way to restore the sd card data :/

Pitmairen commented 8 years ago

I don't have a rider 50, but you probably have to update your device software to the latest update from Bryton. To do this you of course have to have a windows or mac machine. You can also use a virtual machine to do this.

There is also a Device recovery tool you can download from this page: http://corp.brytonsport.com/products/support_sdownload?lang=en

piggz commented 8 years ago

yeah, i tried all that already, cheers..did fix last night though, renamed mapengine.dll and version.ini, which forced bb2 to update the files. new files were larger and higher version, seems to work fine now! :)