On Fri, Nov 3, 2017 at 10:18 PM, Srujan Chaitanya wrote:
>
> Hardware is Dell Precision Tower 3000 Series.
>
>
> down votefavorite

Hello Srujan,

If you are cross-posting a question from StackOverflow, it would only
be polite to include a link to the original question.

>
> I'm trying to implement driver mechanism for usb barcode scanner on Centos.
>
> Using PyUSB,
>
> Here is high-level code. I am trying to achieve is to be able to read 
> QR-Codes and BarCodes when someone scans and send it to message queue without 
> user interaction.
>
> dev = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)
> if dev.is_kernel_driver_active(0) is True:
>     dev.detach_kernel_driver(0)
> dev.set_configuration()
> dev.reset()

Do you need the reset() here?

> data = dev.read(endpoint.bEndpointAddress, 120,
>                     timeout=10000)
> currentData = list(chunks(data))
>
> This code work fine on the same system with Ubuntu operating system. But on 
> Centos 7 , All I hear rapid beeps, and nothing read from the scanner.
>
> Here is everything installed on Centos, almost similar to Ubuntu that I ran 
> on the same machine.
>
> "libgusb.x86_64                         0.2.9-1.el7                     @base
> libgusb-devel.x86_64                   0.2.9-1.el7                     @base
> libusb.x86_64                          1:0.1.4-3.el7                   @base
> libusb-devel.x86_64                    1:0.1.4-3.el7                   @base

The most important difference is probably the version of libusb that
is in use. Upstream libusb.info is now at 1.0.21. Please be more
specific about which libusb versions you have on the two systems,
which versions of the OS, and try a newer version if possible.

Regards,
Tormod

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to