SOLVED: Issue connecting Odrive to RPi over USB

I’m trying to connect to a 24V Odrive V3.6 using a Raspberry Pi 3 B+ running Raspbian GNU/Linux 9 (stretch) over USB using odrivetool. I’ve followed all of the instructions for Linux on the getting started page (including adding odrive to the path), and I’ve also been able to successfully connect to the same odrive over USB from a Windows computer.

When I run odrivetool, I get the following warning messages and then the tool just never connects to the odrive no matter how long I wait:

~/ $ odrivetool
ODrive control utility v0.4.9
/home/pi/.local/lib/python3.5/site-packages/fibre/shell.py:104: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('import sys')
/home/pi/.local/lib/python3.5/site-packages/fibre/shell.py:105: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('superexcepthook = sys.excepthook')
/home/pi/.local/lib/python3.5/site-packages/fibre/shell.py:106: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('def newexcepthook(ex_class,ex,trace):\n'
/home/pi/.local/lib/python3.5/site-packages/fibre/shell.py:109: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('sys.excepthook=newexcepthook')
Please connect your ODrive.
You can also type help() or quit().

Does anyone have any suggestions or know how to fix this issue? Thanks!

as for the warnings, can you try /home/pi/.local/lib/python3.5 -m pip install ipython?
when you use lsusb command is ODrive in the list?

1 Like

I’ve installed ipython and restarted but am still getting the same warnings.

lsusb returns the following:

Bus 001 Device 006: ID 1209:0d32 InterBiometrics
Bus 001 Device 004: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I suspect that the reason it’s having trouble connecting may be due to the fact that the Pi has two pairs of stacked USB hubs rather than single USBs. I tried running sudo udevadm monitor -u and then unplugging and replugging the odrive in an effort to figure out which USB port I’m using, but I’m not quite sure what to do with this information for running odrivetool.

UDEV  [1048.344289] remove   /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0/tty/ttyACM0 (tty)
UDEV  [1048.346674] remove   /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.1 (usb)
UDEV  [1048.353401] remove   /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.2 (usb)
UDEV  [1048.353754] remove   /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0 (usb)
UDEV  [1048.357924] remove   /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2 (usb)
UDEV  [1055.982990] add      /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2 (usb)
UDEV  [1055.994979] add      /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0 (usb)
UDEV  [1055.997751] add      /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.1 (usb)
UDEV  [1055.998321] add      /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.2 (usb)
UDEV  [1056.007402] add      /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0/tty/ttyACM0 (tty)

I also ran odrivetool in verbose mode and confirmed that it is indeed getting stuck in the USB discover loop.

I tried running odrive tool using --verbose instead of just -v and noticed that it was saying that USB access was denied. As a result, I ran sudo odrivetool instead and it successfully connected! I’ll need to figure out how to set up my udev rules correctly so that it’ll work without sudo-ing, but otherwise it’s all working now. Thanks for the help!

I also faced the same problem.
My environment is Ubuntu 18.04.

The same error occurs when executing sudo odrivetool.

I have the same problem as you. But I failed when I ran sudo odrivetool.
image
Any advice?

Are you receiving the same warnings, or the “USB” device access denied" error, or just not ever connecting? Any more info you have would be really helpful for diagnosing the issue.

Hmm, that’s really odd. It looks like it’s not even finding the odrivetool command at all when you’re using sudo. Did you try adding odrivetool to your path? (https://docs.odriverobotics.com/#downloading-and-installing-tools, Linux instruction #3)

you shouldn’t need sudo to access an usb device if you have the rules set up properly. check that there is “xx-odrive.rules” in /etc/udev/rules.d with vendor id, product id and MODE="0666".

1 Like

I reinstalled Odrive. Now it works using sudo. But I didn’t manually add odrivetool to my path.

I got it.
First,


idVendor is 1209 and idProduct is 0d32.
So, I rewrite my udev rules.
sudo gedit /etc/udev/rules.d/xxx.rules #“xxx.rules” is your rules file
Enter in the file:
SUBSYSTEMS==“usb”, ATTRS{idVendor}==“1209”, ATTRS{idProduct}==“0d32”, GROUP=“pi”, MODE=“0666”
#‘pi’ is my username
sudo reboot
sudo udevadm control --reload
Then, you can access the usb device without sudo.

2 Likes

In my case there was a warning but I could connect to Odrive.

I need to wait 2 ~ 3 [s] for successful connection.

Hi all,

I ran into the same issue but on Windows (with the RuntimeWarning). My computer does connect to the odrive after the warnings, but then loses the connection almost immediately (‘oh no odrive disappeared’). I’m not sure if the two issues are related. Is this likely a USB problem? I tried connecting it to different ports on my computer but had the same problem. I’ll try using a different cable, but besides that I’m at a loss.

Maybe reinstall odrivetool will help.

Just an FYI for anyone finding this… Something is injecting smart-quotes in the udev rule file line above, so you’ll need to replace them with regular quotes for udev to work. grr.

1 Like

Hi, did anyone solve this problem for windows? Any help much appreciated!

I had this problem as well.
In Zadig I set interface 0 to ‘libusb-win32’ instead of interface 2.

When setting interface 0 back to ‘WinUSB’ and interface 2 to ‘libusb-win32’ it worked for me.

1 Like

Hello,
I am having the same issues with connecting odrive to my computer. I’ve updated Interface 2 driver to libusb-win32 using Zadig. I’ve tried using different USB cables. My odrive is also powered from 24v source.
I have python3.6 and odrive is installed ( I know this because in the python shell, if I type import odrive, it doesn’t throw off an error, and also when I try to install odrive, I’m told that the requirement is already satisfied)
I am able to run odrivetool in my Windows Command Prompt (running in Administrator mode), but my odrive is not being detected. It throws off a bunch of errors similar to the ones OP got.

C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts>odrivetool
ODrive control utility v0.4.11
c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\fibre\shell.py:104: RuntimeWarning: coroutine ‘InteractiveShell.run_code’ was never awaited
console.runcode(‘import sys’)
c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\fibre\shell.py:105: RuntimeWarning: coroutine ‘InteractiveShell.run_code’ was never awaited
console.runcode(‘superexcepthook = sys.excepthook’)
c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\fibre\shell.py:106: RuntimeWarning: coroutine ‘InteractiveShell.run_code’ was never awaited
console.runcode(‘def newexcepthook(ex_class,ex,trace):\n’
c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\fibre\shell.py:109: RuntimeWarning: coroutine ‘InteractiveShell.run_code’ was never awaited
console.runcode(‘sys.excepthook=newexcepthook’)
Please connect your ODrive.
You can also type help() or quit().

I exactly get the same message on Ubuntu 18.04. What is the solution?

What worked for me was calling odrv0.vbus_voltage every five seconds after running sudo odrivetool and between the 3rd and 10th call, the ODrive will connect.

Kubuntu 18.04 - Kernel 5.3.0-28-generic