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

Crash on float value in Cadence and Power when using test mode (-s) on Raspberry Pi Zero W #361

Closed
edwinvanpoeijer opened this issue Jan 12, 2022 · 5 comments
Labels
bug Something isn't working solved

Comments

@edwinvanpoeijer
Copy link

When starting FortiusANT in testmode and bluetooth + display enables it crashed with the following error:

17:35:24,136: Tacx - Simulated Tacx Trainer to test ANT-interface
17:35:24,787: Target=100W 34.0km/h hr= 95 Current= 12W Cad= 97 r=2345 100% -----
Traceback (most recent call last):
File "/home/pi/FortiusANT/raspberry/../pythoncode/FortiusAnt.py", line 716, in
mainProgram()
File "/home/pi/FortiusANT/raspberry/../pythoncode/FortiusAnt.py", line 661, in mainProgram
Console.Autostart()
File "/home/pi/FortiusANT/raspberry/../pythoncode/FortiusAnt.py", line 218, in Autostart
Tacx2Dongle(self)
File "/home/pi/FortiusANT/raspberry/../pythoncode/FortiusAnt.py", line 161, in Tacx2Dongle
rtn = FortiusAntBody.Tacx2Dongle(self)
File "/home/pi/FortiusANT/pythoncode/FortiusAntBody.py", line 653, in Tacx2Dongle
rtn = Tacx2DongleSub(FortiusAntGui, Restart)
File "/home/pi/FortiusANT/pythoncode/FortiusAntBody.py", line 1107, in Tacx2DongleSub
o.SetValues(TacxTrainer.VirtualSpeedKmh,
File "/home/pi/FortiusANT/pythoncode/raspberry.py", line 843, in _SetValuesSt7789
[ 'Power' , "{:d}Watt".format(iPower) ],\

I have changed to code on lines 843 to the following, casting the float to int:

                                [ 'Cadence', "{:d}/min".format(int(iRevs))  ],\
                                [ 'Power'  , "{:d}Watt".format(int(iPower)) ],\

Now the testmode is working and sending data to Zwift using bluetooth.

@WouterJD
Copy link
Owner

@edwinvanpoeijer thanks for the investigation.

The problem is in usbTrainer.py (CurrentPower is not integer) and of course it can be corrected as you did; I submitted a change (in master, usbTrainer.py) to solve at the place where the problem was created.

Could you please verify, doing the simulation (of course without your solution).
Thanks for cooperation.

@WouterJD WouterJD added bug Something isn't working solved under investigation Being studied for implementation in next version labels Jan 13, 2022
@edwinvanpoeijer
Copy link
Author

Hi,

You will also need to do the same on the Cadence value, after that it's working.

WouterJD added a commit that referenced this issue Jan 14, 2022
@WouterJD
Copy link
Owner

Done, please verify

@edwinvanpoeijer
Copy link
Author

Thanks, working perfectly now!

@WouterJD
Copy link
Owner

Great thanks for feedback

@WouterJD WouterJD removed the under investigation Being studied for implementation in next version label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working solved
Projects
None yet
Development

No branches or pull requests

2 participants