Pages

Sunday 30 April 2017

Adding Fitbit HR data to a Garmin TCX file

Earlier this month I talked about Running Watches on a Budget and how I had got my hands on an old Garmin Forerunner 405 for not very much on eBay.  This is working well for me especially now I have sorted out mobile data uploads, but I'm always looking to see what else I can do.  The two immediately obvious things I am missing are heart rate data and cadence.

I've had a Fitbit Charge HR through work for a while, and this tracks steps (obviously) and being the HR model also uses optical wrist based heart rate monitoring, as featured on some more recent high end Garmin watches.  There is a Fitbit Developer API so I started to have a look and see what was available.  Registering an app is easy, so I get set up with an account and explored the endpoints.  The Get Activity Intraday Time Series endpoint appeared to have what I wanted, so time to choose the technology.

Initially I started looking at Python and the Ruby on Rails, with the idea being that I could make use of existing libraries and minimise the amount of code I have to write myself, but I soon found myself staring down blind alleys with no idea how to proceed, so I fell back to my old faithful approach of hacking together PHP in a very inelegant fashion.  Before too long and with a bit of help from OAuth2-Fitbit I could authenticate with the API and make requests.

My first experiments were with cadence, but I found this was unreliable as although the 1 minute resolution SHOULD be sufficient for steps per minute this data appeared to be smoothed over much longer periods of time, roughly corresponding to the duration of an activity as far as Fitbit is concerned. This effectively meant that you cadence was shown as a flat line for the duration of your run at a rate of (total steps)/(duration) - useless for running purposes.  Heartrate data looked a lot more promising though, and I was soon able to return an array of heartrate data against time for a given activity window.

The next step then was to upload a TCX file and extract the start and end time of activities in order to know what requests to make.  Parsing XML is not something I particularly enjoy, but using SimpleXML I was able to iterate through the nested structure of Activities -> Activity > Lap[] -> Track and build up a list of trackpoint timestamps, then I take the first and the last, convert to unix timestamps, add 60 seconds to the last one so as not to miss any data from the last minute of the activity, and then reconvert to the format required by the API - a separate date, then start and end times in HH:MM. One thing which tripped me up was that the API returns data in local time whereas the TCX file works in GMT - I only spotted this when I went for a 12k run and the first hour had me at a resting heart rate...

The resolution of the heart rate data is less granular than that of the TCX file, so in order to combine them I again use SimpleXML to step through each Trackpoint, and when I get to the trackpoint I find the nearest heart rate datapoint for that time using some code shamelessly found on Stack Overflow.  It was here I hit a slight complication as I need to add a new HeartRateBpm element and in the world of SimpleXML all you can do is append an element, you cannot choose where to insert it.  The various systems using TCX are very particular about where this element appears, as it must come after Time, Position, Altitude and Distance but before Extensions. Only Time is mandatory, and from analysing TCX files from my watch some or all of the others may well be missing.  This involved getting in to the world of DOMElement to be able to specify the element after which Heart Rate should be inserted  - itself based on a series of tests to see which statements are and are not present for a given trackpoint.

With that in place I now have a web page where I can upload a TCX file and my script will read it and add in the heart rate data then presenting it for download, where I can manually add it to Garmin Connect and have it propagate to Strava and Endomondo. My post run workflow now goes as follows:

  • Sync Fitbit and make sure it has captured a running activity with Heart Rate Data
  • Download TCX from my watch using Sportablet Uploader
  • Upload to my web page
  • Download new file and add it to Garmin Connect via their website
It's a bit cumbersome, but it's bearable.  I'd love a newer watch with built in Heartrate, Cadence and low power Bluetooth sync, but for now this works for me.



Saturday 15 April 2017

The Three Ships at Birchen Edge

