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

Syntax Error when trying to start vpower #16

Open
mhanbury opened this issue Mar 9, 2021 · 7 comments
Open

Syntax Error when trying to start vpower #16

mhanbury opened this issue Mar 9, 2021 · 7 comments

Comments

@mhanbury
Copy link

mhanbury commented Mar 9, 2021

Many thanks for pulling this together. Unfortunately I'm getting an error when trying to start on my PI.

pi@raspberrypi:/boot/vpower $ sudo python vpower.py ../vpower.cfg
Traceback (most recent call last):
File "vpower.py", line 10, in
from PowerMeterTx import PowerMeterTx
File "/boot/vpower/PowerMeterTx.py", line 66
print(f'Power: {int(power)} W \r', end="")
^
SyntaxError: invalid syntax
pi@raspberrypi:/boot/vpower $

All files currently set to default values.

@oldnapalm
Copy link
Contributor

Try sudo python3 vpower.py ../vpower.cfg

@dhague
Copy link
Owner

dhague commented Mar 9, 2021

@oldnapalm you beat me to it by a few seconds :-)

@oldnapalm
Copy link
Contributor

@dhague there was another post about this here #12 (comment)

I don't have a Pi to confirm, but I suppose the commands (python and pip) should be updated in the README.

Also, the prints in https://bitbucket.org/MattHawkinsUK/rpispy-misc/raw/master/python/bme280.py need to be updated.

@mhanbury
Copy link
Author

mhanbury commented Mar 9, 2021

Thanks for that getting a little further now..

I had run the requirements to build ant
pi@raspberrypi:/boot/vpower $ sudo pip install -r requirements.txt
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://github.com/mch/python-ant.git (from -r requirements.txt (line 1))
Cloning https://github.com/mch/python-ant.git to /tmp/pip-req-build-R3evt3
Requirement already satisfied (use --upgrade to upgrade): ant==0.1.1 from git+https://github.com/mch/python-ant.git in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied: msgpack-python in /usr/local/lib/python2.7/dist-packages (from ant==0.1.1->-r requirements.txt (line 1)) (0.5.6)
Requirement already satisfied: pyserial in /usr/lib/python2.7/dist-packages (from ant==0.1.1->-r requirements.txt (line 1)) (3.4)
Requirement already satisfied: pyusb>=1.0.0b2 in /usr/local/lib/python2.7/dist-packages (from ant==0.1.1->-r requirements.txt (line 1)) (1.1.1)
Requirement already satisfied: six>=1.7.0 in /usr/lib/python2.7/dist-packages (from ant==0.1.1->-r requirements.txt (line 1)) (1.12.0)
Building wheels for collected packages: ant
Running setup.py bdist_wheel for ant ... done
Stored in directory: /tmp/pip-ephem-wheel-cache-7bOdUG/wheels/21/f5/ec/5b238f9b1e1002a526575734521172cc0e9feefd87d6d0303f
Successfully built ant

However when I run sudo python3 vpower.py ../vpower.cfg I unfortunately see another error

pi@raspberrypi:/boot/vpower $ sudo python3 vpower.py ../vpower.cfg
Traceback (most recent call last):
File "vpower.py", line 5, in
from ant.core import driver
ModuleNotFoundError: No module named 'ant'
pi@raspberrypi:/boot/vpower $

@dhague
Copy link
Owner

dhague commented Mar 9, 2021

Apologies, the documentation needs updating to use Python 3. In this case, pip install ... becomes pip3 install ...

@mhanbury
Copy link
Author

mhanbury commented Mar 9, 2021

Thanks for the reply Duh Silly me I should have guessed that. Sorry to bother you again... Looks better now :-)

Are the speed values entered in kmh, mph or ms? I'm going to propose a formula for the trainer I use the Elite chrono fluid using a poly nominal formula as you've done for the kurt kinetic but for now I've just updated the curves file with values for my trainer.

@oldnapalm
Copy link
Contributor

If you mean in curve.csv, speed is in km/h. If you mean in the polynomial, you can use what you want, power_from_speed takes revolutions per second (just notice that default wheel_circumference is in millimeters).

https://github.com/dhague/vpower/blob/master/KurtKineticPowerCalculator.py#L22

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

No branches or pull requests

3 participants