iPod Training Data: Under the hood

by Matt Mecham on September 5, 2006

My last few blog entries have been about the iPod+Nike kit for the iPod.

I’ve completed my first 5mile run using my temporary shoe ‘hack’ to secure the sensor between the shoe tongue and the laces. I’ve uploaded my data to the nikeplus website and that’s when I experienced the first real disappointment with this product.

The Nikeplus website is a bit of a let down. It looks pretty enough as it’s all Flash driven but it lacking in several other areas. Firstly, there’s no sense of community. You can look up the ‘leader-boards’ for those who’ve run the furthest, those who’ve run for the longest and those who’ve turned in quick times for 5k and 10k runs – but that’s about it. You can’t browse their stats or their run histories to see how they’ve improved. I can appreciate that some runners will want to keep their data private but an opt-in setting to “share my stats with the community” would be a welcome improvement.

Click for a larger version

Worse yet; I can’t share my data with anyone. I was going to link up to my stats so you can browse my data and get a feel for the system but I can’t even do that — unless I gave out my log in information. In this age of community focused web-applications it feels like a bit of a step back.

This got me thinking: surely there’s a way to extract the run data from one’s iPod in it’s raw format. Apple are fond of using either XML or SQLite to store data locally so reading the data wouldn’t be a problem. I ran (pun intended) a few spotlight searches to see if the data is cached on my harddrive. It’s not. Hmmm.

I plugged back in my iPod Nano and enabled ‘Disk Mode’ and double clicked the icon. In typical Apple fashion, anything remotely scary is hidden. So, it’s over to terminal.
After a bit of digging around, I located the data. It’s stored in XML format (no surprise there) and is found in: iPod/iPod_Control/Device/Trainer/Workouts/Empeds/{Sensor ID}.
My sensor ID is ‘4H627YP2VSX’. This sensor ID is also located in a file called ‘linkData’ in the Emped folder. I copied the folder to my desktop so I could poke around without risking the data on my iPod.

As the data is in XML format, it makes for easy reading. The first part holds some interesting data:

<runSummary>
<workoutName>Basic</workoutName>
<time>2006-09-05T12:53:57+01:00</time>
<duration>3538875</duration>
<durationString>58:58</durationString>
<distance unit=”km”>8.0492</distance>
<distanceString>5.00 mi</distanceString>
<pace>11:47 min/mi</pace>
<calories>752</calories>
<battery></battery>
<playlistList>
<playlist>
<playlistName>a.Current</playlistName>
</playlist>
</playlistList>
<stepCounts>
<walkBegin>4490</walkBegin>
<walkEnd>9130</walkEnd>
<runBegin>3600</runBegin>
<runEnd>7666</runEnd>
</stepCounts>
</runSummary>

The most curious is the “stepCounts”. This data doesn’t appear to be used by the system currently and it’s unclear how it calculates “walkBegin” and “runBegin”.
Further down the file we get the KM and mile splits.

<startTime>2006-09-05T12:53:57+01:00</startTime>
<snapShotList snapShotType=”kmSplit”>
<snapShot><duration>435715</duration>
<distance>1.002</distance>
</snapShot>
<snapShot><duration>848088</duration>
<distance>2.0</distance>
</snapShot>
<snapShot><duration>1258480</duration>
<distance>3.001</distance>
</snapShot>
<snapShot><duration>1708667</duration>
<distance>4.002</distance>
</snapShot>
<snapShot><duration>2149958</duration>
<distance>5.003</distance>
</snapShot>
<snapShot><duration>2593229</duration>
<distance>6.003</distance>
</snapShot>
<snapShot><duration>3060237</duration>
<distance>7.002</distance>
</snapShot>
<snapShot><duration>3517397</duration>
<distance>8.0</distance>
</snapShot>
</snapShotList>

Right at the bottom is the extended data which must be used to fill the ‘curve’ shown when you’ve uploaded your data and when you view previous runs.

