qpit / thorlabs_apt

python module for Thorlabs' APT library
GNU General Public License v2.0
80 stars 47 forks source link

Python can't detect Kinesis K-Cube KDC101, but usb.core() can #36

Open jakestephen1 opened 3 years ago

jakestephen1 commented 3 years ago

I'm trying to control a KDC101. I am able to control the KDC101 using Thorlabs' Kinesis software, and if I use usb.core.find() I can find the device, and even get the serial number. However, apt.list_available_devices() only gives an empty array, indicating that it does not detect the KDC101.

My code is as follows:

import usb
import thorlabs_apt as apt

PID = 0xFAF0
VID = 0x0403

dev = usb.core.find(idProduct = PID,idVendor = VID)
if not dev:
    print("Device not found.")

else:
    print("Device found.")

serial_number =  usb.util.get_string( dev, dev.iSerialNumber )
print(serial_number)

serial_junk = apt.list_available_devices()
print(serial_junk)

The output is:

Device found. 27258145 []

I have no idea how to fix this. I have tried installing libusb and pyusb and I've created drivers for libusb using Zadig 2.5.

rotanaht commented 2 years ago

hi, I found the issue, you have to copy all the dll from APT server into the apt python folder (and not just APT.dll)