Enroll Finger print creates issues; Adafruit Library

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. I am using Uno, finger print module & Adafruit library.

 

2. With using all the library all the function works ok, like delete, scan but i have some issues in Enroll function.

 

3. Enroll function is below, it is same, except some minor changes & I had a small key_read function, in case user wants to exit. key_read is small non-blocking function, read a variable only, which get set/reset in ISR only, so minimal code there.

 

4. Problem is :
a) When first scan is done, it is ok.
b) next it ask for remove finger & place again.
c) now doing that & place finger again, code many times gives finger mismatch.
d) 9 out of 10 times it is giving mismatch . Although I am doing the same way every-time.

 

5. Same happens if I use En-roll example from Adafruit also.

 

6. What could be the error?

 

7. One possible error I think in Adafruit library there is variable "confidence", which check the matching level of both. Might be it is set to very high value, but in library I didn't find where to set it low.

 

uint8_t add_fingerprint_id(uint16_t id , uint8_t *r_key)
{
    uint8_t point = 255U;
    uint8_t key = no_key;
    uint8_t breakloop;
    uint8_t next = 0U;
  
    lcd.setCursor(0 , 3);   
    lcd_string_const(add_place_str); 
    serial_string_nl_const(add_place_str);     
    

/* clear key vars */
    clear_key_vars(); 

    breakloop = 0U;
    while(0U == breakloop)
    {
        point = finger.getImage();
        switch(point) 
        {
            case FINGERPRINT_OK:
                lcd.setCursor(0 , 3); 
                lcd_string_const(add_taken_str); 
                serial_string_nl_const(add_taken_str);
                breakloop = 1U;
            break;
    
            case FINGERPRINT_NOFINGER:
                lcd.setCursor(0 , 3); 
                lcd_string_const(add_no_finger_str);
                serial_string_nl_const(add_no_finger_str);
            break;
    
            case FINGERPRINT_PACKETRECIEVEERR:
                lcd.setCursor(0 , 3); 
                lcd_string_const(add_comm_err_str);
                serial_string_nl_const(add_comm_err_str);
            break;
    
            case FINGERPRINT_IMAGEFAIL:
                lcd.setCursor(0 , 3); 
                lcd_string_const(add_image_err_str);
                serial_string_nl_const(add_image_err_str);
            break;
    
            default:
                lcd.setCursor(0 , 3); 
                lcd_string_const(add_unknown_err_str);
                serial_string_nl_const(add_unknown_err_str);
            break;
        }   

    /* read the key */
        key = key_read();
        if(EXIT_KEY == key)
        {
            breakloop = 1U; 
            next = 1U;          
        }        
    }

    if(0U == next)
    {
        lcd.setCursor(0 , 3);
        breakloop = 0U;       

        point = finger.image2Tz(1);
        switch(point) 
        {
            case FINGERPRINT_OK:
                lcd_string_const(add_image_conv_str); 
                serial_string_nl_const(add_image_conv_str);
                breakloop = 1U;
            break;
    
            case FINGERPRINT_IMAGEMESS:
                lcd_string_const(add_image_messy_str);
                serial_string_nl_const(add_image_messy_str);
                next = 1U;
            break;
    
            case FINGERPRINT_PACKETRECIEVEERR:
                lcd_string_const(add_comm_err_str);
                serial_string_nl_const(add_comm_err_str);
                next = 1U;
            break;
    
            case FINGERPRINT_FEATUREFAIL:
                lcd_string_const(add_no_feature_str);
                serial_string_nl_const(add_no_feature_str);
                next = 1U;
            break;

            case FINGERPRINT_INVALIDIMAGE:
                lcd_string_const(add_no_feature_str);
                serial_string_nl_const(add_no_feature_str);
                next = 1U;
            break;
    
            default:
                lcd_string_const(add_unknown_err_str);
                serial_string_nl_const(add_unknown_err_str);
                next = 1U;
            break;

        }
               

    /* read the key */
        key = key_read();
        if(EXIT_KEY == key)
        {
            breakloop = 1U; 
            next = 1U;          
        }        
 
    }

    if(0U == next)
    {
        lcd.setCursor(0 , 3);  
        lcd_string_const(add_remove_str);
        serial_string_nl_const(add_remove_str);     
        delay(2000);
        point = 0U;

        breakloop = 0U;       
        while(0U == breakloop)
        {
            point = finger.getImage();
            if(FINGERPRINT_NOFINGER == point)
            {
                breakloop = 1U;  
            }

        /* read the key */
            key = key_read();
            if(EXIT_KEY == key)
            {
                breakloop = 1U; 
                next = 1U;          
            }        
        }
        
    }

    if(0U == next)
    {
        lcd.setCursor(0 , 3);  
        lcd_string_const(add_again_str);
        serial_string_nl_const(add_again_str);     
        point = 255U;
      
        lcd.setCursor(0 , 3);
        breakloop = 0U;       
        while(0U == breakloop)
        {
            point = finger.getImage();
            switch(point) 
            {
                case FINGERPRINT_OK:
                    lcd.setCursor(0 , 3);
                    lcd_string_const(add_taken_str); 
                    serial_string_nl_const(add_taken_str);
                    breakloop = 1U;
                break;
    
                case FINGERPRINT_NOFINGER:
                    lcd.setCursor(0 , 3);
                    lcd_string_const(add_no_finger_str);
                    serial_string_nl_const(add_no_finger_str);
                break;
    
                case FINGERPRINT_PACKETRECIEVEERR:
                    lcd.setCursor(0 , 3);
                    lcd_string_const(add_comm_err_str);
                    serial_string_nl_const(add_comm_err_str);
                break;
    
                case FINGERPRINT_IMAGEFAIL:
                    lcd.setCursor(0 , 3);
                    lcd_string_const(add_image_err_str);
                    serial_string_nl_const(add_image_err_str);
                break;
    
                default:
                    lcd.setCursor(0 , 3);
                    lcd_string_const(add_unknown_err_str);
                    serial_string_nl_const(add_unknown_err_str);
                break;
            }   

        /* read the key */
            key = key_read();
            if(EXIT_KEY == key)
            {
                breakloop = 1U; 
                next = 1U;          
            }        
        }
    }    


    if(0U == next)
    {
        lcd.setCursor(0 , 3);
        breakloop = 0U;       

        point = finger.image2Tz(2);
        switch(point) 
        {
            case FINGERPRINT_OK:
                lcd_string_const(add_image_conv_str); 
                serial_string_nl_const(add_image_conv_str);
                breakloop = 1U;
            break;
    
            case FINGERPRINT_IMAGEMESS:
                lcd_string_const(add_image_messy_str);
                serial_string_nl_const(add_image_messy_str);
                next = 1U;
            break;
    
            case FINGERPRINT_PACKETRECIEVEERR:
                lcd_string_const(add_comm_err_str);
                serial_string_nl_const(add_comm_err_str);
                next = 1U;
            break;
    
            case FINGERPRINT_FEATUREFAIL:
                lcd_string_const(add_no_feature_str);
                serial_string_nl_const(add_no_feature_str);
                next = 1U;
            break;

            case FINGERPRINT_INVALIDIMAGE:
                lcd_string_const(add_no_feature_str);
                serial_string_nl_const(add_no_feature_str);
                next = 1U;
            break;
    
            default:
                lcd_string_const(add_unknown_err_str);
                serial_string_nl_const(add_unknown_err_str);
                next = 1U;
            break;

        }
               

    /* read the key */
        key = key_read();
        if(EXIT_KEY == key)
        {
            breakloop = 1U; 
            next = 1U;          
        }        
 
    }


    if(0U == next)
    {
        lcd.setCursor(0 , 3);  
        lcd_string_const(add_create_str);
        serial_string_nl_const(add_create_str);     
        lcd.setCursor(0 , 3);

        point = finger.createModel();
        if(FINGERPRINT_OK == point)
        {
            lcd_string_const(add_match_str);
            serial_string_nl_const(add_match_str);             
        }
        else if(FINGERPRINT_PACKETRECIEVEERR == point)
        {
            lcd_string_const(add_comm_err_str);
            serial_string_nl_const(add_comm_err_str);
            next = 1U;             
        }
        else if(FINGERPRINT_ENROLLMISMATCH == point)
        {
            lcd_string_const(add_mismatch_str);
            serial_string_nl_const(add_mismatch_str); 
            next = 1U;            
        }
        else
        {
            lcd_string_const(add_unknown_err_str);
            serial_string_nl_const(add_unknown_err_str);
            next = 1U;        
        }

    /* read the key */
        key = key_read();
        if(EXIT_KEY == key)
        {
            breakloop = 1U; 
            next = 1U;          
        }                
    }


    if(0U == next)
    {  
        lcd.setCursor(0 , 3);

        point = finger.storeModel(id);
        if(FINGERPRINT_OK == point)
        {
            lcd_string_const(add_store_str);
            serial_string_nl_const(add_store_str);             
        }
        else if(FINGERPRINT_PACKETRECIEVEERR == point)
        {
            lcd_string_const(add_comm_err_str);
            serial_string_nl_const(add_comm_err_str);
            next = 1U;             
        }
        else if(FINGERPRINT_BADLOCATION == point)
        {
            lcd_string_const(add_not_store_str);
            serial_string_nl_const(add_not_store_str); 
            next = 1U;            
        }
        else if(FINGERPRINT_FLASHERR == point)
        {
            lcd_string_const(add_flash_err_str);
            serial_string_nl_const(add_flash_err_str); 
            next = 1U;            
        }
        else
        {
            lcd_string_const(add_unknown_err_str);
            serial_string_nl_const(add_unknown_err_str);
            next = 1U;        
        }

    /* read the key */
        key = key_read();
        if(EXIT_KEY == key)
        {
            breakloop = 1U; 
            next = 1U;          
        }                
    }      

    
    
    if(EXIT_KEY == key)
    {
        *r_key = EXIT_KEY;  
    }   
    else
    {
        *r_key = no_key;        
    }

    delay(2000);

    return point;
     
} /* function ends here */ 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vindhyachal Takniki wrote:
it is same, except some minor changes
In which case I'd wind back to the "original" with no changes. Does that work? If it does incrementally add your own changes back until you find what it is that breaks the thing.

 

(revision control will make this process easier!)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
 incrementally add your own changes back until you find what it is that breaks the thing.

 

(revision control will make this process easier!)

+99

 

See: http://www.avrfreaks.net/comment...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

It's always the minor changes that cause the problems!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vindhyachal Takniki wrote:
finger print module

What finger print module?

 

Quote:
Adafruit library.

What Adafruit library?

 

Have you asked Adafruit about it: https://forums.adafruit.com/ ?

 

Have you checked out their tutorials: https://learn.adafruit.com/search?q=finger&

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
It's always the minor changes that cause the problems!

 

Just one last wafer-thin change ...

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. yes I maintain the version control. Have around 50 backup, each have small changes or new modules.

2. As I mentioned in post#1 point5, 5. Same happens if I use En-roll example from Adafruit also.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Do not just mention "adafruit library" or "en-roll example". Post links so we can be sure we are looking at the same thing!

Happy 75th anniversary to one of the best movies ever made! Rick Blane [Bogart]: "Of all the gin joints, in all the towns, in all the world, she walks into mine."

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vindhyachal Takniki wrote:
 Same happens if I use En-roll example from Adafruit also.

So you really should be taking it up with Adafruit, then.

 

JohanEkdahl wrote:
Post links so we can be sure we are looking at the same thing!

