What the Alternative API mean for ConnectStats

Most users experienced new activities from Garmin not syncing up with ConnectStats since last week (March 23rd or so). As described in the last post, it can be fixed by using an alternative API.

It looks like it’s going to be a permanent change. It also has some minor consequences for users.

What is the alternative API?

It’s probably obvious to most of you, but the API is the mechanism that third party (ConnectStats) can use to access the data stored by a provider (Garmin or Strava).

Garmin a long time ago had a public API to access the activities recorded in Garmin Connect. Back in 2014, Garmin decided to change it’s approach to third party. While the old API allowed a third party to access directly the running or cycling data from Garmin servers, they decided to switch to a push approach. The key consequence is that a third party now has to build and maintain an infrastructure to store the data in the cloud after it was pushed by Garmin. This is great for a platform like Strava, it makes for a great user experience. But it’s impractical for small independent hobbyist developers like myself with ConnectStats like app.

While Garmin announced they would deprecate the old API in 2014, in practice until last week it continued to work more or less. It just had regular tiny changes, which beside the fact that the change came as a surprise outage to developer via lots of sudden bug reports, they were usually easy to keep up with.

The old API continued to work and was used by their own Garmin Connect website. since they upgraded their website to the new look shortly after the API announcement, they also slowly started to upgrade the site to a very different API. This is what the settings “Alternative API” refers to.

Practical Difference between the two API

ConnectStats downloads data in two stages. The first is to get a summary of all recent activities, which is intended to be faster. Then when you go and look at an activity in details, it will downloads all the individually recorded data point to create the graphs and the track on the map. The details can be a lot of data, so it’s an optimisation to only download the summary first.

The main difference between the two APIs, is that the new one (alternative) contains a lot less information in the summary. Using the new API, a lot of the extra information (for example: running dynamics, min and max, etc) will only be downloaded while getting the full detail of the activity. It’s not a major issue, as in practice when you select an activity, you need to wait a bit for the graphs and map data anyway.

Where it can impact the user experience is in some of the historical statistics pages. Some historical statistics on the extra information will be missing until each activity detail is downloaded. To mitigate the issue, ConnectStats tries to automatically download the last dozen or so activities that are missing detail.

Will the old API come back?

Only Garmin knows. But at this point I would anticipate it won’t. ConnectStats lived on borrowed time since 2014 when they announced they would deprecate the API.

Also the behaviour of the old API is not that it errors, but it contains a lot less data (almost none). In the past changes, it always was either some error, or some subtle change that broke ConnectStats use of the API. This time feels different.

What’s next?

I am releasing a new version of ConnectStats (4.3) that will by default use the new API. I keep the setting to switch back, in case things change in the short term and to keep optionality.

As in all the previous discussion on API change, I also continue to prepare for a day when Garmin may completely shutdown the API ConnectStats uses.

At such time the only option to continue using ConnectStats will be to switch to another service provider like Strava.

Using Strava data though has the drawback that it contains a lot less details on each activities (no running dynamics, etc).

Alternatively, now the the app is open source, if it comes to that we may link it to other service and hopefully the app will continue to live.

 

Activities not updating, how to fix…

Today, Friday march 23rd, 2018, the garmin api ConnectStats uses by default is not returning any new activities. It can be fixed by switching to the alternative api supported by the app.

 

This happened already in the past, but it was temporary then. Garmin API Change: Good News Bad News,

Assuming this is a permanent change, I’ll try to release shortly a new version that will by default use the new API. Meanwhile people need to switch manually if they see the issue.

Similar Summary Stats, Different effort…

While I still need to figure out how to use the new power field from Stryd, Running Power is already a useful other way to compare the type of effort of different activities. Since I got the new pod, I have been motivated to go out run more, and looking at the last few weeks, I realised that a few runs had interestingly some similar headline stats but very different feel. So I decided to see how ConnectStats displayed the differences.

