LiamBindle / PyVESC

PyVESC is an easy to use and robust Python implementation of the VESC - Open Source ESC communication protocol
https://pyvesc.readthedocs.io/en/latest/
Creative Commons Attribution 4.0 International
72 stars 54 forks source link

can forward example and change of value? #22

Open ekptwtos opened 3 years ago

ekptwtos commented 3 years ago

Hello all and thanks for your work!

I have been trying to work out how the can forwarding is working but to no avail! Also, sniffing around the code trying to make the can forwarding work I have notices that in the base.py the _comm_forward_can is set to 33 whereas in the Vedder_BLDC_Commands.py this is 34.

For the testing, I have tried both of the above values and manually changing in base.py the cls.can_id = None to 1 - which is the id of the slave vesc and then just run a bare minimum script sending the rpm values.

In both cases, only the master led lights up and only the master motor is spinning. I can verify that when manually changing the cls.can_id to something other than None, it goes into the def pack(instance, header_only=None): if header_only: if instance.can_id is not None:

Shall I send the command from my script differently? Current way: ser.write(pyvesc.encode(SetRPM(7500))) as in the example.

Are there any examples on how to actually can forward the messages? Am i missing something?

Thank you very much for your time!

Best,

Mike

akshay-sharma1995 commented 3 years ago

Hi @ekptwtos , were you able to find a solution to this issue. I am facing the same issue, and have tried the things that you mentioned. Let me know if there is way to solve it. Thanks.