Absolutely!

 

And you still haven't said which sensor you're using.

Is the library and/or the example actually designed for it?

Again, give links.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. This is the library, https://github.com/adafruit/Adaf...

2. Finger print module is working fine for delete & detect id, but enroll gives error as discussed.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I encourage you to try out the link in the post above. In fact, this is what you always should do. It will reveal when you mess up (as you just did).

 

And you still have not produced a link to the fingerprint module.

Happy 75th anniversary to one of the best movies ever made! Rick Blane [Bogart]: "Of all the gin joints, in all the towns, in all the world, she walks into mine."

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Trailing space in the URL.  It's a common problem ever since we were blessed with the new forum software.

https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library

 

The following Adafruit product link appears at the top of the library's github page:

https://www.adafruit.com/product/751

 

That is currently the only fingerprint module carried by Adafruit, so by inference I suppose this must be the one the OP has.

 

However, nobody appreciates having to do detective work just because an OP is too lazy to ask a smart question.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
nobody appreciates having to do detective work just because an OP is too lazy to ask a smart question

+1

 

frown

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it is same finge print, & problem exist on using example code provided and on code with minor changes both.

Edit: changes done are adding a key_read function only, which reads a varaible only, added if user wants to exit/cancel from operation.

Last Edited: Thu. Sep 7, 2017 - 02:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vindhyachal Takniki wrote:
it is same finge print

Same as what ??

 

You still have not stated - either here or in your cross-post - what "finger print module" you are using!

 

problem exist on using example code provided

So raise an issue on the GitHub repository

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Vindhyachal Takniki wrote:

problem exist on using example code provided

So raise an issue on the GitHub repository

+100

 

Ross McKenzie ValuSoft Melbourne Australia

Last Edited: Thu. Sep 7, 2017 - 08:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://github.com/adafruit/Adaf...

opened a post here. Let see