If you like me use the Wahoo Fitness App to track your bike rides, from time to time it may happen to inadvertitely pause the recording in the middle of a ride.
Sometimes this really sucks cause it will of course not include the full mileage and duration from your ride and also skip valuable Strava segments recorded.
What I found out is that the app is actually recording all the GPS points of the track, but when exporting it will split it up is as many additional tracks as the times your have paused/resumed.
So with some reverse engineering I found a way to avoid this and to have a single and complete track when exporting to online services like Strava. The only limitation I found is that the app will continue to show the rides with the reduced mileage & durations (not a big deal if you export your tracks anyway).
So here's what you need to do, assuming you are using Wahoo Fitness on iOS:
-
Connect the phone to your PC with the USB cable, open up iTunes and copy the file WorkoutData.sqlite locally. Make a backup of this file and run the following instructions on a copy of it.
-
Open the file with DB Browser for SQLITE
-
Identify the value of ZWORKOUTDATA ID (Workout ID) for your ride, e.g. by inspecting the table ZWORKOUTSEGMENT (the higher the ID the most recent the activity).
-
Identify your ZSESSION ID for your ride by inspectin the ZWFWORKOUT table (the higher the ID the most recent the activity).
Users reported not being able to use the original method on newer versions of the Wahoo Fitness App.
If the original method described below does not work for you, you can try this:
@MarsFlyer has come up with a way to dump ride data from the SQLITE db using SQL queries, and generate a GPX file from this data. See here.
This method involves altering the SQLITE db in order to merge the paused segment into a single ride, and upload it back to the iPhone.
- Run the following queries:
UPDATE ZWFBIKECADENCESAMPLE SET ZISWORKOUTACTIVE = 1 WHERE ZWORKOUTDATA = [ZWOID];
UPDATE ZWFBIKESPEEDSAMPLE SET ZISWORKOUTACTIVE = 1 WHERE ZWORKOUTDATA = [ZWOID];
UPDATE ZWFLOCATIONSAMPLE SET ZISWORKOUTACTIVE = 1 WHERE ZWORKOUTDATA = [ZWOID];
UPDATE ZWFTIMEINTERVAL SET ZISWORKOUTACTIVE = 1 WHERE ZWORKOUTSEGMENT = [ZWOID];
UPDATE ZWFWORKOUT SET ZPAUSEDDURATION = 0 WHERE ZSESSION = [ZWOSSID];
UPDATE ZWFWORKOUTSEGMENT SET ZPAUSEDDURATION = 0 WHERE ZWORKOUTDATA = [ZWOID];
On newer version of the app, you also need to update the ZWFWORKOUT table as suggested by @slingbike:
Seems there are three fields in ZWFWORKOUT that perhaps were not there previously: ZCURRENTSTATE, ZDELETESTATUS, AND ZHIDDEN [...] set to 0, 0, and "null," respectively ...
- Save the changes and upload the file back on your phone using iTunes.
So after playing with the
WorkoutData.sqlite
file for a couple of hours, I ran the following SQL snippet to try and update the database:substituting in values for the workout id and session id. I ran with a Tickr X, hence the need to update the
ZWFMOTIONANALYSISSAMPLE
table.After closing the database and copying it back to my iPhone, and reopening the Wahoo app, I didn't see any change in the display of my run; it was still listing a 25 minutes pause. Digging around a little reveals that the Wahoo app also contains a
history/
folder which in turn appears to contain.fit
files for all the workouts I've done, and a crux log file. The loading of this file appears to be corroborated by the contents of therolling.log
file.(note the
PausedTime
value denoting this as the inadvertantly paused workout)I deleted the
.fit
file containing the paused run, that I'm trying to fix, thinking that the app would recreate it upon realising but instead it seems to just display an empty activity. The overview pane on the front page of the app seems "correct" in as much as it was before, but there are no details to load.Unless there's another field we need to be setting, much like @slingbike found previously, I can only conclude that the app now creates a
.fit
file upon completion of an activity, an doesn't read any more from the sqlite db.¯_(ツ)_/¯