On Thu, Apr 22, 2021 at 01:38:58PM +0300, Арам Абовян wrote:
> ---------- Forwarded message ---------
> От: Aram Abovyan <abovyan.ae...@yandex.ru>
> Date: чт, 22 апр. 2021 г., 13:37
> Subject:
> To: abovanara...@gmail.com <abovanara...@gmail.com>
> 
> 
> I am very new to PyUSB and any help from PyUSB experts will be highly
> appreciated. .
> 
> When I applied the following few lines in IDLE Python GUI,
> ---------------------------------------------------------------
> 
> import os
> os.environ['PYUSB_DEBUG'] = 'debug'import usb.core
> usb.core.find()
> 
> ----------------------------------------------------------------
> 
> I have got the following response :
> 
> =======================  =======================
> 
> 
> 
> 2021-04-22 10:29:59,680 DEBUG:usb.backend.libusb1:_LibUSB.__init__(<WinDLL 
> 'C:\Windows\system32\libusb-1.0.dll', handle 6b600000 at 0x3dc53fd250>)
> 2021-04-22 10:29:59,688 INFO:usb.core:find(): using backend 
> "usb.backend.libusb1"
> 2021-04-22 10:29:59,688 DEBUG:usb.backend.libusb1:_LibUSB.enumerate_devices()
> 2021-04-22 10:30:02,122 
> DEBUG:usb.backend.libusb1:_LibUSB.get_device_descriptor(<usb.backend.libusb1._Device
>  object at 0x0000003DC73C5DC0>)
> 2021-04-22 10:30:02,123 DEBUG:usb.backend.libusb1:_LibUSB._finalize_object()
> 
> 
> 
> I have googled that, but did not understand much from the serach-
> results.

There is absolutely nothing wrong here.

You enabled PYUSB_DEBUG, and called usb.core.find().

The default is for find() to find (at most) a single USB device, which,
according to the debug output, it did (even though it appears that you
omitted the IDLE output that looks something like `<DEVICE ID ffff:ffff
on Bus 001 Address 001>`).

Maybe you wanted to store the device returned by find() somewhere?

Also, generally speaking, you either want to find one of a specific device
    usb.core.find(idVendor=<...>, idProduct=<...>)
or all devices (optionally also filtering by idVendor and/or idProduct)
    usb.core.find(find_all=True)
    usb.core.find(find_all=True, idVendor=<...>)
    usb.core.find(find_all=True, idVendor=<...>, idProduct=<...>)
but rarely do you need a single randomly picked device.

My suggestion is for you to (continue to) follow the PyUSB tutorial:
    https://github.com/pyusb/pyusb/blob/master/docs/tutorial.rst

Thanks,
Jonas

> 
> 
> What am I missing out?


> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users



_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to