so I have an problem to get my fringerprint scanner working with my raspberry pi.
I have an USB TTL adapter which I use as an serial module. The fingerprint scanner I use is dy50.
I tryed wireing and programming it on my Arduino UNO and the fingerprint scanner worked well.
Now I followed this tutorial https://tutorials-raspberrypi.com/how-to-use-raspberry-pi-fingerprint-sensor-authentication/ to configure my fingerprint scanner with my raspberry pi.
I installed everything and when I try to run the example script to test the fingerprint scanner then I get this error: "The fingerprint sensor could not be initialized! Exception message: The received packet do not begin with a valid header!"
On my arduino the Baud rate I used was 9600 now I've changed the baud rate from 57600 to 9600 on my raspberry pi and none of these worked. I checked my wireing a few times and it just doesn't work.
I tried switching the TX/RX pins too.
Can somebody help me out and may had the same issue?
This is the code I use:
#!/usr/bin/env python from pyfingerprint.pyfingerprint import PyFingerprint ## Shows the template index table ## ## Tries to initialize the sensor try: f = PyFingerprint('/dev/ttyUSB0', 57600, 0xFFFFFFFF, 0x00000000) if ( f.verifyPassword() == False ): raise ValueError('The given fingerprint sensor password is wrong!') except Exception as e: print('The fingerprint sensor could not be initialized!') print('Exception message: ' + str(e)) exit(1) ## Gets some sensor information print('Currently used templates: ' + str(f.getTemplateCount()) +'/'+ str(f.getStorageCapacity())) ## Tries to show a template index table page try: page = input('Please enter the index page (0, 1, 2, 3) you want to see: ') page = int(page) tableIndex = f.getTemplateIndex(page) for i in range(0, len(tableIndex)): print('Template at position #' + str(i) + ' is used: ' + str(tableIndex[i])) except Exception as e: print('Operation failed!') print('Exception message: ' + str(e)) exit(1)