I have a Raspberry Pi and SecuGen Hamster Plus fingerprint sensor.
I am trying to get fingerprint inputs from the sensor to Raspberry Pi using the following code.
import sys
import usb.core
import usb.util
VENDOR_ID=0x1162
PRODUCT_ID=0x1000
DATA_SIZE=64
device = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)
if device.is_kernel_driver_active(0):
device.detach_kernel_driver(0)
try:
device.set_configuration()
except usb.core.USBError as e:
sys.exit("Could not set configuration: %s" % str(e))
endpoint = device[0][(0,0)][0]
print endpoint
data = []
swiped = False
print "Send a code..."
a = 0
while True:
try:
dev = device.read(endpoint.bEndpointAddress,endpoint.wMaxPacketSize)
print dev
data.append(dev.buffer_info())
if len(data)>2:
print data[a]
a = a+1
if not swiped:
print "Reading..."
swiped = True
except usb.core.USBError as e:
print e
if e.args == ('Operation timed out',) and swiped:
if len(data) < DATA_SIZE:
swiped = False
continue
else:
break
I keep getting [Errno 110] Operation timed out
as error. I am a noob in the hardware field. Can someone help me with the integration of Pi with fingerprint sensor?
pi
?) have access to the Finger scanner - I guess it does, as your code is reaching the main loop - but I am not a python expert. This does look like an interesting device and it does claim Linux support so don't give up just yet... 8-)