In the summary, you can see the first two have very similar heart rate average, but very different pace, while the run in Shanghai has similar pace as the first one, but higher heart rate. The run in the new territories run (Hong Kong) is also interesting to compare to the Putney run (Richmond Park). Let’s dive in.

Comparing Activities in ConnectStats

You can easily compare two activities in ConnectStats by sliding the activities in the list and selecting mark. The activity will then shows in the background of the new one you look at.

A mark will be displayed to remind you which activity is the “compare” activity.

Same Heart Rate, Different Pace

The first two run to compare have an average of 176 and 175 HR respectively but a pace of 4:50 and 5:30. You can of course just look at the pace plot on top of each other, but it’s a bit messy

Note that the map will show you both activities, useful when they are on the same location, but less when they are quite different route, as here. The pace graph clearly shows that for large part of the run the pace was faster, but not very insightful. A much better way to compare the effort is to look at the best rolling plots.

You can see that it was definitely a higher power effort, but the pace shows that the slower run had more constant pace, flatter curve. The heart rate plot shows that the max effort (left part of the curve) was similar, but the tail was lower (steeper curve on the right for the faster curve). Overall a less consistent effort, but where I pushed more at time and resulted in the same average heart rate but very different pace. The power curve interestingly shows quite a higher effort. These were two different runs, the slower one was a commute run, with a backpack and on city streets with more stop and go at light. It was also early morning, so typically not when I do my best performances…

Same Pace, Different Heart Rate

We can also compare that same activity to another run a week ago with same pace (4:49 and 4:50) but higher heart rate (181 and 176 respectively).

You can see the activity being compared to (lighter colour) has clearly higher heart rate effort through out. One interesting observation is that the lower heart rate run has steeper start, which means there were a few period where I pushed rather than a continuous effort .The pace on the other hand has a quite a different profile between the two runs

The lower heart rate run has a much steeper shape, while the other one has a quite flat profile, meaning a more constant effort.

Now for the new measure of power, again interestingly the raw graph comparison is quite useless. Hard to really see much in the difference of the effort.

 But the best rolling graph again shows a very interesting story, if somewhat consistent with the other. While the effort was about the same, the higher graph shows a much more varied effort: more power on shorter time period, but converge at the end for the overall time.

The higher heart rate was just a run where I tried to push much more through out and consistently. Quite interesting that it resulted in the higher heart rate…

If you wonder why the little bump around 5min, me too! this is an annoying little bug or quirk which I haven’t yet figured out!

Time ahead

A last graph that maybe of interest, even though in this specific case, maybe less interesting in this specific case, but it shows you the time ahead (or behind) from the compared activity. The big straight drop are pauses. So you can see that I took quite a few pauses in the lower heart rate run, and it had period where I was catching up (upward slopping) and period where I was getting behind (downward slopping). On the map, the area where I am ahead are blue, and then goes to red when I am behind. Which makes it easy to see where you are behind or ahead, especially when the run is at the same place (not the case here).

Hope you found this interesting. Happy Training.

 

ConnectStats now supports #RunningWithPower for @Strydrunning!

ConnectStats now supports power for running with the latest version 4.1. This was an exciting few weeks for me, as I discovered the Stryd pod and started to incorporate power in my running. It was also a good opportunity to develop something new in ConnectStats.

Running Power in ConnectStats

If you have a stryd foot pod and use the Connect IQ field from stryd, after you record a run activity and download it to ConnectStats, you’ll be able to see the data in the activity field as below. You can of course see power as a graph, along with the other fields like leg stiffness and form power. 

One of the key reason I wanted to add power to ConnectStats was to be able to graph the  power curve, similar to what is available for cycling. This is one of my favorite plot in ConnectStats and show well how a given effort compare to other. 

ConnectStats will of course also display other useful graph like power in zone, lap view of your power, etc, etc.

Historical View of Power

The key benefit of the power curve or rolling best power is to compare from month to month the effort. So you will see in the summary statistics along with best pace and best heart rate your best achieve curve for the month, here is my curve for February.

I only got the stryd pod a few weeks ago, so I don’t yet have another month to compare, but to give a sense, here is what the comparison looks like for cycling