Recently Liz had suggested The Three Ships at Birchen Edge as a good area to try some more accessible climbing at a lower level, and so the idea was born to try and get out with my son who is now 9 (hereafter referred to as F).  He climbed the artificial Heeley Boulder last summer, and this week I got him back down to The Mini Works after an absence of several years.  He's been doing Youth Aerials at Greentop Circus for a while now, which has given him great core and grip strength, and when we got to the Mini Works and warmed up it was obvious that this was helping him as he was climbing quite well.  Heel hooks and arĂȘte climbs seemed to come naturally to him, and he also appears to have picked up my penchant for a high foot and blatant abuse of reach :)  By the end of the session we were challenging each other, and he got up a green spotty which is rated Font Grade 4-5.


The weather was great last weekend, then turned decidedly sketchy.  With one eye on the forecast at all times we decided Saturday was looking most likely, and decided to go for an early start (by our usual standards) so at 10:00 we picked up Liz and Kelly and headed out towards Baslow, getting confirmation en-route that we would be joined by our usual gang - Ed and Kelly, Andy and Ceri.  One we parked up next to the pub we walked in and although it was dry and not too cold there was a fair wind blowing.  We started off on Victory, following the order of the problems in the 2014 Rockfax Peak Bouldering book, our go to book when out in the peaks (generally we have at least 3 copies of this with us).


It took a while to get heads in to rock space again, with the first problem (Orion) fighting me - didn't help that this was sit start territory with wet ground underfoot but we were well prepared with doormats and towels.  Eventually this went along with Neptune, and then it was The Victory Traverse. Liz had a go and backed down, F had a go and backed down, I had a go and fell off straight in to a muddy puddle - the rock was quite green here! F cracked it on his next attempt, getting up his first outdoor climb and defeating the problem quicker than I did. This ended up being his only climb of the day but he attempted plenty more and found lots of rock to practice technique on even if they weren't listed routes.


We carried on around all three of the boulders, I didn't all the problems but enjoyed Tenerife and Tenerife Right. After this we dropped down below the edge, Ed and Kelly went to attack some nails problems while we played on Copenhagen Wall. Scandiwall fell quickly, Copenhagen Corner felt horribly exposed but I was actually quite solid on it.  Around on the main face Dane's Delight was fun - it gets quite high but it's a slab with positive holds, the crux is the big move to the ledge at the start.  Dane's Disgust is less pleasant than this as you have worse holds to deal with, but it's equally doable.


Everyone was feeling climbed out by now and there was a distinct sudden temperature drop suggesting rain was on the way, so we decamped to The Robin Hood Inn which was conveniently (and not entirely coincidentally) located next to our chosen parking for some fantastic food.  My Pie and Mash hit the spot and didn't even leave me room for the delicious sounding dessert (I'm a sucker for a crumble) but I'm not going to complain about that. By all accounts F had a great day too and wants to go again, we are thinking of heading out to Burbage South Edge for him to get to grips with the rocks in Kindergarten, before heading down to Burbage Boulders for some of the classics (Pock Block was my first outdoor bouldering about 12 years ago with Ed after work one day). All in all a successful day, looking forward to doing it all again now :)


Friday 14 April 2017

Running watches on a budget

Not long after I started running regularly I decided a running watch would be quite useful for pacing - prior to this I had used Endomondo on my Smartphone with headphones, which sometimes remembered to tell me my pace each KM but really wasn't that useful for on the go information which is probably why my pacing was all over the place.  Because I didn't have a lot of disposable income at the time I went hunting running watches on eBay and got myself a Soleus GPS 1.0 which had decent reviews but doesn't offer data download.  Apparently you can get the data if you buy a 4 pin cable, but I couldn't find one at a decent price.

Before I could actually use this though I bought a Garmin Forerunner 405 on a whim (on Christmas Day no less) again at a bargain price on eBay.  This came out in 2008 making it 8 years old when I got it, but it still works really well.  It took me a little bit of experimentation to get happy with the fields it displays, although it supports 3 screens I usually find myself switching between them accidentally and then getting confused so have settled on a single screen.  Instantaneous pace is too instantaneous to be useful, so I have settled on the following:
  • Main field: Lap Pace. I have auto-lap set up for each KM, so this shows my average pace over the current kilometre I am running on.
  • Small Left field: Overall Pace
  • Small Right field: Total Distance

