ODrive UART issues with Python files

Hi Everyone,

I’m currently trying to use UART to communicate from a Raspberry Pi B3+ to a 24V Odrive, but am getting an error (shown below), when I run this simply python script:

Error:

[FIBRE] transport layer "serial" not implemented

Code:

import odrive
import serial

def main():
    print("Connection to Odrive...")
    o = odrive.find_any("serial:/dev/ttyAMA0")
    ...

I understand that odrivetool had their UART implementation removed, but I was wondering if it was removed for running regular python script in the native protocol.

Additional Notes:

  1. I double checked that the connections from the Raspberry Pi B3+ to the Odrive were correct:
  • Gnd <-> Gnd
  • Tx of Odrive (GPIO1) <-> Rx of Raspberry Pi (Pin 10)
  • Rx of Odrive (GPIO2) <-> Tx of Raspberry Pi (Pin 8)
  1. This is how I configured the ODrive via USB before removing the connection for UART:
odrv0.config.enable_uart_a = True 
odrv0.config.gpio1_mode = GPIO_MODE_UART_A
odrv0.config.gpio2_mode = GPIO_MODE_UART_A 
odrv0.config.uart0_protocol = STREAM_PROTOCOL_TYPE_FIBRE
odrv0.reboot()
  1. I ensured that the UART wiring was enabled on the Raspberry Pi B3+ before attempting to use UART on the Odrive

I understand that odrivetool isnt set up to use UART currently, but does this affect regular python scripts too? (Odrivetool with UART does not seem to work - githubhot)

I was wondering if anybody had any other reccomendations on things we could try to get this to work?

1 Like

Yeah sorry this affects regular Python scripts too. odrivetool is only a thin shell/wrapper around the Python module itself.

If you need native UART, you can revert to version 0.5.1. It still works there.

1 Like

Will I need to flash version 0.5.1 on the actual odrive firmware?

You need to flash the official odrive firmware 0.5.1 to your ODrive. There is documentation out there on how to do that.