title: LIBUSB_ERROR_BUSY [-6] Sending a basic packet with Python 3.9 using LibUSB1
body: <p>I am developing some software in python 3.9 and I am at the point where I have a device connected to my USB port and would like to send a basic packet to test the interface before I proceed. I am using this example to try and get my interface to work. I am not bothered about speed or byte count. I would like to see any response on the interface (But on reflection Im wondering if usb speed could be the issue):</p>
  
  <pre><code>    import usb1
      import usb.util
      import os
      import sys
      import libusb
      import usb.core
      from usb import util
      import math
  
      dev = usb.core.find(idVendor=0x11ac,idProduct=0x317d)
  
      with usb1.USBContext() as context:
          handle=context.openByVendorIDAndProductID(
              0x11ac,
              0x317d,)
          handle.claimInterface(0)
          handle.setInterface(0)
  
     data = bytearray(b"\\xf0\\x0f"* (int(math.ceil(0xb5db91/4.0))))
     handle.controlWrite(0x40, 0xb0, 0xb5A6, 0xdb91, b"")
     handle.bulkWrite(2,data,timeout=5000)
  </code></pre>
  
  <p>`</p>
  
  <p><a href="https://github.com/vpelletier/python-libusb1/issues/21" rel="nofollow noreferrer">https://github.com/vpelletier/python-libusb1/issues/21</a></p>
  
  <p>I have had a look in various forums  for several days and cannot seem to get an answer that works. Here is the trace: Its worth noting that from time to time, this py file does run without error but does nothing, and I see no traffic traveling to the USB interface. </p>
  
  <p>Can someone please help me configure a working example of how to send a packet to the interface? I have tried various things like detaching the kernel, setting configuration, etc.</p>
  
  <p>For 4 days I have struggled with libusb01 &amp; 10, after discovering libusb1, I have changed my wrapper and got a lot more success</p>
  
  <p>I also see a lot of examples in forums like this one, and I always get the same response. Also Im curious as to where it appears that 0x40 is the endpoint(out)</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/jbgilbert/Desktop/Packets/Backend_replace.py", line 16, in &lt;module&gt;
      handle.claimInterface(0)
    File "/usr/lib/python3/dist-packages/usb1/__init__.py", line 1213, in claimInterface
      libusb1.libusb_claim_interface(self.__handle, interface),
    File "/usr/lib/python3/dist-packages/usb1/__init__.py", line 133, in mayRaiseUSBError
      __raiseUSBError(value)
    File "/usr/lib/python3/dist-packages/usb1/__init__.py", line 125, in raiseUSBError
      raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
  usb1.USBErrorBusy: LIBUSB_ERROR_BUSY [-6]
  </code></pre>