With this combination all I need to know before I set out on a run is the overall pace I need to achieve in order to get my target time.  I can make sure my overall pace is on target, and can also target my current pace for the KM.

Being an old watch it does not use Bluetooth but instead uses Ant+ which means using a PC and a USB dongle to get data off it and uploaded via Garmin Connect to Endomondo and  Strava. This all works, but having to get the PC out is a bit of a faff and Garmin Express seemed very hit and miss when it came to syncing.  A little bit of research later and I found the Sportablet Uploader for Garmin. Now this requires a USB2.0 ant+ dongle and the Garmin one is USB1, but thanks to eBay I picked up a Micro USB Male Host to USB Female OTG Adapter Cable and a Mini USB2.0 ant+ dongle and it works perfectly. I can now upload my runs in the cafe immediately after a run and all I need to carry is one extra cable.

Of course now I am intrigued by Heart Rate and Cadence, which the Forerunner 405 cannot do without additional accessories which seem to be rather pricey.  But that will have to be another chapter...

Wednesday 12 April 2017

Trail Kit

As I mentioned in my report on the Bradfield 5.5k  I have encountered the world of the compulsory kit list now I have discovered trail running.  This actually came about when we entered the White Peak Trail Run when sat in a cafe in Stocksbridge immediately after the Langsett 10k.  As can be seen on the Event Info page the following gear is compulsory:

  •  Running shoes that in the organiser’s opinion are fully suitable for the type of off-road terrain to be encountered (NB no flat soled shoes allowed).
  • Waterproof jacket
  • Windproof leg cover
  • Other waterproof & warm body cover appropriate for the prevailing weather conditions.
  • Sufficient coins for telephone calls or a mobile phone.
Event officials will disqualify anyone who in their opinion does not meet the above compulsory equipment criteria.
OK, running shoes I can do (and have even bought some new shoes since so am doubly OK).  I have a waterproof jacket,  but it isn't a running jacket, and I have no idea what they are getting out with "windproof leg cover". More importantly, I have nothing suitable to carry this in, the extend of my carrying capacity when running being a smartphone sized running belt.

I don't like wearing a waterproof jacket at the best of times, so the idea of sweating inside one while running was especially unpleasant but I thought that if I am going to have to get one I should get one designed to running so I have no excuse come the inevitable wet days.  A little bit of drizzle is fine, but for heavier rain I'll probably want something a bit better - but I didn't want to spend a fortune on it if I won't use it much.  I figured that a cheap pair of waterproof trousers will do as much as anything for windproof leg cover. It's worth bearing in mind at this point that this gear isn't necessarily for running in - when you are trail running in the hills you NEED to be able to keep warm and dry if you run off course and get injured as it could be a long time before someone finds you (on that note: make sure people know where you are going and when you expect to be back, and have a means to contact people. It can very easily become a case of life and death if you are not careful)

So off I headed to Decathlon again to give them yet more of my money, with the inevitable shopping list:

I ended up with the trail bag, the waterproof overtrousers, the Run Rain and the Run Wind.  For the jackets I was going to buy Medium as they seemed to have the best fit, but when I started moving around in them they were a little restrictive so I got the Large instead. So far I have not had need to wear the waterproofs but have worn the windproof jacket before and after running sessions. It packs down really small which is handed, in a pinch you can carry it on your hand using the elasticated strap.

The bag however was my biggest concern as I had never run with a bag before.  I can get the waterproofs and the windproof jacket in the back without having to expand it, even with the water bladder full.  So first chance I got then I loaded it up and went for a run.  With 2 litres of water in it despite having been careful to get the air out it was still quite sloshy and there was a lot of weight to it but drinking from it on the move was not a problem.  The little pockets in the bottom of the shoulder straps are really handy for putting keys and money in, and there is also a nifty phone pocket inside so you don't lose it amongst all the other gear. There are also two very simple but effective chest straps to minimise movement.

