Python errors when starting odrivetool, slow to connect

Hi all

I am getting the following errors when i start odrivetool in Windows 10

ODrive control utility v0.4.11
c:\users\unknown\appdata\local\programs\python\python38-32\lib\site-packages\fibre\shell.py:104: RuntimeWarning: coroutine ‘InteractiveShell.run_code’ was never awaited
console.runcode(‘import sys’)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
c:\users\unknown\appdata\local\programs\python\python38-32\lib\site-packages\fibre\shell.py:105: RuntimeWarning: coroutine ‘InteractiveShell.run_code’ was never awaited
console.runcode(‘superexcepthook = sys.excepthook’)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
c:\users\unknown\appdata\local\programs\python\python38-32\lib\site-packages\fibre\shell.py:106: RuntimeWarning: coroutine ‘InteractiveShell.run_code’ was never awaited
console.runcode(‘def newexcepthook(ex_class,ex,trace):\n’
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
c:\users\unknown\appdata\local\programs\python\python38-32\lib\site-packages\fibre\shell.py:109: RuntimeWarning: coroutine ‘InteractiveShell.run_code’ was never awaited
console.runcode(‘sys.excepthook=newexcepthook’)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Please connect your ODrive.
You can also type help() or quit().

Odrive will connect but it takes close to 1 minute and i haven’t managed to make my motor running. So i am posting this as i don’t know if this effects its functionality.

Did anyone else had the same issues ? How do i fix the error messages?

Same here.
Not sure, but at the end of the Python installation, there was a message asking if I want to allow Python to execute more than 260 lines (or something like this) of code - it is some type of win10 security feature. Could this have something to do with these warnings at odrivetool startup?
And also, as the Phyton is 32-bit installation, should it be manualy placed into Programs(x86) or it doesn’t matter, because the default installation path is in C:\Users…?

OK, have reinstalled python with admin rights. Allowed it to execute more than 260 symbols at the end of the installation and I made the installation for “all users”, which automatically placed python in Programs(x86) ( now I get it :smiley: ). Reinstalled again the odrivetool with “pip install odrive” through an elevated prompt, but it seems the source package is still there, because the installation was very brief. Started the odrivetool again through an elevated cmd prompt and again it showed the same errors. Actually the Odrive connects to the PC, but while I’m trying to follow the calibration procedures it gives another errors and I’m not sure if they don’t mess with the whole procedure?
If someone knows, what is causing those errors at start-up, would be very helpful, as I think, that they might be related to the other errors I get after the Odrive is connected.

Any luck solving this? I just connected my ODrive for the first time and got these errors. It doesn’t take very long to connect though.

No sorry, i am still having the same issues. Some suggestions posted in the forum doesn’t seem to work.

1 Like

What version of Python are you running? The docs reference Python 3.6 in the Getting Started section. I wonder if this has anything to do with that.

I can get my motor to spin and hold position just fine. So at least I’ve got that going. I’ll keep digging and let you know if I find anything.

I am on version 3.8 but had the same issues with 3.7. I don’t think i tried 3.6.

Odrive will hold position and spin the motor but i haven’t tried anything beyond that as i am using a custom wind motor and still trying to figure out how to tune settings.

My main issues so far is that connection takes too long

1 Like

Hey, I was also getting these errors with odrivetool. From my experience they don’t seem to have an effect on the actual usage of the tool or the time it takes for things to connect, but I did manage to fix them.

I added asyncio and used that to wrap things. I’m not sure if that’s the best way to fix this but it seems to work fine for me. That said, ODrive connection still takes between 15 seconds and a minute for me.

Here is my modified shell.py file: https://gist.github.com/kedvall/757ccbe7ad93e987774de8e255a40afa.
It goes in odrive_repo/Firmware/fibre/python/fibre/shell.py. The only things added were the asyncio wrapping.

Hope this helps!

Do you mind sending us a PR for that one?

Sure, no problem!

asyncio got an update in Python 3.8 but this should still work fine for Python >= 3.7. Just a heads up.