ASCii over USB is not working...or idk what I am doing

So I am building out a python program to control a microcontroller and the odrive board. Now it might be easier to just use an arduino and use the library idk (then I have to set up uart channels on the arduino). Currently running a test script:
import serial
odrive = serial.Serial(port=‘COM3’,baudrate=115200)
odrive.write(b"t 0 -2")
or
import serial
odrive = serial.Serial(port=‘COM3’,baudrate=115200)
odrive.write(b"r vbus_voltage *93")
does absolutly nothing. everything works fine using the odrive tool though.
there is next to no documentation on doing this aside from ASCII Protocol | ODrive but that isnt getting me anywhere. I am on a real time crunch here and this is not a good issue to run into haha.
notes:

  • odrv0.config.enable_ascii_protocol_on_usb = true
  • the com port is correct
  • ODrive control utility v0.5.1.post0
  • 24V Odrive V3.6

It’s been a while since I wrote the code but I use:

import odrive
from odrive.enums import *
odrv0 = odrive.find_any(serial_number = “NUMBER”)

Ok so I ended up going over to the Native protocol (would have been smart to start there but we live and learn). I did find that I could establish comms through arduino IDE serial monitor so it likely was an issue with my script or not having a path/library correct.

2 Likes