The most exciting prospect is writing a little application that can take this data from your iPod and upload it to another website where it’s stored, consumed and written out without a ton of flash. One could then invite others to download the application and upload their stats and create a ‘real’ community site where runners could browse other’s stats and share their own.

Hmmm….

Update 6th September
I’ve written a dashboard widget that uses the widget.system() functionality in javascript to call a perl script which locates the iPod, iPod serial number and training data. It then POSTs this to a PHP file sitting on this server which simply writes the data to a temporary file.

It’s ugly, but it works

I’m using the ‘lastWorkout.xml file as my test subject. It works well. I can now add a username and password field in the widget and write a basic log in handler and we have the beginnings of our community of runners. The next step is to store the last sync date and upload the real XML files as attachments for storing in a database.

{ 1 trackback }

Matt Colyer
January 15, 2007 at 1:34 am

{ 27 comments… read them below or add one }

1 Dean Clatworthy September 5, 2006 at 4:48 pm

Great idea Matt :) Nike+iPod social networking ;)

2 Dennis September 5, 2006 at 5:03 pm

lol… iPod + Nike IPB Component.

3 Mark September 5, 2006 at 10:50 pm

It can calculate the timings between a walk and running stride? So it will know when you started to walk/run won’t it?

I also see a new IPS product appearing…

4 Bob September 6, 2006 at 1:01 am

Or another add-on module to Invision Power Board! Perhaps we’ll see this pop up on ipsbeyond.

5 Mike September 6, 2006 at 2:46 am

Thanks for that great information, I would’ve never thought to look there.

6 Brendon Kozlowski September 6, 2006 at 4:46 am

Okay, this all seems pretty darn cool, but…are there any alternatives to using an iPod of any sort? I don’t really like the software that comes with it for Windows, and I’m not about to buy a MacBook as an accessory to an iPod which I’d only *possibly* use for running. I haven’t used my digital Sony armband sports radio, mostly due to headphones, they feel uncomfortable to me while running.

Anyway, this seems really accurate and getting informative data to track yourself with is a definate plus! Anyone know of any alternatives to this system?

7 Bryce September 6, 2006 at 10:26 am

@ Brendon – You could use those PULSAR watches.

Cool story
Dugg

8 Dan September 6, 2006 at 7:58 pm

I’ve been following your blog with interest because I like the idea of the nike+ipod, but there isn’t anything that seems to make it all that worthwhile for me. I’d be interested in buying the product if there was something that really jumped out at me about it. Yes I want an iPod for when I’m exercising, and yes I’d want some form of recording what I’ve done, however recently I’ve taken my headphones to the gym and tracked what I’ve done using the machines at gym.

The one thing that would stand out would be the ability to download the data, save it and upload to some form of community website. It would allow me to share what I’ve done with other people, and compare. It’d be especially nice to compare myself to the missus.

I’ll be keeping an eye on this Matt! Thanks.

9 Brendon Kozlowski September 7, 2006 at 3:07 am

This is the closest alternative I could find in a short websearch. The PULSAR watch really was not even close. I could have done just as well with a stopwatch for $1.00.

http://www.garmin.com/products/forerunner305/

10 Leo September 8, 2006 at 9:54 am

Matt,

This is all a great idea since I am looking for alternatives to download my workouts other than te one provided at nikeplus. How can I get your widget app running at Windosx XP ?

Keeo the good work,

Leo from Madrid, Spain

11 chris September 12, 2006 at 11:21 pm

Excellent job, I run a ipod nike+ site also, check it out at http://www.ipodnikeplus.net. I keep track of all new mods, new editions, problems, etc. I havent updated in awhile, but I will no doubt be blogging about this also, nike needs to make some fixes asap

12 patrick October 11, 2006 at 5:09 pm

Matt,

I’m a writer putting together an article on the computerization of running gear. The article will look at devices like Nike Plus and Adidas’ new running computer. I’m trying to find people who’ve actually used this stuff and wouldn’t mind giving me some feedback on their experiences. Please email me if you’d be open to doing a short interview. Thanks.

13 nikolaj October 11, 2006 at 8:53 pm

i’m looking so forward to your program…

the graph is fairly easy to create with the extended data tag.

since the distance is measured every 10 second (see the xml file) just calculate the speed fx km/h og mi/h

i don’t have the knowledge so I can make a program, but it’s easy in excel ;)

14 Blake October 12, 2006 at 4:27 pm

I am an avid runner, and just started to use the nike+ipod. I like it so far, and I am not as concerned about the social networking aspect quite yet, but more interested in logging a journal (hopefully interactive) the runs in series with your running data. A neat interactive addition would be to save audio by talking into a mic in the middle of your run. If someone write a workout journal program that would neat. Apple should also hook up with polar (or just make their own) to record heart rate info, which I can record on my watch, but cant reconcile with my nike+.

15 Tim October 12, 2006 at 7:38 pm

Excellent find! Now I just need to buy an iPod Nano.

16 Djailla October 26, 2006 at 12:19 pm

Hello

I’m also interrested by what you’ve made. I would be pleasant to use some graphical solution to draw the running curve.

Do you need some help?
Can you send me the widget?

Thanks for the information, and congratulations for your work ;)

17 scrapdog December 5, 2006 at 5:11 pm

Check out http://www.crustybugger.com/blog/ for a WordPress widget I created that automatically synchs with nikeplus.com. Now you can display your run data right in your blog’s sidebar.

18 Hugh C December 7, 2006 at 12:50 am

Overnight, Nike have released MacOS and PC (Yahoo) widgets for displaying live data from your NikePlus account.

To get them, go to nikeplus.com, and make sure you have US selected in the language selector, then login. You will see that the ‘home page’ options will then include a link to the widgets page.

19 Jonas sison December 7, 2006 at 1:16 am

Great job Matt,

A couple questions…
How is the duration (for the km and mile splits) calculated? Your first km duration was 435715. What does that translate to? Same question with the pace.

Thanks.

20 Jonas December 7, 2006 at 1:34 am

Scratch my last comment. It stands for milliseconds (or so). So 435715/1000/60 seconds = 7 Minutes, 15.71 seconds.

I analyzed my 5k times and it calculated perfectly. Looking forward to the widget. My excel file is a little clunky, but works fine until I get a copy of your little program.

21 Neil January 13, 2007 at 8:02 pm

Here is an idea… There is a program that converts a widget into an application. If the widget output is nice (graphically speaking) then at least you could use grab to take a screen shot of that window and end up with ‘nice’ graphics of the run data.

22 Joe January 17, 2007 at 1:32 pm

I’ve been using this software i found on a blog:

http://httpcode.com/blogs/posts/1882.aspx

it has the source code

23 andrew February 25, 2007 at 11:23 pm

Any news on if you will be able to imput track-workouts in the near future?

24 elbert May 5, 2007 at 8:31 am

hi Matt, stumbled upon your blog when I was trying to figure out how to force upload my nano’s Nike+ data to the nikplus site. I have a run that’s stored in the iPod but refuses to get uploaded to Nike’s site.

Anyway, that’s not why I’m posting a reply here. I’m here to share with you that I found a nice alternative site to upload Nike+ data, and it’s got the elements of a community that you mentioned in this post.

Go to runnerplus.com. It’s still in beta but looks very very promising.

25 Matt Mecham May 5, 2007 at 11:13 am

Great site, I’ll keep an eye on that…

26 Derick October 2, 2008 at 9:10 pm

If you don’t want to use an iPod, Nike now sells a wristband that can now save the data to a specialized thumb drive.

27 John June 7, 2009 at 1:30 am

Thanks for the post. I tried slowgeek.com, but didn’t like their over-zealous smoothing — it took 0.5 mph off my speeds pretty consistently. I also tried runnerplus.com. Though they have a less/more detail slider, it didn’t scratch my itch, so, being a geek, I rolled my own in R — http://blog.balinsbooks.com/2009/06/05/new-r-script-plot-nike-runs/. Take a look and let me know what you think.

John

Leave a Comment

Previous post: First run with ipod+nike

Next post: IP.Dynamic: Calendar