{"id":37,"date":"2008-03-02T16:28:30","date_gmt":"2008-03-02T21:28:30","guid":{"rendered":"http:\/\/gabeanderson.com\/2008\/03\/02\/how-to-hack-your-nano-nike-run-data-when-ipod-freezes\/"},"modified":"2008-04-04T08:57:00","modified_gmt":"2008-04-04T12:57:00","slug":"how-to-hack-your-nano-nike-run-data-when-ipod-freezes","status":"publish","type":"post","link":"https:\/\/gabeanderson.com\/tech-blog\/2008\/03\/02\/how-to-hack-your-nano-nike-run-data-when-ipod-freezes\/","title":{"rendered":"How to Hack Your Nano \/ Nike+ Run Data When iPod Freezes"},"content":{"rendered":"<p>Today was my weekly Team in Training run &#8212; I&#8217;m training for and planning to run a marathon <a href=\"http:\/\/www.active.com\/donate\/tntnyvt\/gabe\">to raise money<\/a> for blood cancer research &#8212; and 6.61 miles into the run, my iPod Nano froze on me for the first time in the month that I&#8217;ve had it (yes, it let me down after I raved about it <a href=\"http:\/\/gabeanderson.com\/2008\/02\/25\/use-your-ipod-nano-nike-to-track-mileage\/\">in my last post<\/a>). I was really upset that I was not only going to lose my run data, but that I wouldn&#8217;t get the mileage credit for the <a href=\"http:\/\/www.mozealous.com\/2008\/02\/dave-vs-gabe-articulate-miles-challenge.html\">Articulate miles challenge<\/a>. I ended up doing another 2+ miles for a total of 8.78 miles. <\/p>\n<p>So on my drive home from the run, aside from being bummed, I started thinking about how to fix this. I thought that there had to be some way to hack into the iPod to recover my lost run data &#8212; or at least simulate the run based on similar run data.<\/p>\n<p>Sure enough, I was right: My run data was lost during the iPod crash, but I was given the opportunity to tackle a fun technology challenge. <\/p>\n<p>I got home and started doing some Google searches to research the topic before I just started digging into my iPod&#8217;s hard drive. I found a couple resources with the info I needed &#8212; &#8220;MadeUpName&#8217;s&#8221; method <a href=\"http:\/\/runpl.us\/forum\/discussion\/198\/questionhelp-with-nano-and-itunes-7ipod-in-recovery-mode\/\">outlined on runpl.us<\/a> and <a href=\"http:\/\/www.walkjogrun.net\/blog\/index.cfm\/2006\/9\/6\/Hacking-the-Sport-Kit\">WalkBlogRun&#8217;s method here<\/a> &#8212; and pieced together my own approach that did the trick beautifully. <\/p>\n<p>Here&#8217;s how I did it &#8212; proceed with caution and <strong>at your own risk<\/strong> to your data and software:<\/p>\n<p><strong>The Setup<\/strong><\/p>\n<p>Hacking your iPod&#8217;s run data requires that you create and edit XML files, so before you can do that, you need to confirm two things (both were already the case for me):<\/p>\n<ol>\n<li>Make sure iPod is set to be a disk (check the <strong>Enable disk use<\/strong> box on your iPod Summary tab in iTunes).<\/li>\n<li>Make sure you can see hidden system files &#038; folders in Windows (<a href=\"http:\/\/www.microsoft.com\/windowsxp\/using\/helpandsupport\/learnmore\/tips\/hiddenfiles.mspx\">XP how-to<\/a> | <a href=\"http:\/\/windowshelp.microsoft.com\/Windows\/en-ZA\/Help\/27e9a81a-fac7-457f-896b-e0017a04a59f1033.mspx\">Vista how-to<\/a>).<\/li>\n<\/ol>\n<p><strong>The Backup<\/strong><\/p>\n<p>As is the case whenever you&#8217;re editing pretty much anything &#8212; especially files that help drive your iPod and iTunes software &#8212; always make a backup first since you never know what might happen:<\/p>\n<ol>\n<li>Connect your iPod to your computer.<\/li>\n<li>Navigate to this path (yours may vary):<br \/>\n<em>G:\\iPod_Control\\Device\\Trainer\\Workouts\\Empeds\\&lt;unique ID&gt;<\/em><\/li>\n<li>Copy the entire contents of that folder to your hard drive (2 folders &#8212; <em>latest <\/em>and <em>synched<\/em>, and 5 files &#8212; <em>best<\/em>, <em>calibration<\/em>, <em>settings.plist<\/em>, <em>lastWorkout.xml<\/em>, and <em>preferences.xml<\/em>).\n<p><img src='http:\/\/gabeanderson.com\/wp-content\/uploads\/2008\/03\/snag-1723.png' alt='iPod Nike+ run data folder' \/><\/li>\n<\/ol>\n<p><strong>The Hack<\/strong><\/p>\n<p>Now that you&#8217;ve backed up the key files, you&#8217;re ready to get down &#8216;n dirty. It just so happened that, in my case, the run I did today was the same run I did a couple weeks ago (February 16) in terms of location, mileage, and rough pace. So that made copying the run data fairly easy. Along with that, I also wanted to ensure my last workout and workout summary data were correct. <\/p>\n<p>So there are 3 things you need to do:<\/p>\n<ol>\n<li>Create or copy your new run data (the XML file named after the date &#038; completion time of your run &#8212; e.g., <em>2008-03-02 08;14;25.xml<\/em> &#8212; that&#8217;ll begin with the <em>&lt;sportsData&gt;<\/em> tag inside the file) to your <em>latest<\/em> folder.<\/li>\n<li>Update your <em>lastWorkout.xml<\/em> file.<\/li>\n<li>Update your <em>preferences.xml<\/em> file.<\/li>\n<\/ol>\n<p>Those last two files are used to display your run summary data in both iTunes and in your iPod. Here&#8217;s what the screen with that info looks like in iTunes:<\/p>\n<p><center><img src='http:\/\/gabeanderson.com\/wp-content\/uploads\/2008\/03\/snag-1722.png' alt='iTunes Run Summary Data' \/><\/center><\/p>\n<p><\/p>\n<p>So here&#8217;s what I did for each of the above steps:<\/p>\n<p><strong>1. Copying run data.<\/strong><\/p>\n<p>The first thing I needed to do was to re-create today&#8217;s lost run data file by duplicating the data for the last time I did the run and update it with today&#8217;s date:<\/p>\n<ul>\n<li>Opened the <em>synched <\/em>folder and located the data file for the last time I did this run (<em>2008-02-16 08;14;25.xml<\/em>).<\/li>\n<li>Copied <em>2008-02-16 08;14;25.xml<\/em> to my desktop. <\/li>\n<li>Opened <em>2008-02-16 08;14;25.xml<\/em> with Notepad.<\/li>\n<li>Located the two references to the date &#038; time of the run &#8212; in the <em>&lt;time&gt;<\/em> and <em>&lt;startTime&gt;<\/em> tags &#8212; and changed the values to today&#8217;s date (run start time was the same today and last time I did the run):\n<p><img src='http:\/\/gabeanderson.com\/wp-content\/uploads\/2008\/03\/snag-1724.png' alt='run data xml file' \/><\/li>\n<li>Saved the file &#038; renamed it to match today&#8217;s date and run finish time (<em>2008-03-02 08;14;25.xml<\/em>).<\/li>\n<li>Copied this new file to the <em>latest <\/em>folder on my iPod &#8212; the staging area for runs that have yet to be snyched with iTunes.<\/li>\n<\/ul>\n<p><strong>Note: <\/strong>I left all other run data the same in my run data file, but you&#8217;ll see that you can update all kinds of data to match your estimated values for your run, including these:<\/p>\n<ul>\n<li>&lt;duration&gt;<\/li>\n<li>&lt;distance&gt; (in both km and miles)<\/li>\n<li>&lt;calories&gt;<\/li>\n<li>&lt;pace&gt;<\/li>\n<\/ul>\n<p>You&#8217;ll also notice in the middle of your run data file that your iPod records your run distance every 10 seconds. Pretty cool stuff. <\/p>\n<p><strong>2. Updating <em>lastWorkout.xml<\/em>.<\/strong><\/p>\n<p>Next, I needed to copy key portions of today&#8217;s run data to the <em>lastWorkout.xml<\/em> file, so here&#8217;s what I did:<\/p>\n<ul>\n<li>Opened up both <em>2008-03-02 08;14;25.xml<\/em> and <em>lastWorkout.xml<\/em> in Notepad.<\/li>\n<li>In my run data file, copied from the beginning of the &lt;time&gt; tag to the end of the &lt;lifetime&gt; tag; this includes all the relevant data you need to paste into <em>lastWorkout.xml<\/em>.<\/li>\n<li>Pasted this data into <em>lastWorkout.xml<\/em>, overwriting the existing values, of course. <\/li>\n<li>Referred to my last run data XML file to update lifetime stats in this section to include this latest run data.<\/li>\n<li>Saved <em>lastWorkout.xml<\/em>.<\/li>\n<\/ul>\n<p><strong>3. Updating <em>preferences.xml<\/em>.<\/strong><\/p>\n<p>Finally, I needed to do some basic math to update my total run data to reflect today&#8217;s run:<\/p>\n<ul>\n<li>Opened both <em>2008-03-02 08;14;25.xml<\/em> and <em>preferences.xml<\/em> in Notepad.<\/li>\n<li>Incremented my &lt;TotalWorkouts&gt; value by 1 (from 11 to 12).<\/li>\n<li>Updated the &lt;TotalCalories&gt; value by adding the &lt;calories&gt; value from today&#8217;s new run data file.<\/li>\n<li>Updated the &lt;TotalSeconds&gt; value by taking the &lt;duration&gt; value from my run data file, <em>minus the last 3 digits<\/em> since your run data files measure to the thousandth of a second (in my case, the &lt;duration&gt; value was 4236763, so I took 4236 and added it to 30529 to get 34765, which, <a href=\"http:\/\/www.google.com\/search?q=34765+seconds+in+hours\">when converted to hours<\/a>, checks out to be my correct total: 9.6 hours).<\/li>\n<li>Updated the &lt;TotalDistanceMiles&gt; to include today&#8217;s mileage. <\/li>\n<li>Updated the &lt;TotalWeightWorkouts&gt; value to 12.<\/li>\n<li>Left everything else &#8212; like &lt;FarthestMile&gt; and &lt;TotalMarathon&gt; &#8212; the same since my longest distance still stands at 10.02 miles (last Sunday) and since I haven&#8217;t yet run a marathon.<\/li>\n<li>Saved the file.<\/li>\n<\/ul>\n<p>So that&#8217;s it! You&#8217;re done with the hard part. <\/p>\n<p><strong>The Confirmation<\/strong><\/p>\n<p>The only thing left to do is to confirm that your hacks worked as expected (you did back up your original files, right?). Here&#8217;s what I did to confirm:<\/p>\n<ol>\n<li>In iTunes, ejected my iPod.<\/li>\n<li>Unplugged my iPod and went to the Nike+ screen to confirm my latest run and new totals were reflected.*<\/li>\n<li>Plugged my iPod back into my computer &#038; confirmed latest run &#038; summary data were reflected.<\/li>\n<li>Synchronized my data and uploaded <a href=\"http:\/\/nikeplus.nike.com\/nikeplus\/?l=runners,runs,1559070048,runID,752891182\">the run<\/a> to my Nike+ site (I had to login to my nikeplus site again).<\/li>\n<\/ol>\n<p>* At first, my summary data was showing up in iTunes, but not in my iPod, so I did a <a href=\"http:\/\/docs.info.apple.com\/article.html?artnum=61705\">force reset<\/a> using the method suggested by Apple, and after that, the new summary data appeared as expected. <\/p>\n<p>Success! I learned a fun hack and can now rest assured that my run data &#8212; at least the mileage totals &#8212; remains (mostly) accurate.<\/p>\n<p>Have fun and remember: If you use this method to fabricate run data, you&#8217;re cheating no one but yourself. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today was my weekly Team in Training run &#8212; I&#8217;m training for and planning to run a marathon to raise money for blood cancer research &#8212; and 6.61 miles into the run, my iPod Nano froze on me for the first time in the month that I&#8217;ve had it (yes, it let me down after [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,18,17,19],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-apple","category-itunes","category-music","category-running"],"_links":{"self":[{"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gabeanderson.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}