i am using this code to read in python for reading data from my usb barcode scanner on my raspberry pi
import usb.core
import usb.util
import sys
# find our device
dev = usb.core.find(idVendor=0x05e0, idProduct=0x1200)
# was it found?
if dev is None:
raise ValueError('Device not found')
# configuration will be the active one
dev.set_configuration()
print "Device found!"
print dev
#Read value from device
for bRequest in range(255):
try:
read = dev.ctrl_transfer(0x81, bRequest, 0, 0, 8) #read 8 bytes
print "bRequest ", bRequest
print read
but I am getting an this error "USBError: [Errno 13] Access denied (insufficient permission)"
Does anyone know how to get rid of it??
Please help!
Thanks in advance
Re: usb error no 13
Direct low level access of USB devices requires root permissions so you'll need to launch Python with the prefix sudo.
Richard S.
Richard S.