-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
[REQ] make Treadmill with simulated buttons smart #525
Comments
Hi! The best approach is to use stryd As a power sensor device and the
option power sensor as a treadmill.
So you will see the metrics from the stryd And we can easily add a way to
trim the speed at the inclination with the plus and minus buttons. What do
you think?
--
Roberto Viola
Software engineer and open source enthusiast
http://robertoviola.cloud
|
My idea was more in the direction that the treadmill is controlled not that I can measure the values. So only that my treadmill is controlled by Zwift. So the Raspi should "push" the buttons itself. Since I can get to the connector of the buttons, I could give a signal to the cable via the GPIOs of the Raspi. With this the Raspi can control the treadmill. Do I see that correctly that this would have to be built into the treadmill bridge? So as a new TreadmillClient? If I look at the treadmill bridge from ProH4Ck it is written in C#. |
or is it easier to take a Raspi that simulates a FTMS client on one side and then only controls the buttons? |
hah got it now! It's a really nice job! Yes i think it will be very easy to do! My idea so is to have:
What do you think? |
I need to understand the structure of the whole project. I am still new here. C++ would not be the problem, maybe I need some help to find the right point. And I don't know yet when I will find time to implement the whole thing. Just busy with other projects |
ok, no problem, i can give you a hand! @december-soul just put all together, the raspi, the current master branch of QZ, the stryd to QZ and the connection with gpio. Just remind a thing: Zwift doesn't control ANY treadmill. With a workaround it can control the inclination, but not the speed. |
cool Have you already tested if the activation of the GPIOs is recognized as a keystroke? |
Yes I tested the GPIOs without voltage but only as a pass-through. Everything works. |
Cool guys! I will create a new branch tomorrow for this! |
i started the branch here https://github.com/cagnulein/qdomyos-zwift/tree/treadmill-gpio |
@hb9odk @december-soul how does the electronical stuff went? Were you be able to command it through the gpios? i will try to ultimate the branch today/tomorrow |
I have the Raspi ready set up and the branch built (as far as it goes, compile error). With the GPIOs I have now decided to use relays to decouple the systems. comes with the control but on the same out with. Then I do not have to worry about electronics from the treadmill. We need a few parameters
for the GPIO handling on the RasPi i use libpigpio, for the GPIOs we must disgust.
|
thanks @december-soul i will try to continue the work tomorrow adding also these parameters (as const in the header files for now) |
No need to hurry. |
@december-soul @hb9odk finished the very first implementation. You need to have the wiringPi library and headers on the raspberry. Also you need to start the qdomyos with -gpiotreadmill argument Append a debug log if something will not work. Let me know |
Nice, i have updated my parameter suggestions above. ^^ wiringPi was nice but I read that the developer threw down and removed the libs. No idea if this is still supported now. |
@december-soul wiringpi works well and it's mantained by another group of people, but if you want you can change the calls of the wiringpi to libpigpio. the job is very easy to do. I mean, now that you have the template, you can try to develop it more by yourself, what do you think? |
i will try. when briefly skimming the code, I wondered if |
@december-soul yes when will finish it, we will have to add some ifdefs |
I have found some time to tinker. I can already control speed and inclination when I press the button. (at least the relays next to me click) at the moment i run it under Ubuntu on my laptop, there the development is a bit easier. BT is switched on. (I forgot that the raspi has no BT and my USB-BT dongle comes tomorrow). But where I'm at the moment, Zwift doesn't find anything. qdomyos-zwift is still a bit new for me, so sorry for the stupid questions: I put this empty method in the gpiotreadmill.cpp. Do I have to fill it with life? Is this for the BT connection in Zwift direction or to the (not existing) treadmill direction? Do you have any other way to contact you than here via gitlab? Seems a bit too cumbersome for me for these general questions. |
I terminated everything... should I try format and reinstall everything tomorrow with your new guide? |
been told thatrpi4 board use logic level at 3,3 volt to sence but the treadmill IR hall sensoor exports 5 volt same with control... do I need any converters or you know something about it? the gpios accept 3,3volts max and my motor board pins for Fast and Slow give 5 volts |
@melidron I don't understand: you already tested and it works? Did you change the source code? |
@calgulein dont know what source code is? I just followed the steps of https://github.com/cagnulein/qdomyos-zwift/blob/master/docs/10_Installation.md to install raspberry operating system and then QDOMYOS-ZWIFT installation nothing else till not... And then you told me to stop the Test step because it went forever to finish... ou told me you will send me a source code that will make things easier for me today... Dont know anything else |
So I don't understand your last message. You sent pictures and code. Were you just quoting an old message? |
how u do it and reply only to my message without see all the other posts before? what is the right button? I press Quote Reply and it pastes all other previous messages... How I do question to a specific person only? Sorry If I created a mess |
you have to add the @ in the textbox here to mention the user. please don't spam this thread with github general questions. thanks. you can find a github manual in the github website. thanks |
@melidron Download this on the raspberry https://github.com/cagnulein/qdomyos-zwift/actions/runs/11815625355/artifacts/2181652541 And replace it on the qdomyos-zwift folder where you already run yesterday Let me know |
Sorry wrong link, hold on |
@melidron Binary is finally ready https://github.com/cagnulein/qdomyos-zwift/actions/runs/11819648403/artifacts/2182850712 Do what I said in my previous comment Let me know |
@cagnulein I will test in a few hours because I have my daughter here...How I will install it? What I must do? Is it better to format the sd card and start over install X64 raspberry OS and then what u will tell me to do? sudo apt install git libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 qt5-assistant libqt5networkauth5-dev libqt5websockets5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5multimedia5-plugins libqt5multimedia5 qtlocation5-dev qtquickcontrols2-5-dev libqt5texttospeech5-dev libqt5texttospeech5 g++ make git clone https://github.com/cagnulein/qdomyos-zwift.git cd qdomyos-zwift git submodule update --init src/smtpclient/ git submodule update --init src/qmdnsengine/ git submodule update --init tst/googletest/ cd src qmake qdomyos-zwift.pro make |
@melidron Download it And replace it on the qdomyos-zwift folder where you already run yesterday Let me know |
@cagnulein I have formated the sdcard and will do everything from start to avoid more mistakes |
Why? You have everything up and running! OK anyway
Roberto Viola
Software engineer and open source enthusiast
http://robertoviola.cloud
Il giorno mer 13 nov 2024 alle 18:45 melidron ***@***.***> ha
scritto:
… @cagnulein <https://github.com/cagnulein> I have formated the sdcard and
will do everything from start to avoid more mistakes
—
Reply to this email directly, view it on GitHub
<#525 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALYWAET6BMTRGNW6RBDYT2AOF4JAVCNFSM6AAAAABRQHH6VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZUGMZDEMRWGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@cagnulein I thought I had installed something wrong... I wanted to be sure...tomorrow I will have it install if I got it right...thank you for all the trouble I made u go for me since morning |
@cagnulein what exactly did u had to change from your project to |
Nothing, I just created an automation to give you a pre build binary so you don't have to do by yourself :) |
@cagnulein still dont understand it but I trust you like anything :) |
@cagnulein because <i dont understand what I need to replace to make your binary get installed, ca you guide me a little on that too? sudo apt install git libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 qt5-assistant libqt5networkauth5-dev libqt5websockets5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5multimedia5-plugins libqt5multimedia5 qtlocation5-dev qtquickcontrols2-5-dev libqt5texttospeech5-dev libqt5texttospeech5 g++ make Do I must do the same again now or I must to change something now for your binary you gave me? |
Do the same but this time don't run the make command, you don't need it.
Just put the file that I sent you, unzip and run it :)
Roberto Viola
Software engineer and open source enthusiast
http://robertoviola.cloud
Il giorno mer 13 nov 2024 alle 22:11 melidron ***@***.***> ha
scritto:
… @cagnulein <https://github.com/cagnulein> because <i dont understand what
I need to replace to make your binary get installed, ca you guide me a
little on that too?
Yestarday I was copy and pasted the following part of code on the terminal
and waited about 45 minutes to get installed...
sudo apt install git libqt5bluetooth5 libqt5widgets5 libqt5positioning5
libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev
libqt5charts5 qt5-assistant libqt5networkauth5-dev libqt5websockets5-dev
qtmultimedia5-dev libqt5multimediawidgets5 libqt5multimedia5-plugins
libqt5multimedia5 qtlocation5-dev qtquickcontrols2-5-dev
libqt5texttospeech5-dev libqt5texttospeech5 g++ make
git clone https://github.com/cagnulein/qdomyos-zwift.git
cd qdomyos-zwift
git submodule update --init src/smtpclient/
git submodule update --init src/qmdnsengine/
git submodule update --init tst/googletest/
cd src
qmake qdomyos-zwift.pro
make
Do I must do the same again now or I must to change something now for your
binary you gave me?
or after installation I must change something?
—
Reply to this email directly, view it on GitHub
<#525 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALYWAKJSNBZW6XRC6HCRT2AO57HAVCNFSM6AAAAABRQHH6VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZUG44TGMJZG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@cagnulein so I will paste the upper code without the last "make" command right? |
Yes
Roberto Viola
Software engineer and open source enthusiast
http://robertoviola.cloud
Il giorno mer 13 nov 2024 alle 22:15 melidron ***@***.***> ha
scritto:
… @cagnulein <https://github.com/cagnulein> so I will paste the upper code
without the last "make" command right?
—
Reply to this email directly, view it on GitHub
<#525 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALYWG56UB5ECKAXK56FE32AO6OZAVCNFSM6AAAAABRQHH6VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZUG44TSMZYGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@cagnulein what I dont understand is that... if the upper code is about to install qdomyos-zwift , why I must install it manually again from the binary you ve send me? And what are the steps to install it what the 45 minutes of the upper code finnish the installation? |
@cagnulein the installation finished very fast and say in the end " Cannot find file qdomyos-zwift.pro " Now what? |
@cagnulein I was pasted the upper code without the last 2 lines... iris@raspberrypi: ∼/qdomyos-zwift/src $ now what? |
@hb9odk can you please help me how to connect raspberry pi 4 pins with 8ch relay pins and the my motor control pins (I dont have a working console control board)? what about the voltage pins the ground and the jumbers the relay has on it? Do I need any voltage shifters to connect motor control Hall sensor (5v) with gpio of rpi4 (3,3V)? |
I have a simple treadmill that is not smart.
However, the buttons to increase the speed and incline are very easily accessible so that you could simulate them with a raspi.
I think you could do it this way:
After switching on the treadmill, the speed and incline are set to 0.
Each press of a button increases the speed by 0,1 km/h.
Therefore you could control the treadmill with a Raspi. It only has to remember how many times it has pressed the "button".
Regardless, I would then take the power from my Stryd and the HR from my chest strap. But I can also link that directly to Zwift.
Where do I start best and are there already approaches?
Feel free to close this issue or rename it.
The text was updated successfully, but these errors were encountered: