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
    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))

## Gets some sensor information
print('Currently used templates: ' + str(f.getTemplateCount()) +'/'+ str(f.getStorageCapacity()))

## Tries to show a template index table page
    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))
  • This is unlikely to have enough information to get a good answer. We'd probably need code and/or a picture of the wiring. – Brick May 28 '19 at 13:07
  • That link is for "how-to-control-a-raspberry-pi-ws2801-rgb-led-strip" So not sure what good that is. You need to post the code you are using, along with maybe write a little python script that connects to the port and does some simple command to the scanner, check the docs for it, there might be a "version" command or something simular that you can prove out communication with. – Chad G May 28 '19 at 21:37
  • Have you tried switching the TX/RX pins or verified they are correct? This is mentioned many times in the comments of the tutorial I think you were looking at. – Chad G May 28 '19 at 21:58
  • @ChadG Yes I've tried switching the TX/RX pins. – Maybe Jun 3 '19 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.