You can see here that the month of feb had higher best power achieved for longer, meaning I pushed more this month than the previous ones…

My experience with power so far

First, it came at a very good time, as you can see in my performance graph, I had been a bit lazy in my training and I was on the low side of fitness. Getting the Stryd, as any new sensor gadget/toy, provide a big motivational boost to get out and run more. The spike up of the performance graph in February clearly demonstrate that.The power while you run seems to be picking up hills or sprint effort pretty well, as this graph focusing on a hill in a lap of a run in Richmond park.I am looking forward to getting more insight and ideas how to incorporate running in my training. How leg stiffness will improve over time or form power, etc.

Please feel free to comment and suggest the types of statistics you would find useful to see with this new data, and I’ll try to incorporate in the app!

Happy power running!

Bonus for Mac users

I also updated Fit File Explorer to process third party field, so when opening a fit file with power data you can see it.

You can also do comparison between for example the data from the HRM run and the Stryd on vertical oscillation or other field recorded by both sensors

Another turning point for ConnectStats?

After 5 years, ConnectStats still has a lot of features to offer. There are still analysis I resort to ConnectStats to see: the month to month comparison of you best achieved heart rate, pace or power – hard to find on comparable apps, the comparison of activities, the deep dives into laps with gradient or scatter plots. I also still like the fact you can access, slice and display most numbers of your runs over time or for a given activity.

That said the app is clearly a lot less successful that it used to be. Why? I think there are a few factors.

First, I have been working on the app a lot less. I had less time to focus, but mostly, it’s hard to come up with new ideas that will make a difference in the app. It used to be that, thanks to feedback or my own analysis needs, there was always a list of new ideas to implement, which kept the app interesting for users over time. Today I don’t have a list of great ideas that would enhance the core functionality of the app, which is in-depth analytics of fitness activities. I have a few little gimmick ideas or customisation improvements that some user suggested, but nothing ground breaking.

Second, the big apps got so much better. I confess that I myself often use Strava when I just want a glance at my last activity. The social aspect is also nice and a key draw for me; but it is hard (and probably pointless) to implement in ConnectStats. Their user interface evolved a lot and look quite a lot nicer than ConnectStats. Improving that is also not simple, because the UI in ConnectStats is data driven in quite generic way. Customising the UI isn’t part of ConnectStats design.

Last and not least, the discoverability of the app has reduced a lot. ConnectStats used to appear at the top of the App Store search for Garmin Connect, just below Garmin’s own. Not anymore. First people can now pay to be first, second the App Store ranking process has changed and now ConnectStats appears quite low on the search. I don’t know what changed, but it definitely hurts the visibility of an independent app. I never advertised in the past. So search ranking in the store was the key reason I believe the app was successful, given it always had a lot of positive reviews. As I felt somewhat sad at the drop in popularity of the app last week, I did something I had always refused to do: I paid to promote the app. One week promotion on facebook, just because it was easy and facebook had emailed me to suggest it. I paid 2GBP per day for a week. It clearly had little impact. A dozen like, Yay!. Clearly a bad use of money I won’t repeat…

I will see how the story evolves. I will continue to maintain ConnectStats. Part of it because it’s fun. I always look forward to June and the WWDC (apple developer event) when they announce the feature of the next iOS, study what feature can I try to incorporate into the app and learn details about what Apple provides developer with each year. The app is also now open source, so maybe it will help someone or someone will get new ideas to share with me.

But of course I secretly hope something will happen and ConnectStats will regain a second life…

ConnectStats is now open source

I lately have not been very active in ConnectStats development. I have been quite busy, which didn’t help, but also I do not have a lot of new ideas, beside a few little features requests people sent me.

So I have decided to open source the code for ConnectStats (and my other apps). Maybe some people will want to help, or the code could help others who’d want to build similar apps. Hopefully more people will help think of new ideas or make the app better.

I definitely plan to continue maintaining the app. I released a new version (4.0) which will not have many new features but will be in sync with the refactoring and little cleanup I made before pushing the code to GitHub.