Next time I took it out I left the bladder at home and instead ran with 2 drinks bottles in the holsters on the shoulder straps.  This was a lot more comfortable than the full bladder, but was rather noisy.  This was a nice long 12k run incorporating some decent hills to make sure it was a decent test. Come the Bradfield 5.5k and it was time for my first run with a mandatory kit list and I decided to run with 1 litre of water in the bladder to see how that went.  As it happens they relaxed the requirements due to fine weather, but I ran with the bag as planned anyway.  With a half filled drinks bladder I barely noticed the bag was there and even though I only took about 4 mouthfuls I was grateful to have the drink with me.

All in all it seems that yet again Decathlon have managed to come up trumps again with really well priced affordable goods to make trail running accessible to more people.  You can spend a lot on what I don't doubt is quality gear, but certainly for the level I'm running at this is superb kit for the money.

Thursday 6 April 2017

New Shoes! Kalenji Elio Feel Trail

I decided that after payday I would treat myself to some new shoes as since taking up running I have worn a pair of cheap trainers I got for going to the gym over 10 years ago, and a pair of Magnum Uniform Service Trainers I picked up off eBay originally to use as approach shoes when climbing. I don't really think about my feet at all when I am running on hard services so I probably keep the Magnums for now when I am running on the roads, but I have noticed a bit of slipping and sliding in the mud so thought I would look at dedicated trail shoes (trails are more fun anyway).

I popped to Decathlon after work as it is convenient and their budget own brand gear is rather quite good for what you pay, with a shortlist of four:

  1. Kalenji Elio Feel Trail
  2. Kalenji Kiprun Trail XT6
  3. Asics Gel Kanaku 2
  4. Kalenji Kiprace Trail 3

I was focusing on 2 and 3 on the list as I was after an aggressive tread pattern, the Elio Feel wasn't as extreme and the Trail 3 was very similar to the XT6.  When I got there I couldn't find the Kiprace Trail 3 so that was quickly ruled out, and the Asics Gel wasn't doing it for me - there was not as much to the sole as I expected.  I tried the Elio Feel Trail on and was surprised by how comfortable and light it was, and I really liked the way the sole flexed. I then tried the XT6 on and it just felt wrong, which I figured out to be the 9mm drop rather than the 6mm drop.  If they had the Trail 3 in at this point I would have been looking at that as it also has a 6mm drop, but it wasn't there so I couldn't.  After a little mental back and forth I decided to get the Feel Trails as they were cheap and even if they do not tick every box for me on trail running I can always upgrade later safe in the knowledge I will get plenty of life out of these.


Yes, that is my cat's leg. She wanted to be in the picture.


First impressions: As I said they are light, 270g in size 8.5.  The soles are very flexible but seem to have good grip, and a feature I found odd at first but seems to work is the fact the tongue is built in to the shoe on one side, and the other side held captive on elastic.  This seems to help with positioining and stop it slipping to one side.



Of course I couldn't wait to get them on my feet and get them muddy.  I actually spent all morning wearing them and they are super comfy.  Anyway, the opportunity arose and I decided to go and noodle around on Loxley Common as it has a good variety of terrain and I know of some slippery muddy banks in there...


Out on a run then and I start off on tarmac. They feel grippy and fast, and I can already see that if those don't work for me off road I will use them on road.  They have a bit of cushioning in the heel in case you do heel strike, but I found myself naturally landing on my midfoot. When I hit a hill I could really feel the flex helping, allowing me to dig in and drive up the hill on my toes with high turnover. Hills turn out to be something I'm ok with which came as quite a surprise.

