Fingerprint question

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
Rj_Viki
 
Posts: 23
Joined: Wed Jan 18, 2017 2:10 am

Re: Fingerprint question

Post by Rj_Viki »

I still cant fingure out how your library file works
Could you please explain the steps in simple procedure ?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Fingerprint question

Post by adafruit_support_rick »

To enroll a fingerprint, call the following functions in order
fingerprint. getImage(); //scan finger
fingerprint. image2Tz(1); //extract image features into buffer #1
fingerprint. getImage() //scan finger again
fingerprint. image2Tz(2) //extract image features into buffer #2
fingerprint.createModel() //create match template from features
fingerprint. storeModel(ID); //store template as ID number

To match a fingerprint, call the following functions in order:
fingerprint. getImage(); //scan finger
fingerprint. image2Tz(); //extract image features
fingerprint.fingerFastSearch(); //perform match. Return ID.

User avatar
RAMEELALI123
 
Posts: 4
Joined: Thu Jan 26, 2017 8:21 am

Re: Fingerprint question

Post by RAMEELALI123 »

please help me i want to extract the geryscale image after enrolling.

User avatar
Rj_Viki
 
Posts: 23
Joined: Wed Jan 18, 2017 2:10 am

Re: Fingerprint question

Post by Rj_Viki »

Hi RAMEELALI123,
Use SFGDemo software to save the image after enrolling it .

User avatar
Rj_Viki
 
Posts: 23
Joined: Wed Jan 18, 2017 2:10 am

Re: Fingerprint question

Post by Rj_Viki »

Is the data getting stored in Buffer 1 and Buffer 2 are image file or some other data file ?
If it is a data file , how cold I be able to print it in Serial Monitor ? what is the command to print it ?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Fingerprint question

Post by adafruit_support_rick »

The sensor has one Image Buffer, and two "character buffers". The sensor performs its feature extraction algorithm on the image to build a "template" in one of the character buffers.
Don Jeronimo's software uploads the template data to the computer. I believe he also echoes it to the Serial Monitor.

User avatar
Rj_Viki
 
Posts: 23
Joined: Wed Jan 18, 2017 2:10 am

Re: Fingerprint question

Post by Rj_Viki »

How to save image directly using the arduino code ,
Right now I am using another customized library to save image directly from the module without using the software , but that needs to run a python script to be running to save image .
Can i save the image just by using Arduino scketch ? if Yes , How to do it ?
--------------------------------------------------------------------------------------------------------------------------------
If there is any other method like How to work with the module if I am using USB to connect to my system ?
(Vcc , D+ , D- , Gnd )
- how to program the module to send a command to get image and save it in a folder
--------------------------------------------------------------------------------------------------------------------------------

This is the .cpp which to send image to PC

Code: Select all

// download fingerprint image to pc
uint8_t Adafruit_Fingerprint::sendImage(){
	uint8_t packet[] = {FINGERPRINT_IMGUPLOAD};
    writePacket(theAddress, FINGERPRINT_COMMANDPACKET, sizeof(packet)+2, packet);
    uint16_t len = getReply(packet);
    
    if ((len != 1) || (packet[0] != FINGERPRINT_ACKPACKET)){
        return -1;
    }
    Serial.print('\t');	// signifies start of data packet to pc
    int count = 0; 		// counts the number of data packets received
    while (packet[0] != FINGERPRINT_ENDDATAPACKET){
    	uint16_t len = getReply(packet, DATA);
    	count++;
    	if ((packet[0] != FINGERPRINT_DATAPACKET) && (packet[0] != FINGERPRINT_ENDDATAPACKET)){
    		return -1;
    	}
    }
    Serial.println(count);	// reports number of bytes received
    return 1;
}
This is the Arduino sketch for imagetoPC

Code: Select all

#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
SoftwareSerial myser(2, 3);

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&myser);
void setup() {
  Serial.begin(57600);
  finger.begin(57600);
  if (finger.verifyPassword()){
    Serial.println("Fingerprint sensor detected");
  }
  else {
    Serial.println("Sensor was not detected!");
    while (1);
  }
 delay(100);
}

void loop() {
  sendtoPC();
  delay(100);
}

void sendtoPC(){
  int p = -1;
  Serial.println("Waiting for valid finger");
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }

  Serial.println("Remove finger");
  delay(1000);
  p = finger.sendImage();
  if (p == -1){
    Serial.println("Error sending image.");
  }
  else if (p == 1){
    Serial.println("Image sent.");
  }
}
https://drive.google.com/file/d/0B-903x ... 9ONWs/view this is the library file I am using

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Fingerprint question

Post by adafruit_support_rick »

I don't have any code that will save the image on arduino. Your sendImage function doesn't look like it does anything like that. I don't know what it's supposed to do.

User avatar
Rj_Viki
 
Posts: 23
Joined: Wed Jan 18, 2017 2:10 am

Re: Fingerprint question

Post by Rj_Viki »

Okay ,
I am using USD to Serial convertor to connect the module to my PC directly ,is it possible to give instruction and make the module respond for it ? and How to do it ?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Fingerprint question

Post by adafruit_support_rick »

The sensor is controlled by commands sent over serial. This is what the adafruit library does. You will have to write a PC app that does the same thing as the Adafruit library. If you write your app in C++, you can use the adafruit code largely unchanged.

User avatar
Vishal1605
 
Posts: 1
Joined: Sun Feb 12, 2017 1:22 pm

Re: Fingerprint question

Post by Vishal1605 »

When I store one fingerprint using 'enroll' sketch, It gets store with ID#0 (irrespective of which Id I type in serial monitor) and when I try to store another fingerprint the previous fingerprint gets overwritten and new fingerprint is also stored with ID#0. Please help me How can I store multiple fingerprints using enroll sketch?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Fingerprint question

Post by adafruit_support_rick »

Make sure you're using the latest version of the Fingerprint library.
Alo, make sure you have Serial Monitor set to send both CR and NL. There's a dropdown at the bottom of the serial monitor window

User avatar
Rj_Viki
 
Posts: 23
Joined: Wed Jan 18, 2017 2:10 am

Re: Fingerprint question

Post by Rj_Viki »

As I was working with this fingerprint i found something that if we are using Arduino code to extract image byte data I am getting 36865 bytes.
But if I am using USBtoSerial convertor to get image byte data directly from Fingerprint module I am getting 40044 bytes where does these extra 3179 bytes comes from ?
How do i exclude them ? will these data will be in the front of at last ?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Fingerprint question

Post by adafruit_support_rick »

Honestly, I don't know. You're far beyond what I know about the fingerprint sensor. What happens if you try to display the image data?

User avatar
aclecio_ul
 
Posts: 3
Joined: Sat Mar 04, 2017 8:15 pm

Re: Fingerprint question

Post by aclecio_ul »

How do I get back to the factory setting of the player?

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”