Creating Interval Workouts

Post questions and issues with Concept2 PM3 SDK
Locked
RandyF
Paddler
Posts: 2
Joined: January 17th, 2021, 1:50 am

Creating Interval Workouts

Post by RandyF » January 17th, 2021, 1:54 am

I've got a little project for myself going, and I've implemented enough CSAFE to start a basic workout, but I'd like to be able to create an interval workout - does anyone have any information about how to do that?

I know it is possible because my normal mobile app I used does it just fine (LiveRowing), and from what I understand, the Bluetooth interface is just CSAFE over Bluetooth.


Thanks!

User avatar
tijmenvangulik
500m Poster
Posts: 61
Joined: November 25th, 2012, 10:24 am

Re: Creating Interval Workouts

Post by tijmenvangulik » January 26th, 2021, 12:23 pm

Hi,
With Blue tooth you can directly to connect to characteristics (this is for getting information) or talk using csafe. For setting/sending data you need csafe. It is explained here:

https://www.concept2.com/files/pdf/us/m ... nition.pdf

When you download the software development kit they also provide more info on the csafe protocol and the commands.

https://www.concept2.com/service/softwa ... opment-kit

For blue tooth it best to pick a library which already implements the csafe protocol and some commands. There are multiple libraries available on git hub.

There

RandyF
Paddler
Posts: 2
Joined: January 17th, 2021, 1:50 am

Re: Creating Interval Workouts

Post by RandyF » February 2nd, 2021, 10:49 am

Thanks for the reply, but I have done all of that - I've implemented a CSAFE Protocol stack in C# and I can send/receive CSAFE commands from my PM5.

Currently I can:
* Set a single-distance workout length.
* Set a single-time workout.
* Set a Target Pace
* Set Target Calories
* Set the Program
* Start the Workout
* Record Data during the workout.
* Retrieve all post-workout data.


My question, specifically, was: "but I'd like to be able to create an interval workout "

Specifically, I'm looking at creating a workout like:

3:00m/0:30r/5:00m/1:00r/8:00m/1:30r/6:00m/1:15r/5:00m/0:00r

From what I have gathered in research for this, the commands to do this ARE NOT included in the Concept2 links that you kindly attached.

As I said, I know this is possible because this is the exact workout I use on my mobile app that connects with BLE. However, I understandably can't snoop their traffic to see what commands they are sending (unless I can, I'd take that as a solution as well).


Regards,

A

Tsnor
2k Poster
Posts: 278
Joined: November 18th, 2020, 1:21 pm

Re: Creating Interval Workouts

Post by Tsnor » February 15th, 2021, 1:46 am

Suggest you email Concept2 directly with a pointer to this thread or a cut/paste. They are generally very helpful even with odd questions.

Try info@concept2.com as an email or use the contact info from their website. When you get an answer please post back here. I'm sort of interested too. Thanks.

Mark Pettit
Paddler
Posts: 7
Joined: December 20th, 2016, 3:01 pm

Re: Creating Interval Workouts

Post by Mark Pettit » March 2nd, 2021, 6:13 am

I'll be keen to see the result of this. But realistically, I doubt you'll get any response. What you're asking for is the SINGLE most obvious feature wanted by developers for the erg, and it just never comes. You'd swear it was a national security issue. The second most obvious feature of course is the heart rate monitor cool-down reading. But that will also never come.

FooTheBar
Paddler
Posts: 12
Joined: March 8th, 2018, 4:05 pm

Re: Creating Interval Workouts

Post by FooTheBar » March 26th, 2021, 7:00 am

I also to came here with this exact question. Maybe it's time to create a user-developed PM. (e.g. a small microcontroller that reads the signals from the flywheel and sends the info to an App).

Mavvie
Paddler
Posts: 2
Joined: April 18th, 2021, 7:58 pm

Re: Creating Interval Workouts

Post by Mavvie » April 18th, 2021, 8:09 pm

I'd love to be able to do this as well.

The c2 csafe.h does mention some commands which may make this possible, but of course there's no documentation, example, or even mention of these commands on the entire rest of the internet.

https://github.com/tijmenvangulik/PM3Mo ... afe.h#L581

I tried some of the obvious ones (set workout type to 7, set workout interval count, ...), with no success.

User avatar
Citroen
SpamTeam
Posts: 7225
Joined: March 16th, 2006, 3:28 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Creating Interval Workouts

Post by Citroen » April 19th, 2021, 3:42 am

Mavvie wrote:
April 18th, 2021, 8:09 pm

The c2 csafe.h does mention some commands which may make this possible, but of course there's no documentation, example, or even mention of these commands on the entire rest of the internet.
There used to be a full spec for CSAFE at http://www.fitlinxx.com/csafe/ but that has withered away.

With a bit of Google Fu I've found a copy of a C2 document at https://c2usa.fogbugz.com/default.asp?W13&nRevision=2

Mavvie
Paddler
Posts: 2
Joined: April 18th, 2021, 7:58 pm

Re: Creating Interval Workouts

Post by Mavvie » April 19th, 2021, 12:23 pm

So I took the advice I saw and sent C2 an email. They got back immediately and sent me the most recent PM/CSAFE communication spec which includes examples for setting up interval workouts! Can't wait to add this to my project. I will post it here at some point; it's inspired by ErgometerJS but aims to be a simpler/more minimal interface.

Here's a copy for anyone else interested. See page ~73: https://drive.google.com/file/d/14kArl8 ... sp=sharing

By the way, you can still access the fitlinxx docs through the internet archive: https://web.archive.org/web/20071207110 ... mmands.htm
But of course this doesn't contain any PM-specific commands.

User avatar
Citroen
SpamTeam
Posts: 7225
Joined: March 16th, 2006, 3:28 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Creating Interval Workouts

Post by Citroen » April 19th, 2021, 1:46 pm

It would be even better if Concept2 could publish all of their non-confidential CSAFE docs in a small corner under https://www.concept2.com/service/software

I'd expect Scott H @ C2 has a library full of stuff that could be shared.

Mark Pettit
Paddler
Posts: 7
Joined: December 20th, 2016, 3:01 pm

Re: Creating Interval Workouts

Post by Mark Pettit » April 27th, 2021, 7:55 am

Well Mavvie - I congratulate you. You have achieved what no man dreamed possible. I guess still too much to ask for wrt Heart Rate cool-down/recovery.

FooTheBar
Paddler
Posts: 12
Joined: March 8th, 2018, 4:05 pm

Re: Creating Interval Workouts

Post by FooTheBar » May 6th, 2021, 4:32 pm

Did you manage to use the proprietary commands to create an interval training? I can use the normal commands, but my PM5 ignores the commands you mentionen on p. ~76.

Locked