After about 1km I turned off up what was a very muddy path last time I took it.  It appears to have dried out quickly in the recent fine weather, but I was still able to feel great grip on loose dry mud and on dry stone, very useful for those technical trails on top of the peaks.. Done as teep bank and then straight up the other side I felt no slipping and was very sure footed, and then hit an undulating section with plenty of mud - not ankle deep peat on top of the moors, but certainly thick gloopy brown stuff.  Again no hint of slipping.

It was then on to a section of uphill loose fine gravel which was no challenge before a great fast downhill section on hard dry soil and gravelly paths.  Still feeling sure footed I had the confidence to lean in to the hills and take them at speed even on the steep twisty sections, being rewarded with a best ever mile (7:37) and kilometre (4:37) on what was supposed to be a gentle run. Back on to the roads, and a final push for home trying to keep my pace under 5:00/km (don't forget that sub 25:00 Parkrun target...)

Am I happy with my purchase? Yes, yes I am.  They shall be getting a thorough workout at the White Peak Trail Run and if needs be there will be updates over time but for now I recommend them to people looking for an entry in to trail running on a budget.


Tuesday 4 April 2017

Peak District Trail Run Spring Series 2 - Bradfield - 5.5k

I wasn't going to be free on the weekend of April 1st but plans changed and I found myself available.  The first thing I did? Scan Si Entries Event List for a running event. I spotted Trail Run Series #2 and when I saw it was in Bradfield my mind was pretty much made up - it's less than 5 miles from my house and highly likely that at some point I will run there from my house, especially given the presence of the Old Horns Inn at High Bradfield.  It's also just over the Peak District boundary, reminding myself I live so close to such a beautiful place.

There was a choice of a routes - a 14k run around three reservoirs (Agden, Dale Dike and Damflask) or the 5.5k which went around Damflask on the last part of the 14k route.  I was in two minds about which to do as the 14k was really appealing but two things swung it for me - none of my usual running friends were free to join me for it and Hillsborough Parkrun were having a pacing event the day before, so I signed up for the 5.5k in the end. This race had a compulsory kit list which included the following:
  • Running shoes that in the organiser’s opinion are fully suitable for the type of off-road terrain to be encountered (NB no flat soled shoes allowed).
  • Waterproof jacket
  • Windproof leg cover
  • Other waterproof & warm body cover appropriate for the prevailing weather conditions.
  • Sufficient coins for telephone calls or a mobile phone.
This meant a little bit of shopping, and I am planning an update on kit at some point in the future to cover this so I shall not go in to great detail here.  The weekend of the race drew near and I was getting excited both by this and the Hillsborough Parkrun pacing event which went really well (I finished in 25:29 with an average pace of 5:05/km) and gave me the confidence I needed; The race has timing awards which for men were Gold sub 0:26 Silver 0:26 – 0:30 Bronze 0:30+. Gold was not within reach of me as it would need a pace of 4:44/km but I could get in the Silver bracket as long as I was under 5:27/km


The day dawned clear and dry with some breaks in the cloud, and I set off for Bradfield with plenty of time as I wanted to get parked. I registered and due to the fine weather the kit list was relaxed to little more than a windproof top, but I decided to still run with my bag as practice for some longer trail runs I plan on doing. I had time to kill before my start time so I did some warm up laps of the cricket pitch (hey, I am taking this seriously) before walking over to the start, scoping the course a little while chatting with some fellow runners.  Competitors on the 14k were already coming past us at this point, having started earlier with the idea that the finishes were vaguely synchronised.  We had the race briefing and an introduction to the sports dibber system being used for timing here, and then we were started one at a time. Somehow I ended up at the front of the line...

Dibber in the box, watch started, and off I go, just as another 14k runner came round the corner. I decided to go for a fast start so that I had something in the bank should I flag later, and soon overtook a slightly surprised looking man who was already 2/3s of the way in to his run.  First km down in 4:47 - fantastic, but I worry I am going slightly too fast now and back off to a 5:00 for the second km.  By this point the dam wall which marks the end of the reservoir and the turning back point was well in site.  I was slowing by this point, probably having cooked it a little in my pelt down the western bank of the reservoir but I was having fun.  

The eastern bank wasn't as smooth and free flowing as the western bank, being more twisty and undulating. This slowed me a little more, so having the fast start behind me was looking good as it kept my overall pace on target.  As I pushed on I saw Chris Meads out taking the official photos for the event which spurred me on to push harder again - I even managed a "Thank You" as I passed him - and the effort clearly paid off as he caught this shot of me which for 4km in I think is looking rather good.


The end was in sight now and when I hit the road again I knew I was getting close and started pushing harder, before giving it my all to get across the final field and over the line. 28:24 on the watch and thanks to the official results being compiled live on the day I got confirmation pretty much straight away. After a sit down and some stretches (And a quick text to let people know how I had done) it was back in to the hall for some much needed refreshment.


I hung around for a while watching people finish, my favourite moment being when a man came over the line to the cheering of his young daughter exclaiming "Daddy daddy daddy!" excitedly, as soon as he had stopped and reality caught up with him he turned to her to be greeted with "Daddy I missed you!" - a really touching moment which warmed my sentimental heart.  Once all the short course runners were over the line I headed home, and reflected on the fact I had run that at a 5:10/km pace, something which only a few months ago was unthinkable for me.  I finished 4th of 6 in my class (Male 17 - 39) and 12th out of 36 overall for the 5.5k course which astounded me, and I comfortably got my silver.  I want to do a 5k at under 5:00/km now, but next year if I do this again I will be doing the long course.  Next up for me at present is the Neurocare Head Start 10k at Rother Valley where I want to be under 1:00:00 and am currently planning on trying to pace at around 5:40/km which should see me come in at between 00:56 and 0:57

 

Saturday 1 April 2017

Hillsborough Parkrun April 2017 Pacing event

A Parkrun does not normally warrant an update of its own being a regular occurrence, but this was a pacing event so it was a bit different. My plan was to follow the 26 minute pacer, my best for the course having been 26:44 the previous weekend and I prepared as I all too often prepare for a Parkrun by going to the pub, on this occasion popping in to support The Bar Stewards.  What didn't help was waking up at 4am and being unable to get back to sleep.

On the morning of the event I walked to the park and met up with Becky who was the pacer for 38 minutes and Liz who was planning on trying to stay with the 27 minute pacer.  Liz has been by my side since I started trying to run seriously and helped me pace my first Parkrun, I am very grateful to the support she has given me in getting in to this running thing, and hopefully we'll be hitting some longer peak trails together in the coming months.

After the customary race briefing came the customary start, as over 300 people all try and get away at the same time and find their space.  We were caught up in traffic on the run to the first corner and our pacers were disappearing, so it was time for a bit of off road overtaking to get with the bunch.  I tracked my pacer down and found myself keeping going, I was happy with this pace of around 5:00/km so I carried on past them, settling in to a comfortable rhythm and slogging up the hills.  I was surprised to find myself overtaking the 25min pacer at one point as well, but I just couldn't sustain the effort and they came back past me. It was hard going, but the pacing event really made me dig in and push.

Finally I was on lap three and giving it all I had left to get to the finish line (which really wasn't very much).  Over line and my watch said 25:33, I had smashed my PB from the previous week of 26:44. Official timing later put it at 25:29, I was a little late to stop the timer as I was exhausted.  After queuing for barcode scanning, jellybean scoffing and of course ringing the PB bell I walked back to encourage Liz home, but couldn't find her so walked up to the finish to find she was so close behind me she must have already been in the queue by the time I was scanned, having finished in a brilliant new PB of 26:34.

  Together we waited for Becky to finish who was worried she had gone too fast, but 37:12 on a 38min pacer is fine and she was closer than some of the others.  Then (of course) it was off to The Pie Parlour where I pushed the boat out and went for a Hearty Full rather than a light Full.  The rest of the day was very sedate as the early morning combined with beer the previous night caught up with me and combined with the effort of the Parkrun - and I had to save myself for the next day...