Join GitHub today
[Windows] usb.core.USBError: [Errno None] libusb0-dll:err [claim_interface] could not claim interface 1, invalid configuration 0 #46
I was working on a test for a device (LadyBug LB5918A Power Sensor) and decided to use python source code that a peer had already written to communicate with it. The code was only tested in a linux environment and being the masochist I am I decided to see if I could at least just identify the device on windows. After using pip to install pyusb & usbtmc, creating an inf filter with libusb-win32, I ran a brief test script to see if I could just query the device ("*IDN?"). Here's the section of the init from the API were the code fails.
The error message I get in return is as follows
After a lot of googling, I couldn’t seem to find any conclusive reason why this shouldn’t work on windows seeing that I had followed all the steps correctly for both PyUSB and USBTMC setup. I tried just the PyUSB module to identify the device which I was able to do and I then tried to write to the device commands which I know I was most likely doing wrong. I did notice that for most of the examples of PyUSB, the
So I then decided to go through the USBTMC api to see where the issue may be occurring. I believe that the culprit is here in the
After stepping through the code manually, the issue is where
I’m not sure if this is intended but I believe that this is how it should be in the code. I hope this helps!