Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zwift on IOS requires disabling FTMS #7

Open
chanyork opened this issue Mar 8, 2022 · 23 comments
Open

Zwift on IOS requires disabling FTMS #7

chanyork opened this issue Mar 8, 2022 · 23 comments

Comments

@chanyork
Copy link

chanyork commented Mar 8, 2022

I am having trouble to connect to zwift on ipad. Can connect to the power via bluetooth but when click on cadence it found nothing.

@ajs123
Copy link
Owner

ajs123 commented Mar 8, 2022

Hi @chanyork,

A couple of questions...

  1. Do you have both power and cadence showing on the display?
  2. Does the power reading show up correctly in Zwift?

@chanyork
Copy link
Author

chanyork commented Mar 9, 2022 via email

@ajs123
Copy link
Owner

ajs123 commented Mar 9, 2022

Hi,

Can you see what happens if you disable FTMS instead of disabling CPS? FTMS doesn’t provide a cadence; it provides a crank count and time and leaves it for the app to calculate cadence. And the speed (Km/hr) provided with FTMS is not correct.

Let me know!

Alan

@chanyork
Copy link
Author

chanyork commented Mar 9, 2022

let me try that this few days.

@ajs123
Copy link
Owner

ajs123 commented Mar 9, 2022

Thanks.

Actually, when using FTMS KBikeBLE should provide a cadence. It is for CPS that a crank count and time are provided. Sorry about that! But the speed provided with FTMS is just a placeholder, and most apps using FTMS expect to control the resistance (which would require a motor on the magnet assembly). I’ve thought about removing FTMS code but left it in just in case someone had reason to use it.

Almost all of the testing has been done with CPS, so do give that a try!

@chanyork
Copy link
Author

Hello Alan,

Testing results as follow.
Device: Ipad Mini
Device: Iphone 13
Software: Zwift
FTMS enabled and CPS enabled - Cadence can not connect even bluetooth name not updated in Power but connected
FTMS enabled CPS disabled - OK
FTMS disabled and CPS enabled - Cadence can not connect even bluetooth name not updated in Power but connected
FTMS enabled and CPS enabled - Cadence can not connect even bluetooth name not updated in Power but connected

Software: Rouvy
FTMS enabled and CPS enabled - All Good.

I am not too sure what system Zwift is using but seems like it has issue with CPS.

@ajs123
Copy link
Owner

ajs123 commented Mar 10, 2022

To be sure I understand…

Everything works in Rouvy - both power and cadence coming through correctly?

When Zwift connects for power, is it still reading zero?

thanks!

@chanyork
Copy link
Author

chanyork commented Mar 10, 2022 via email

@ajs123
Copy link
Owner

ajs123 commented Mar 10, 2022

Hmmm...

My first guess was that Zwift looks only for FTMS and something is wrong in how the FTMS data are formatted. Most testing of FTMS has been by inspection of the data in Nordic nrfConnect and Adafruit Bluefruit Connect apps and comparison with the spec. On the other hand, you're getting the same behavior when disabling FTMS.

Let's be certain that FTMS is really being disabled. In addition to

// setupFTMS();

at KBikeBLE.ino line 615,

try

// Bluefruit.Advertising.addService(svc_ftms, svc_cps); // Advertise the services
Bluefruit.Advertising.addService(svc_cps); // Advertise only the cps service

at line 311.

@chanyork
Copy link
Author

chanyork commented Mar 10, 2022

Yes, the below works for all the apps i have. I even removed the adddata part as well.

// setupFTMS();

at KBikeBLE.ino line 615,

try

// Bluefruit.Advertising.addService(svc_ftms, svc_cps); // Advertise the services
// Bluefruit.Advertising.addData(0x16, FTMS_Adv_Data, 5); // Required data field for FTMS
Bluefruit.Advertising.addService(svc_cps); // Advertise only the cps service

@ajs123
Copy link
Owner

ajs123 commented Mar 11, 2022

Just to be sure - Zwift works now? If so, I'll disable FTMS at least temporarily.

@chanyork
Copy link
Author

chanyork commented Mar 11, 2022 via email

@ajs123
Copy link
Owner

ajs123 commented Mar 11, 2022

Great!

I may have found the problem. The Fitness Machine Feature characteristic has Resistance level supported unset (because the app can't change the resistance like it could with a trainer). But in the Indoor Bike Data characteristic Resistance level present is set and the resistance is included among the data fields. I'd thought that it was OK to report the resistance even if the app can't change it.

As I re-read the spec, the resistance shouldn't be included in the Bike Data. I can give it a try, maybe this weekend.

@ajs123
Copy link
Owner

ajs123 commented Mar 11, 2022

I just committed changes to remove the resistance from the Bike Data characteristic. Not tested yet!

@chanyork
Copy link
Author

I just tried the new code. It work for a short period and was back to the same situation.

@ajs123
Copy link
Owner

ajs123 commented Mar 11, 2022 via email

@ajs123
Copy link
Owner

ajs123 commented Mar 11, 2022

The latest commit provides options (options.h, around line 98) to separately enable CPS and FTMS services. On my test system (iPad), I have to disable FTMS to work with Zwift.

Using CPS, Zwift sees both power and cadence and it calculates speed.

@chanyork
Copy link
Author

yes I was pedaling occasionally to keep the Arduino on. So at the moment I disable the FTMS.

@ajs123
Copy link
Owner

ajs123 commented Mar 16, 2022

For the benefit of others with this issue, I changed the title.

@ajs123 ajs123 changed the title Issue to connect to IPAD/Iphone Zwift on IOS requires disabling FTMS Mar 16, 2022
@ajs123
Copy link
Owner

ajs123 commented Oct 11, 2022 via email

@chanyork
Copy link
Author

chanyork commented Oct 11, 2022 via email

@chanyork
Copy link
Author

chanyork commented Oct 11, 2022 via email

@ajs123
Copy link
Owner

ajs123 commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants