I need to read barcode data using a USB barcode reader (raw data mode). I already know that I can configure the reader in keyboard mode, but this just does not meet my requirement, because I will use 4 readers at a time, and the text will overlap.
I am new to python and I tried to research it myself to no avail. I got this idea through the documentation, and I really don't know what is wrong with it.
Here is an example of the code I still found:
import sys import usb.core import usb.util
After running this and checking the barcode, I get this error.
Traceback (most recent call last): File "barcodesensor.py", line 37, in <module> data = device.read(x.bEndpointAddress, x.wMaxPacketSize, 0, 10000) File "/usr/local/lib/python2.6/dist-packages/usb/core.py", line 654, in read self.__get_timeout(timeout) File "/usr/local/lib/python2.6/dist-packages/usb/backend/libusb10.py", line 559, in intr_read timeout) File "/usr/local/lib/python2.6/dist-packages/usb/backend/libusb10.py", line 641, in __read timeout)) File "/usr/local/lib/python2.6/dist-packages/usb/backend/libusb10.py", line 403, in _check raise USBError(_str_error[ret], ret, _libusb_errno[ret]) usb.core.USBError: [Errno 110] Operation timed out.
I am ready to sacrifice through PayPal to anyone who can help me in obtaining raw data and converting the format to a string. Thanks in advance.
EDIT: How to get the correct data from a barcode and convert it to a readable string format?
source share