You can find the code here https://github.com/roznet/connectstats

The repository also contains the code for HealthStats, which I need to fix to work with the latest version of iOS, FitFileExplorer, an utility for macOS to open files, as well as TennisStats, an experiment to record and analyse tennis matches.

I also open sourced a few more of my apps:

My other iOS app MacroDial can also be found here https://github.com/roznet/macrodial.

And finally Simulator Data Finder, an utility to access iOS simulator files conveniently on macOS, is also available here https://github.com/roznet/iossimfinder.

 

Garmin API Change: Good News Bad News

The bad news: it seems the old Garmin API connect stats was using is no longer working for some people which results errors during download.

 

The good news is that I put in ConnectStats a way to access an alternative newer API that continues to work.

So if you get errors you should be able to fix it by going to the config screen, select services, garmin and turn alternative API on.

ConnectStats development continues…

Everything seems to be working again. ConnectStats survives another challenge and will continue its path for now. I want to thank everyone for the messages of support and positive comment on the app. It’s nice to see quite a few people still appreciate the app.

Quite a few comments talked about paying some extra fee to keep the maintenance of ConnectStats, it is appreciated but I do not do this for the money. This is a hobby, I have a day job that pays the bills. The revenue from such an app is very limited anyway. The small fee I charge for the app, is mostly to cover apple and other services fees and so I can buy guilt-free development tools or gadgets that I don’t really need, and justify it as needed to test or work on the app…

What is much more motivating for me is the support messages and continued positive feedback and reviews. So do not hesitate if you like the app to continue to review it positively on the store. If anything I am contemplating making ConnectStats an open source project, but I didn’t find the time to do the necessary refactoring and cleanup it would require to let others contribute.

A lot of the main apps provided by the big players are improving fast. We are a long way from the beginning of ConnectStats where I felt the urge to build an app as nothing provided the type of analysis I wanted. Garmin Connect is improving fast, and I really like the Strava app. I feel some of the feature I see added elsewhere are similar to some of the one built for ConnectStats offer some time back. I like to think, sometimes, that ConnectStats was a positive influence. Probably it’s presumptuous and they would have improved the apps anyway.

Where ConnectStats lacks quite behind is the aesthetics. I wish I had the time and the skills to make it look better, similar to Strava or the Withings app that I like quite a lot.

I thank everyone for the messages of support, and I’ll continue to do what I can to keep ConnectStats alive as long as possible.

Fixed and new version 3.6.1 on the way to the app store

So I managed to find some time and fix the parsing error problem this weekend. I have submitted the fix to apple, it usually takes a few days to make it to the store from here.

The API changed quite a bit, so was trickier than in the past, but the good news is that it got simplified quite a bit, so now my code to connect is much cleaner…

I know it can be a bit frustrating for connectstats users to have to live with regular issues related to log in into garmin, but let’s not forget that we need to be grateful that garmin continues to tolerate access to their API via connectstats. Their preference is for people to build a full back-end service and use their push API. This unfortunately would not be viable for a small app like connectstats, but too expensive to maintain and would take too much time for me to build. So thank you garmin for letting connectstats continue its
path.

I also want to apologise to ConnectStats users, as I have lately been extremely busy and didn’t do much new development or wasn’t very responsive to user requests. As some of you may know already, I do the app as side hobby, but have a quite busy day job. We are actually lucky, as if the outage had happened a few months ago, it would have been quite difficult for me to get the app back up and running. Beside keeping track with Garmin’s changes, a few month ago, apple made changes to its system that also broke connectstats and I was unable to push any fixes for a while. Luckily I had just resolved it a few weeks ago before the outage…

Hope connectstats despite these headwinds will continue to be available for a while.

 

Garmin connection issue again

 

As of this morning the API from garmin seem to have changed again, and connectstats can’t download activities from garmin any more. As usual when this happens, I have removed the app from sale and disabled the bug reporting while I investigate.

I will revert as soon as I figure out how to fix it.