Error message when run the odrivetool

When I ran the odrivetool, it comes error message like this:

Could not init terminal colors
Traceback (most recent call last):
File “C:/Python/Scripts/odrivetool”, line 81, in
logger = Logger(verbose=args.verbose)
File “C:\python\lib\site-packages\odrive\utils.py”, line 238, in init
self._stdout_buf = win32console.GetStdHandle(win32console.STD_OUTPUT_HANDLE)
NameError: name ‘win32console’ is not defined

I ran this under standalone python 3

Am I the only one had this message when running odrivetool?

Try pip install pywin32.
Thanks for reporting, I’ll add the missing dependency to the python package. Note though that the current version of odrivetool is still a prerelease version.

After install pywin32 the odrivetool works. Thanks for your kindly help.

1 Like

While I try to place some command in odrivetool, It came out AttributeError, does that mean I put something wrong in my command?
I just copy and paste the command from DOC (http://docs.odriverobotics.com/#configure-m0)

The Message…

In [6]: odrv0.axis0.motor.config.current_lim = 10

AttributeError Traceback (most recent call last)
C:\python\lib\site-packages\odrive\shell.py in ()
----> 1 odrv0.axis0.motor.config.current_lim = 10

C:\python\lib\site-packages\odrive\remote_object.py in getattribute(self, name)
172 return attr
173 else:
–> 174 return object.getattribute(self, name)
175 #raise AttributeError(“Attribute {} not found”.format(name))
176

AttributeError: ‘RemoteObject’ object has no attribute ‘motor’

Which version of the firmware are you running? Older versions object tree looks different. Try using tab complete to see the layout of the object tree.

I just git clone from github few days ago, so I guest it’s version 3.6

In [10]: odrv0
Out[10]: [‘channel’, ‘class’, ‘delattr’, ‘dict’, ‘dir’, ‘doc’, ‘eq’, ‘format’, ‘ge’, ‘getattribute’, ‘gt’, ‘hash’, ‘init’, ‘init_subclass’, ‘le’, ‘lt’, ‘module’, ‘ne’, ‘new’, ‘parent’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘sealed’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘weakref’, ‘_remote_attributes’, ‘_tear_down’, ‘axis0’, ‘axis1’, ‘config’, ‘enter_dfu_mode’, ‘erase_configuration’, ‘motor0’, ‘motor1’, ‘reboot’, ‘run_anticogging_calibration’, ‘save_configuration’, ‘serial_number’, ‘vbus_voltage’]

Yes, so the layout for the thing you want is in this case: odrv0.motor0.current_lim. This is the old layout structure, before v0.4.0

In [14]: odrv0.motor0.current_lim = 10

AttributeError Traceback (most recent call last)
C:\python\lib\site-packages\odrive\shell.py in ()
----> 1 odrv0.motor0.current_lim = 10

C:\python\lib\site-packages\odrive\remote_object.py in setattr(self, name, value)
185 object.getattribute(self, “dict”)[name] = value
186 else:
–> 187 raise AttributeError(“Attribute {} not found”.format(name))
188
189 def _tear_down(self):

AttributeError: Attribute current_lim not found

still error

Apologies, it should be at odrv0.motor0.current_control.config.current_lim. You can check how the tree is built here. You can also check with tab complete, or like you did by dumping the container only.

Thanks, I will keep trying :slight_smile:

Hi, I’m trying to install odrivetool in standalone mode, in theory I installed it, but when I try to run it, it doesn’t recognize the command …