Skip to content

Instantly share code, notes, and snippets.

@marcov
Last active September 1, 2023 16:05
Show Gist options
  • Save marcov/1717b6bcc5902f3a38af384ae894c0b3 to your computer and use it in GitHub Desktop.
Save marcov/1717b6bcc5902f3a38af384ae894c0b3 to your computer and use it in GitHub Desktop.
Recover a accidentally paused ride on the Wahoo Fitness App

Recover a paused ride on the Wahoo Fitness App

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).

Update (April 27th, 2020)

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.

Original method

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];

Update (May 1st, 2020)

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.
@fz6
Copy link

fz6 commented Sep 1, 2023

Anybody had the problem of not being able to find the sqlite file? I connected my Elemnt Bolt v1 to a PC running Ubuntu 20.04, it's mounted by MTP, I can see a bunch of directories ("maps", "exports"), but browsed through each (and I've ran find | grep -i sql), can't seem to see a sqlite file - I can see a bunch of map files, and a bunch of .fit files, but that's about it.

Edit - have also tried connecting with adb and running $ adb shell ls -lR | grep -i sql, all I can find is /data/data/com.wahoofitness.bolt/databases/BoltApp.sqlite (which has a very different table structure) and a few .so libs.

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