Port already used error with autodetect_robot

I have 2 AX-12+ (id [1,2] and baudrate=1000000) plugged on a USB2AX and I run python under a virtual machine with Ubuntu (because the USB2AX behavior is not very clear on Mac).

I never played with the auto robot but when I do:

from pypot.dynamixel import autodetect_robot

my_robot = autodetect_robot()

I get:

/usr/local/lib/python2.7/dist-packages/pypot/dynamixel/io/abstract_io.pyc in _open(self, port, baudrate, timeout, max_recursion)
    115 
    116                 if port in self.__used_ports:
--> 117                     raise DxlError('port already used {}'.format(port))
    118 
    119                 # Dirty walkaround to fix a strange bug.

DxlError: port already used /dev/ttyACM0

I guess the “Dirty walkaround” comment means there is something not clear ?

PS:

import pypot.dynamixel
dxl = pypot.dynamixel.DxlIO('/dev/ttyACM0')
dxl.scan(range(10))
>> [1, 2]
1 Like

I don’t know about the code, but VM can screw things up - at least my tests with VMware a few years ago (Ubuntu virtualized on a Windows 7 host) resulted in very unstable results.

Did you open the io before launching the auto detect function? What’s your bus configuration? Multiple bus? Motors on each bus? V1 vs V2?

The strange bug is after the raised error so it’s not the issue there.

I can open the io before and after, there is only one bus with two AX motors (so v1).