ajs123 / KBikeBLE

Arduino-based replacement computer for a Keiser M3 spin bike, with industry-standard Bluetooth services and simple display

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zwift on IOS requires disabling FTMS

chanyork opened this issue · comments

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.

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?

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

let me try that this few days.

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!

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.

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!

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.

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

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

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.

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

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

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.

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

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