-
Notifications
You must be signed in to change notification settings - Fork 40
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
Experimental support for Keiser M3 #50
Conversation
Sorry, realized that I had a typo in the instructions for testing above. Could you try again? If you only have a Bluetooth 4.0 dongle right now, this might indeed not work. Gymnasticon needs to receive and send, which is only possible with Bluetooth 4.1+ over the same dongle. Let me see if I can build you a simple test script, just to confirm the communication with your bike. |
@nealjane I added a very simple test script, just to validate the communication with your bike.
Just download it into the gymnasticon folder with
and then execute it with It should show you Power and Cadence values - along with some other debug data. Just validate that the Power and Cadence values displayed match what you see on the console. |
@chriselsen. Hi Chris, Ran script you wrote this am. watts and power are shown on screen = bike screen.-fab! (Can’t take pic from bike as I’m peddaling - but it’s definitely picking up correct rpm and power) |
@chriselsen - just realised/reread the instruction on front page, I’m using pi zero W - so does that mean I don’t need the extra usb Bluetooth 4.1 dongle as it’s built in?! |
That's great news! Than the experimental bike driver should work as expected. As you're using a Raspberry Pi Zero W, you don't need any external Bluetooth dongle. Let me know how it went. |
@chriselsen , unplugged my bt4.0 and restarted pi0w- it’s just hanging at ‘connecting to bike’ |
You'll have to follow the steps in post 1 to actually download and build the new driver. Also the command line option should be Looks like you're rebooting your Pi. In that case you also want to stop the gymnasticon service with |
@chriselsen Giving me an error as follows from typing - ‘git fetch origin pull/50/head:keiser-m3-experimental’
|
You have to be inside the gymnasticon folder when executing the command. |
Hey Chris, started playing with this as well. Once you stop pedalling on the keiser, it shows average cadence/power for about a minute before the device shuts down. It's specified by the data type integer per keiser specs: https://dev.keiser.com/mseries/direct/#advertising-data-structure So ideally you should only report data when it is realtime data. Don't think you make that distinction currently? Cheers |
@tompijls Thanks for the feedback and the pointer. I now added support for real-time vs. summary mode. Give it a try and let me know how it's working for you:
|
Yes, this seems to work partially ==> although after a little while it stops reporting and i get following noble warning. [2021-02-15T21:41:46.291Z] pedal stroke [timestamp=1613425306291.1465 revolutions=10 power=11W] |
Now start pedaling and see what happens. |
I assume that's when you're still pedaling? Can you try running it with debugs enabled? |
seems to be unrelated to your keiser implementation, but rather when I try to add the cycling meter in the mPaceline app (which seems unsupported for now) Trying to connect the sensor stops the capturing of data from the keiser (or the bot bike) Shall i raise the issue in the main issue section of this repository? |
Yes, please raise a separate issue for this. Especially if this also happens with the "bot" bike. It's interesting that you seeing a noble error. Noble is used for communication between gymnasticon and the source bike, not between gymnasticon and any receiving devices (Zwift, apps, sports watches, ...). Please do let me know if there is anything not working with the "Keiser" bike driver though. |
Ok, I used the gymnasticon image (yesterday did manual install) with a clean install. Bot now works correctly, noble warning still shows up Keiser bike reports data correctly until the moment i connect the sensor in the app, than it somehow stops getting data. [2021-02-16T07:28:02.871Z] pedal stroke [timestamp=1613460482871.7336 revolutions=52 power=16W] |
Morning Chris- managed to get it all working this am on a new sd card. Text shown on screen matches the keiser bike - so its working. 😀👍🏻- Your hard work on this is very much appreciated. (used your most recent update) connecting to Zwift/peloton cadence makes it go haywire pi stating fixed power and cadence which then doesn’t stop even when you stop. (cadence was at approx 100 on bike before i started to connect to Zwift, after that cadence and power were stuck on the last recoded figures. I disconnected from zwift bluetooth where the buffer finishes..) pi@gymnasticon:~/gymnasticon $ NODE_DEBUG=gymnasticon:bike* gymnasticon --bike keiser .......242.6929 revolutions=37 power=66W] |
Will you turn it into a new release including image?
Cheers
Tom
…________________________________
From: ptx2 <[email protected]>
Sent: Sunday, February 21, 2021 1:41 AM
To: ptx2/gymnasticon <[email protected]>
Cc: tompijls <[email protected]>; Mention <[email protected]>
Subject: Re: [ptx2/gymnasticon] Experimental support for Keiser M3 (#50)
Merged #50<#50> into master.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAGK6CCLLAVDO5CRP4GRX33TABJE5ANCNFSM4XSVKZWQ>.
|
This is what the output shows when at the end of my run - bike disconnect after 5 minutes although the keiser switched of way faster [2021-02-21T12:14:22.686Z] received stats from bike [power=50W cadence=63rpm] |
@robcalm Great to know about the RPi3B+! Thanks for reporting that. I've added it to the README. Can you confirm that you had the latest code when you did your last test? If not, hopefully your issues go away after grabbing the latest code. From your current gymnasticon directory, you can get the latest code by:
|
@tompijls Chris did mention somewhere above that timeout is probably too long and I agree. However in practice, had you started riding again during that 5 minutes, I believe it would have started to pick up stats again, as it should still be scanning. Let us know if you think that's not the case. Looking at that log I actually don't think we need to restart the BLE scan there either, as it should still be scanning, just not finding anything. But in practice I don't think it matters. Can you confirm your last ride was with the latest code? Besides the 5 minute timeout, does everything else still look good? |
Just tried again, and indeed within the 5 minutes it picks up again. everything works fine with me in combination with mpaceline. i ran with debug settings i assume i used the latest version: ran this: output attached below is the time around 1st and 2nd session. in between the keiser shut off completely [2021-02-21T15:35:52.196Z] received stats from bike [power=0W cadence=0rpm] |
Great, thanks @tompijls! |
I ran the build as you suggested to make sure that everything was up to date and the dropouts still seem to be happening. see below for the basic log. Does it maybe look like I broke my build somehow if it's still not working right. I've bashed this one around a bit. I'd stopped pedaling at the end where there are consecutive zero data points So I tried to rebuild per tompijls again using: rm -fr gymnasticon ...still dropouts, and none of the |
Looks like these dropouts are rather causes by poor Bluetooth connectivity. Can you make sure that when running gymnasticon manually you don't have the gymnasticon service running accidentally: Also try running gymnasticon in debub mode for the bike: |
Hi Chris, I've appended the debug log to my previous post. What do you think? I'll turn off wifi and let you know if it improves... I softblocked the wireless lan and we are still getting the [stats timeout:restarting BLE scan] appearing frequently. with wifi disabled I can't ssh so no pic unfortunately. I shut down the service before I did the last run |
Yes, you indeed have a bike running version 6.22, which sends out data only every 2 seconds. That doesn't play well with the stats timeout.
Afterwards build it again with |
I made the change you suggested and the "Stats timeout" messages were much reduced. So I increased the value from 5 to 7 and the messages have stopped, even with the adapter wifi running as well. Here is the debug log: It doesn't seem to be getting any zero values it wants to replace with the last good value, and I pedaled for about 10 minutes. I've run fulgaz and overall it behaves really well. The only quirk is that when you register the power and cadence devices when the program starts, it shows multiples of each. It doesn't seem to matter much which one you choose. Do you think this will always be something that I need to reconfigure in the .js file due to my old firmware, or do you think that it would be sensible to put variant keiser configs into the master? Thanks very much for the help today. |
also, how could you tell the firmware version from the debug log? I don't see 6.2.2 anywhere. |
02 01 06 22 |
Definitely not! :-) The idea behind Gymnasticon is to be able to buy a cheap Raspberry Pi Zero W or alike for < $50, load a pre-made OS image on it, power it up next to your bike and forget about it. Right now for bikes outside Peloton and Flywheel you still need to configure the bike type. But even with feature request #57 that need should go away and the config file should only be for advanced users.
That's definitely good to hear. In your debug log above, I can see that data packets do get lost once in a while. So you might still try to position the Raspberry closer to the bike to see if that has an effect. The challenging part here is that you are using a Raspberry device that previously hasn't been tested with Gymnasticon and that is known for Wifi/Bluetooth issues, as well as a new bike driver, which most certainly still has some growing pains. Thanks for sticking in here and being a good guinea pig! This is certainly helping others with a similar setup as we iron out the kinks. The purpose of the "stats timeout" value that you adjusted is the following: One question for you (@robcalm), @tompijls and @nealjane: How long does it take your bike to turn off / go to sleep automatically after you start pedaling? I would expect a value in the 30 - 90 sec range.
Based on your description above it sounds like you paired your Windows machine to Gymnasticon at the OS level. You shouldn't do that. Instead Zwift/FulGaz will pick up the Bluetooth signal from Gymnasticon by itself. You should especially not need to have to change anything on Gymnasticon itself to make this work. |
@chriselsen , just timed it - from when I stop peddaling to screen going off is 60 seconds. All working fine with build 1.4 for me so far! 👍🏻 |
confirmed - about 6 seconds until it switches to summary mode, and just over 1 minute before the display switches off version 6.40 |
@tompijls Where does it say the version??? - asking as mines a v old m3 with a Bluetooth addon (ive have it set to higher signal rate- but just wondered what it might say my version is) found it- you’ve noted it above- will check later. |
Created Issue #60 to work on this. We will have to increase the Stats timeout for the older bikes. But I'm also wondering if we can lower the values for the newer ones. Loosing 3 packets should be enough to tell that there is something wrong. @nealjane and @tompijls: As you have newer versions of the Keiser bike, can you please try changing this value within "gymnasticon/src/bikes/keiser.js" to:
Afterwards build it again with npm run build and then run it with NODE_DEBUG=gymnasticon:bike* gymnasticon --bike keiser. You should still not see "Stats timeout", even within a 10 - 20 minute ride. |
chris, i recreated from image. do i need to do a pull request first? |
The changes are now in main, so you only need to do:
If the gymnasticon folder in |
First output. Stopped pedalling after about 40 seconds, then started again. I guess we need to look into the realtime flag (5th byte), which I think you now filter out? Can do a longer session in the morning. GYMNASTICON:BIKES:KEISER 8533: Found Keiser M3: M3 Address: c7:bc:77:bb:1f:8a Data: <Buffer 02 01 06 40 00 72 a3 01 00 00 13 00 02 00 00 35 02 80 08> Power: 19 Cadence: 42 |
Yes, I did pair through the OS. If I don't do that then software like fulgaz on PC can't see gymnasticon / the bike. I've tried with two PCs (one very new and one older) and both behave the same way. Any idea why this might be? Might there be something weird about the adapter config at the PC end? The same issue is pervasive in keiser2Zwift, but in that case I haven't found a workaround. I'll try playing with the bot a bit, and create a new issue ticket if you think that's worthwhile. Also, I have a 60s timeout on the bike computer too. My RP is about as close to the bike as it can be - less than 1 m while testing. What is it in the most recent log I posted that indicates continued data dropouts? To my untrained eye it looks clean. |
Also, is it possible to donate to this project? |
@chriselsen changed Stat to 1.0. I had Not a single Timeout when I rode the bike for 3-4 mins this evening (couldnt get it working in time for my bike rideearlier this evening for a longer ride sorry).
|
@chriselsen , what are these lines actually indicating? I see I have quite a few more than @nealjane ? [2021-02-22T18:16:50.345Z] pedal stroke [timestamp=1614017810345.2573 revolutions=92 power=60W] |
@tompijls i didn’t add all the lines - was only an Exttract of last few seconds (as I had no timeouts when I searched it) |
@chriselsen thinking about it, Id suggest you go with Toms results though - as my bike is probably ‘non standard’ due to having a very specific Bluetooth addon
|
Thanks for providing the feedback! This looks good. To answer some of the questions:
For you three everything should be working fine and as well as technically possible by your bike. The changes to the Keiser bike version detection as well as the bike autodiscovery won't change anything for you. But for new users it will mean that plug & play becomes reality and no configuration whatsoever is necessary. That will probably take 1 - 2 weeks to implement, test and release. |
Thanks @chriselsen and @ptx2 - any testing required just let me know! By the way, i did post about gymnasticon in the 2.5k user Keiser Peloton Group and got a first positive reply - downside may be there will be loads more feature requests coming in ;-) |
To try this out: