Sunday, February 12, 2017

Surf Tracker Garmin Vivoactive HR

installed the Surf Tracker app and with a little coding was able to generate surf tracks on google earth and go from this

















to this




what I used (windows 10, surf tracker app, garmin connect iq web site, python 2.7, and google earth pro.  except for win 10, everything else is free)




basic steps
1)  install the wave tracker app on your device
2) sync your device with connect IQ
3) download the files from connect IQ to your desktop/laptop
4) process the files to generate individual ride data
5) generate kml files and upload to google earth


1) from connect IQ download and install the surf tracker app on your device (vivoactive HR for me)
https://apps.garmin.com/en-US/apps/ded87d46-5477-4ca7-a247-847b896393e0


2) once you have recorded a surf session, sync your device and the activity will show up in your garmin connect dashboard looking something like the first picture

3)   There are python scripts out there that will log into the garmin web site and batch download your activity files.  I found these two references to be very helpful and modified to suit my needs.
- Kyle Krafka (https://github.com/kjkjava/)
- Johannes Heinrich (https://github.com/JohannesHeinrich/)

4) Wrote a python script to process the data in each downloaded file.  Applies the same logic to the raw data (one data point per second) to determine which points represent when you are riding a wave.  currently using faster than 9 kph for at least 6 seconds. 

which format to download?

choices are .fit (original), tcx or gpx.  originally i downloaded the garmin data files in tcx format which is essentially an xml file as python coding to extract the raw data was easier for me. gpx is similar format.  there are nuances between tcx and gpx data elements although both have basic time stamp, lat and long.

recently switch to downloading .fit files as it is the orginal file and found python library FitParse that could extract the data elements I needed.

https://github.com/dtcooper/python-fitparse

5) Wrote python script to convert the time stamp, lat / long data for each ride into kml format.  then copy kml files to google earth.



old post (to be deleted)



left click the settings icon (gear icon upper right next to the lock icon) and choose “export to tcx”
Extract the. tcx file into your working directory
My last file name was 1550456722.tcx and 1,799 KB in size
The file is in xml format so you can read with text editor
I wrote a script in python to parse the file using beautifulsoup module and generate kml file using simplekml module
Import kml file into google earth pro

I wrote a python script that uses same logic as surf tracker to identify start and stop points and only keep data in between. happy to share if anyone is interested.  leave me a comment.

alternatively you can use golden cheetah to import fit file, extract data points, save to csv file, apply logic to generate discrete waves (i.e. at least 6 seconds, minimum speed = 9kph) then upload to google earth. 

From golden cheetah, click “Import data” and choose your .fit file
Progress stops half way (after validation).  Click save
Should get import complete.  Click finish
Remove unwanted columns. [Right click, remove column]
[I use only 4 - time, speed, latitude, longitude]
Left click on “entire Activity” to highlight all the rows
Right click to copy and paste into excel spreadsheet.
Save as csv file (I use rawdata.csv)

I did not use Activity, Export to create the CSV file as that only kept lat/long to 4 decimal places.   Using select activity I was able to capture 8 digits which plotted much better

Extract data points to plot.  

Save output to csv file.  Header row "Latitude, Longitude"
From google earth pro, import csv file

4 comments:

keller said...

Hi Jeff you should give WavesTracker a go! I'm a bit biased to say but it is a nice surf track app. Hope that you consider it, cheers! ( www.wavestracker.com )

Denyse said...

Hi,
this is cool. just got a Garmin VivoActive 3, would love to use this to track my surfing. are you still working with this? Thanks!

Jose said...

Hi Jeff,
It's amazing what you get. I know this is a 2 years old post. would you mind to share python script you made to identify start and stop points and only keep data in between?
Thanks in advance.
Best regards

jeff said...

Jose,

function extractWaves in the process fit files a.py

basic flow/logic

start by assuming you are not on a wave (i.e. wave criteria (speed/time) not met)
iterate thru the data set
if criteria met then start tracking data data (i.e. you are on a wave)
until speed criteria no longer met (no longer on the wave)
repeat until end of data set


https://github.com/snardfarkle/surf-tracking.git