From: Srujan C. <sri...@gm...> - 2017-11-07 01:19:20
|
Hi One thing does puzzles me is that. Same Centos same versions of libusb and python to the very last version number on VirtualBox hosted on Mac OS works fine. I posted on stack overflow to get border attention any how here is the link to the question.. https://stackoverflow.com/questions/47087054/pyusb-usb-scanner-read-fails-on-centos-7?noredirect=1#comment81161517_47087054 <https://stackoverflow.com/questions/47087054/pyusb-usb-scanner-read-fails-on-centos-7?noredirect=1#comment81161517_47087054> Centos 7 with lated kernel update CentOS Linux release 7.4.1708 >rpm -qa | grep -i libusb libusbx-1.0.20-1.el7.x86_64 libusbmuxd-1.0.10-5.el7.x86_64 > On Nov 4, 2017, at 2:53 AM, Tormod Volden <lis...@gm...> wrote: > > 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? Not really just attempting to try if that makes any difference. > >> 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 > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users |