thankthemaker / rESCue

rESCue - add more safety and control to your VESC based vehicle
GNU General Public License v3.0
102 stars 25 forks source link

Connecting a ESP32 devkit v1 to Flipsky fsesc75100 #61

Open LankoG opened 1 year ago

LankoG commented 1 year ago

I am trying to connect esp32 with a flipsky vesc, but cannot get esp to work. I connected it only through UART because I do not have CAN bus transceiver.

thankthemaker commented 1 year ago

For UART to work you'll have to rebuild the firmware with CANBUS_ONLY commented out in config.h

Otherwise CANBUS is used.

LankoG commented 1 year ago

I already did that, also tried to change [platformio] default_envs = nodemcu-32s, but nothing worked. I am using vs code to upload the code with platformio, but don't think there is anything wrong there.

thankthemaker commented 1 year ago

Ok, did you check that UART is enabled in VESC tool? Do your VESC and ESP share a common ground? Using a common ground is important.

LankoG commented 1 year ago

yes when I used just the VescUart library it was able to print the data to the terminal

LankoG commented 1 year ago

I tried reinstalling the source code and now I get this error: image image

barsikus007 commented 7 months ago

@LankoG, you also need to disable CANBUS_ENABLED too

jwidess commented 1 week ago

Oh my god thank you for this thread! I've spent the last two days trying to figure out why UART wasn't working properly. The fact that CANBUS_ONLY is the default NEEDS to be mentioned somewhere!

NOTE: The "-D CANBUS_ENABLED -D CANBUS_ONLY" flags are located in the Environment Variables in "platformio.ini" not in config.h. To enable UART on my nodemcu32, on lines 141-152 of platformio.ini I removed the CANBUS flags so my config looks like the following.

[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino
monitor_speed = 115200
board_build.partitions = default.csv
lib_deps =
    ${common_env_data.lib_deps_external}
build_flags =
     ${ESP32.build_flags} -D LED_WS28xx
extra_scripts = pre:change_firmware_name.py
custom_firmware_name = firmware_nodemcu-32s

Errors I was having: rESCue App: Always in the Disconnected State VESC-Tool: "Could not read firmware version. Make sure that the selected port really belongs to the VESC"