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 Click handled #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Zwift Click handled #3

wants to merge 1 commit into from

Conversation

cagnulein
Copy link

A very raw Zwift Click implementation. It worked
Feel free to clean the code!

@ajchellew
Copy link
Owner

Thanks for this, very interesting and given I don't have a Click, it gives me some insights

Confirms my guess in #2 that BrevitDeviceType BC1 is the Click, and all the assertions that this protocol is not just for the Play Controllers.

  • Would it be possible to provide a few lines from:

    Logger.d("Click Button Press ${data.toHexString()}") ?
    I'm curious to see what Protocol buffer type this is, at least currently I haven't managed to spot it from what I know.

  • Does the Click connect to Zwift and Zwift application relay to the Hub, this is my other assumption that I can't prove?

I will try to change the code so that the Click and Play are handled separately (just a bit OCD unneeded-ness)

@cagnulein
Copy link
Author

Confirms my guess in #2 that BrevitDeviceType BC1 is the Click, and all the assertions that this protocol is not just for the Play Controllers.

Exactly, it was my thought too

  • Would it be possible to provide a few lines from:

    Logger.d("Click Button Press ${data.toHexString()}") ?

Sure

I'm curious to see what Protocol buffer type this is, at least currently I haven't managed to spot it from what I know.

  • Does the Click connect to Zwift and Zwift application relay to the Hub, this is my other assumption that I can't prove?

I don't have the hub so I can't say this :) I bought this only to integrate into my qdomyos-zwift app https://github.com/cagnulein/qdomyos-zwift/

I will try to change the code so that the Click and Play are handled separately (just a bit OCD unneeded-ness)

Hehe sure! Go on!

I'm also porting this into swift.

I started doing this using openssl but it was so painful to debug

@ajchellew
Copy link
Owner

I bought this only to integrate into my qdomyos-zwift app https://github.com/cagnulein/qdomyos-zwift/

Its cool if this little boredom side project of mine has been any help. :)

I started doing this using openssl but it was so painful to debug

When I did the .NET port I initially tried to use the built in .NET crypto libraries, switched to BouncyCastle and got it working in no time.

@cagnulein
Copy link
Author

cagnulein commented Feb 3, 2024 via email

@cagnulein
Copy link
Author

@ajchellew I just made an astonishing discovery.

if i send

" >> 52 69 64 65 4f 6e // handshakeStart"

the click sends the data without any encryption!

do you see the same on the zwift play device?

@cagnulein
Copy link
Author

to answer to your request this is the async bytes returned

when no buttons are pressed

"37 08 01 10 01"

plus pressed

"37 08 00 10 01"

minus pressed

"37 08 01 10 00"

cagnulein added a commit to cagnulein/qdomyos-zwift that referenced this pull request Feb 6, 2024
@ajchellew
Copy link
Owner

Wow, I'm certain the play controllers never worked without encryption. Maybe the click is a little less crazy since really who cares if that data is intercepted.

That said there's been at least 2 updates to the controller since I first did this, so maybe it's possible now.

I've got the Kickr Core and virtual shifting now, so I'll probably have a look over the weekend. It answered my question, the trainer and controllers talk via Zwift. They aren't paired, and it makes sense as you see what gear you are in on screen.

@cagnulein
Copy link
Author

cagnulein commented Feb 8, 2024 via email

@ajchellew
Copy link
Owner

Kind of nice, makes the hardware easier to be reused. It's got to have changed in a new firmware, I'm not the only one that fought with the encryption. Makinolo would have had an easier time with his GTA mod

@cagnulein
Copy link
Author

cagnulein commented Feb 8, 2024 via email

@ajchellew
Copy link
Owner

@cagnulein you are right, having looked at it I never thought to try RIDEON without the extra 2 bytes, I tried without the key after and obviously that didn't work.

I've just committed up a bit of a refactored version of this PR. I'm hoping it should just work for the Click but it might not. The data you provided helped add the decode in the long protobuf way. I've also added an ENCRYPTED flag that bypasses all that too.

@cagnulein
Copy link
Author

cagnulein commented Feb 10, 2024 via email

@cagnulein
Copy link
Author

@ajchellew did you try the new firmware https://zwiftinsider.com/play-firmware-1-3-0/ ?

@cagnulein
Copy link
Author

the new firmware works with qz :)

@ajchellew
Copy link
Owner

@cagnulein hadn't seen this, just updating them before I do a ride, I assume nothing changed in the BT protocol itself

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

Successfully merging this pull request may close these issues.

2 participants