SolidGeek / VescUart

An Arduino library for interfacing with the VESC over UART
GNU General Public License v3.0
189 stars 90 forks source link

Support CAN as an interface #31

Closed Teslafly closed 2 years ago

Teslafly commented 3 years ago

On most of my vesc setups, the uart port is occupied by the nrf bluetooth module. It would be nice then for this library to work over CAN to free up the vesc uart port.

Looking at can libraries, this one seems to be reasonable. I am targeting the esp32 and possibly Teensy 3.2 https://github.com/sandeepmistry/arduino-CAN https://github.com/collin80/FlexCAN_Library https://github.com/pierremolinaro/acan https://github.com/pierremolinaro/acan-esp32

This could also help move forward https://github.com/SolidGeek/VescUart/issues/7 by giving the library understanding of the can interface.

I will be developing this at https://github.com/Teslafly/VescUart and have made this issue for discussion / to track my progress.

vicgwee commented 3 years ago

I am also working on CAN forwarding in a private repo! For STM32. But I think it should still be compatible.

Teslafly commented 3 years ago

Some previous work with vesc can libraries https://github.com/DangerousElectrician/vescSocketCAN https://github.com/e-overton/bldc-can https://github.com/OuyangJunyuan/VESC-Driver https://github.com/skipper762/teensy_VESC_CANBUS

SolidGeek commented 2 years ago

I don't think CAN as the main communication bus is suitable for this library (VescUart), and should be done in a new library (maybe VescCAN)?. I did however just merge a pull-request that implements COMM_FORWARD_CAN to send commands to slave VESCs. This could solve your issue if you got a dual setup.

Teslafly commented 2 years ago

I'll probably make my own library then. I still have a use for it and want a well upkept library. It's nice that this isn't dead though.

I see someone has something small working here. https://github.com/Mitchlol/balance_buddy/blob/main/esc.cpp

By the way, if you are interested in vesc development things. The vesc project now has a fairly active discord. https://github.com/vedderb/bldc/tree/master#contribute