Go Down

Topic: Write template on Fingerprint sensor R305/R307 (Read 3702 times) previous topic - next topic

nimit393

Blank sketch with Rx Tx correctly connected to that of fingerprint sensor would not work? The code posted by you does a very similar task, with not directly bypassing the UART commands but relaying it to different serial port.
What might be the reason for this?

nimit393

Baud rate for Cool Term can be updated to 57600.

J-M-L

I've seen boards behave differently when trying to use pin 0 and 1 and also have usb connected... so I'm always careful on such setup
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

nimit393

I extracted fingerprint template using the standard extract feature in Ada fruit library. Received template as

"FFFFFFFFFFFFFFFFFF0165159200FFFEFFFEFFFEFFFEF80EC00680008000800080000000000000000000000000008000000000000000000000000000000020AB78324242982B0DEF01FFFFFFFF0200825E1F56592A3ED8D9674201F90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000056CEF01FFFFFFFF02008203015E169700FFFEFFFEFFFEFF1EC006C002C0008000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF98415E1BA41ADE49A4431E6BA481FE2E26047E60AB033E0AAD845E59B2DC5E45B39ADE0AB604BE09BADC5E1F3D9ABE553F04FE48C29ADE3898031F26AD843F53AF44FF71B81F9F2AF9EF01FFFFFFFF08008239C306376297D71C659B2C7C2E394416000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000618FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"

However, I can find 3 header message within the templates. I tried other fingerprint in the same device...all 3 have 3 header section embedded into it and long series of 0 and F. Which part of the message is actually the template which I can use and write it on to other fingerprint sensor.

Motive is to extract template and store in a central repository...which can be transmitted on to multiple sensors as the network get expanded.


J-M-L

Post the full true output of the example - not just an extract of what you think is meaningful

Are you running this on a UNO or MEGA ?

The  stray FFFFFFFFFFF you see are just there because buffer is initialized with plenty of FF in the library

They seem to use data packets of 256 bytes but seems what you get back is actually the 128 bytes version

having multiple data packet is not impossible as you might not be able to fit all the data in one frame, so you should expect when you send a command to get many answer and at some point the last frame will include a End of Data packet command so that you know it's the last one

there is  plenty of garbage so would need to see exactly the output on the Serial console...

The 3 frames you see are



FFFFFFFFFFFFFFFFFF0165159200FFFEFFFEFFFEFFFEF80EC00680008000800080000000000000000000000000008000000000000000000000000000000020AB78324242982B0D


EF01
FFFFFFFF
02      Data packet
0082      length of package = command packets + data packets + CKSUM --> 128 bytes + 2 for checksum
5E1F56592A3ED8D9674201F90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
056C      CKSUM (this one is OK)

EF01
FFFFFFFF
02      Data packet
0082      length of package = command packets + data packets + CKSUM --> 128 bytes + 2 for checksum
03015E169700FFFEFFFEFFFEFF1EC006C002C0008000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF98415E1BA41ADE49A4431E6BA481FE2E26047E60AB033E0AAD845E59B2DC5E45B39ADE0AB604BE09BADC5E1F3D9ABE553F04FE48C29ADE3898031F26AD843F53AF44FF71B81F9F
2AF9      CKSUM (this one seems wrong)

EF01
FFFFFFFF
08      End of Data packet
0082      length of package = command packets + data packets + CKSUM --> 128 bytes + 2 for checksum
39C306376297D71C659B2C7C2E39441600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0618      CKSUM (this one is OK)


FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF






Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

nimit393

The attachment shows template read for 2 different fingerprints.

However when I am trying to write the same template on other location...the serial trace does not show garbage values but cool term shows. And after sending the 4 chunks of template...finally when store command is used...reply is 01 ...error when receiving data.

nimit393

Issue resolved...I am now able to write template from external source. You can ignore the above post.

J-M-L

Would be fair to explain what you did and how you solved it for everyone having the same question in the future
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

nimit393

1. First step to extract fingerprint from sensor is to load the desired template number to either buffer 1 or 2.
2. Once the template is loaded into buffer, read the template from buffer.
3. Template size might vary, hence, the whole template might be broken down into multiple bits and part.
4. This template can now be stored onto other device and can be reused to write the same template into similar sensor.
5. Commands for all the above functions are standard and can be viewed in the document shared in this blog post above.
6. Example of template extracted can also be viewed in the text files shared in the previous post.

J-M-L

Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

nimit393

Hi,

Trying to send data over serial. The data is getting transmitted as ASCII equivalent when read over the other arduino with code shared by you in earlier post(one which displays the HEX values of the data received over serial). However, correct HEX value get displayed on the serial monitor of the arduino on which this code is runing.

Code: [Select]
/*
  SD card read/write

 This example shows how to read and write data to and from an SD card file
 The circuit:
 * SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

 created   Nov 2010
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe

 This example code is in the public domain.

 */
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
#include <SPI.h>
#include <SD.h>
int i;
String s;
char a[1]={16};
int b=20;
File myFile;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(57600);
  mySerial.begin(57600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.print("Initializing SD card...");

  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");

  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile = SD.open("ABCDEF.txt", FILE_WRITE);

  // re-open the file for reading:
  myFile = SD.open("ABCDEF.txt");
  if (myFile) {
    Serial.println("ABCDEF.txt:");

    // read from the file until there's nothing else in it:
    while (myFile.available()) {
      i=myFile.read();
     
      if (isDigit(i)) {
      // convert the incoming byte to a char and add it to the string:
      s += (char)i;
    }

    if (i == '\n') {
      int p = s.toInt();
      Serial.print(p,HEX);
      mySerial.print(p,HEX);
      p=atoi(p);
      mySerial.print(p,HEX);
      s = "";
      p = "";
      //mySerial.print(32,HEX);
    }
   
      //Serial.write(r);
      //mySerial.write(r);
    }
    // close the file:
    myFile.close();
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening ABCDEF.txt");
  }
}

void loop() {
  // nothing happens after setup
  //mySerial.write("1");
}


nimit393

Understood my mistake...should had used Serial.write instead of Serial.print

J-M-L

Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

marcoas

@nimit393,  Can you show us, the code for write template on sensor, please?


1. First step to extract fingerprint from sensor is to load the desired template number to either buffer 1 or 2.
2. Once the template is loaded into buffer, read the template from buffer.
3. Template size might vary, hence, the whole template might be broken down into multiple bits and part.
4. This template can now be stored onto other device and can be reused to write the same template into similar sensor.
5. Commands for all the above functions are standard and can be viewed in the document shared in this blog post above.
6. Example of template extracted can also be viewed in the text files shared in the previous post.

Go Up