Giter Site home page Giter Site logo

Comments (39)

MaazSk avatar MaazSk commented on July 18, 2024 1

@mohammadhasanzadeh There is a reset pin which is pin 7 but I don't know how to reset the hardware. If there is an option for hardware reset please let me know and if the issue is solved then also let me know. I am working on the same module if I come across anything will let you know

Thanks and Regards

from fpm.

brianrho avatar brianrho commented on July 18, 2024 1

The problem is, the initial handshake passes with return code 0 as expected, but the subsequent readParams() call just returns 1 (instead of 16 bytes of data), as you can see from the Serial output.
From what I've found in the datasheet and user reviews, it seems the R308 doesn't support the ReadSysParam command, unlike most other sensors in this family.
This means the library can't automatically determine the sensor capacity, packet length, etc, which are integral to the library logic at the moment. So I'd recommend you either use the Adafruit library or get another more compatible sensor like the FPM10 or ZFM60

from fpm.

MaazSk avatar MaazSk commented on July 18, 2024 1

Great nice to hear that, I am also having some problem in templates example working on the same

from fpm.

brianrho avatar brianrho commented on July 18, 2024 1

Good to hear. I'll consider adding the option of manually supplying the parameters

from fpm.

MaazSk avatar MaazSk commented on July 18, 2024

@mohammadhasanzadeh Have you uploaded the change password code?
If yes just change the password to the default one and it will work fine, else just try to swap the Rx and Tx pins there are times when these 2 pins are not connected properly we will get the same issue.
Just let us know if the issue is solved

from fpm.

brianrho avatar brianrho commented on July 18, 2024

@mohammadhasanzadeh did @MaazSk's suggestion fix your problem? Will be closing the issue if this is done

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

@mohammadhasanzadeh Have you uploaded the change password code?
If yes just change the password to the default one and it will work fine, else just try to swap the Rx and Tx pins there are times when these 2 pins are not connected properly we will get the same issue.
Just let us know if the issue is solved

No, I didn't change password, also I swap several times Tx and Rx pins.
is there any way to reset fingerprint sensor in hardware mode?

@mohammadhasanzadeh did @MaazSk's suggestion fix your problem? Will be closing the issue if this is done

No, my problem not fixed yet.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

I don't know of any hardware reset pin, at least not with the sensors I've worked with. Most times when sensor communication fails, its usually because of a wrong baud rate or password. What is your MCU or dev board?

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

I did not find any solution for the reset fingerprint sensor in the datasheet.
I use wemos d1 mini lite.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

What pins are you using? What's your SoftwareSerial declaration like?

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

I use 12 for Rx and 14 for Tx:
SoftwareSerial finger_print_serial(12, 14);

from fpm.

MaazSk avatar MaazSk commented on July 18, 2024

Can you please send us the code

from fpm.

MaazSk avatar MaazSk commented on July 18, 2024

@mohammadhasanzadeh have you installed the software serial library for wemos or NodeMCU boards there is a different Software Serial library for these boards the arduino library is not compatible, please make this change and let us know
Thanks and Regards
Maaz Shaikh

from fpm.

brianrho avatar brianrho commented on July 18, 2024
  • This is the mapping you've been using for your wiring?
    D6 = GPIO12 = Sensor TX (green usually)
    D5 = GPIO14 = Sensor RX (yellow usually)

  • How have you been powering the sensor? With 5V?

  • I've assumed so far that you're running the examples but if you're not, then you should try the builtin enroll example. Try changing to finger.begin(0x12345678) if it doesn't work at first.

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

Is very strange problem! I uploaded the Adafruit example:
example
and without any change in pins (Rx=12, Tx= 14) , it works correctly!

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Let me see the sketch you used before this, with pastebin

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

main.cpp:
https://pastebin.com/qjb23QDC

finger_print.cpp:
https://pastebin.com/QHhDtxeP

from fpm.

brianrho avatar brianrho commented on July 18, 2024

This isn't the example sketch I said you should try

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Will be closing this, if there are no problems with the examples

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

I have the same problem with enroll example.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Send the exact sketch with pastebin

from fpm.

brianrho avatar brianrho commented on July 18, 2024

As well as what you see in the serial monitor

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

enroll sketch:
https://pastebin.com/QiAwbYsY
Serial monitor output:

ENROLL test
Did not find fingerprint sensor :(

from fpm.

brianrho avatar brianrho commented on July 18, 2024

The pins in your sketch are reversed, compared to what you sent earlier

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

Yes, I changed pins for equal to:

D6 = GPIO12 = Sensor TX (green usually)
D5 = GPIO14 = Sensor RX (yellow usually)

also I tested both:
SoftwareSerial fserial(12, 14);
and
SoftwareSerial fserial(14, 12);
but both are wrong!

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Did any of the FPM examples ever work with this sensor, from the beginning?

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

No, not any example works with this sensor, but Adafruit examples works with R308…!

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Uncomment FPM_DEBUG in FPM.h and run the enroll example again with the right pins, let me see everything you get from Serial

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

The following lines printed in debug mode:

�Hl�H�C�d�␇X␡�ENROLL test

[+]Got header
[+]Address: 0xFFFFFFFF
[+]PID: 0x7
[+]Length: 1
0
[+]Read complete

[+]Got header
[+]Address: 0xFFFFFFFF
[+]PID: 0x7
[+]Length: 1
1
[+]Read complete
Did not find fingerprint sensor :(

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

In FPM::readParams method I hard-coded the following lines:

sys_params.status_reg = 0x04;
sys_params.system_id = 0x0009;
sys_params.capacity = 500;
sys_params.security_level = FPM_FRR_5;
sys_params.device_addr = 0xFF;
sys_params.packet_len = FPM_PLEN_128;
sys_params.baud_rate = FPM_BAUD_57600;

After that, the fingerprint sensor also worked properly and also features that I needed, such as Enroll finger, Fast search, Get free id, Read template, Store template, delete template and Clear database all of them worked correctly.
Just in Store template, occurs TIMEOUT error randomly.

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

Of course after some tries Store template finally works.

from fpm.

MaazSk avatar MaazSk commented on July 18, 2024

@mohammadhasanzadeh what changes have you made for the templates example?

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

@mohammadhasanzadeh what changes have you made for the templates example?

I did not exactly test templates example, I tested my own code.
But for running templates example, I think you just need change FPM::readParams in FPM.cpp to:

int16_t FPM::readParams(FPM_System_Params * user_params) {
    // buffer[0] = FPM_READSYSPARAM;
    
	// writePacket(FPM_COMMANDPACKET, buffer, 1);
    // uint8_t confirm_code = 0;
    // int16_t len = read_ack_get_response(&confirm_code);
    
    // if (len < 0)
    //     return len;
    
    // if (confirm_code != FPM_OK)
    //     return confirm_code;
    
    // if (len != 16)
    //     return FPM_READ_ERROR;
    
    // memcpy(&sys_params, &buffer[1], 16);
    // reverse_bytes(&sys_params.status_reg, 2);
    // reverse_bytes(&sys_params.system_id, 2);
    // reverse_bytes(&sys_params.capacity, 2);
    // reverse_bytes(&sys_params.security_level, 2);
    // reverse_bytes(&sys_params.device_addr, 4);
    // reverse_bytes(&sys_params.packet_len, 2);
    // reverse_bytes(&sys_params.baud_rate, 2);
    sys_params.status_reg = 0x04;
    sys_params.system_id = 0x0009;
    sys_params.capacity = 500;
    sys_params.security_level = FPM_FRR_5;
    sys_params.device_addr = 0xFF;
    sys_params.packet_len = FPM_PLEN_128;
    sys_params.baud_rate = FPM_BAUD_57600;
    
    if (user_params != NULL)
        memcpy(user_params, &sys_params, 16);
    
    return FPM_OK;
}

R308 fingerprint sensor just works on 57600 baud rate, so it's important you ensure your software serial works on 57600 baud rate.

from fpm.

mohammadhasanzadeh avatar mohammadhasanzadeh commented on July 18, 2024

@brianrho Timeout error still occur after call storeModel randomly.
in what cases may occurs Timeout state?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Usually whenever it takes too long to get a response because of wrong baud rates, passwords, etc, hardly ever happens but you've made changes so could be anything

from fpm.

brianrho avatar brianrho commented on July 18, 2024

I've made changes to support the R308 as well as updated the debug system. You can check with your R308 to see if it works. Set the debug level to 2 so you can see everything that happens, could help track down the source of the timeouts.

from fpm.

JavadMohammdi avatar JavadMohammdi commented on July 18, 2024

@mohammadhasanzadeh what changes have you made for the templates example?

I did not exactly test templates example, I tested my own code.
But for running templates example, I think you just need change FPM::readParams in FPM.cpp to:

int16_t FPM::readParams(FPM_System_Params * user_params) {
    // buffer[0] = FPM_READSYSPARAM;
    
	// writePacket(FPM_COMMANDPACKET, buffer, 1);
    // uint8_t confirm_code = 0;
    // int16_t len = read_ack_get_response(&confirm_code);
    
    // if (len < 0)
    //     return len;
    
    // if (confirm_code != FPM_OK)
    //     return confirm_code;
    
    // if (len != 16)
    //     return FPM_READ_ERROR;
    
    // memcpy(&sys_params, &buffer[1], 16);
    // reverse_bytes(&sys_params.status_reg, 2);
    // reverse_bytes(&sys_params.system_id, 2);
    // reverse_bytes(&sys_params.capacity, 2);
    // reverse_bytes(&sys_params.security_level, 2);
    // reverse_bytes(&sys_params.device_addr, 4);
    // reverse_bytes(&sys_params.packet_len, 2);
    // reverse_bytes(&sys_params.baud_rate, 2);
    sys_params.status_reg = 0x04;
    sys_params.system_id = 0x0009;
    sys_params.capacity = 500;
    sys_params.security_level = FPM_FRR_5;
    sys_params.device_addr = 0xFF;
    sys_params.packet_len = FPM_PLEN_128;
    sys_params.baud_rate = FPM_BAUD_57600;
    
    if (user_params != NULL)
        memcpy(user_params, &sys_params, 16);
    
    return FPM_OK;
}

R308 fingerprint sensor just works on 57600 baud rate, so it's important you ensure your software serial works on 57600 baud rate.

Hi, I wanted to register my r308 fingerprint in Arduino, which gives an error and your problem can help me

from fpm.

JavadMohammdi avatar JavadMohammdi commented on July 18, 2024

@mohammadhasanzadeh what changes have you made for the templates example?

I did not exactly test templates example, I tested my own code.
But for running templates example, I think you just need change FPM::readParams in FPM.cpp to:

int16_t FPM::readParams(FPM_System_Params * user_params) {
    // buffer[0] = FPM_READSYSPARAM;
    
	// writePacket(FPM_COMMANDPACKET, buffer, 1);
    // uint8_t confirm_code = 0;
    // int16_t len = read_ack_get_response(&confirm_code);
    
    // if (len < 0)
    //     return len;
    
    // if (confirm_code != FPM_OK)
    //     return confirm_code;
    
    // if (len != 16)
    //     return FPM_READ_ERROR;
    
    // memcpy(&sys_params, &buffer[1], 16);
    // reverse_bytes(&sys_params.status_reg, 2);
    // reverse_bytes(&sys_params.system_id, 2);
    // reverse_bytes(&sys_params.capacity, 2);
    // reverse_bytes(&sys_params.security_level, 2);
    // reverse_bytes(&sys_params.device_addr, 4);
    // reverse_bytes(&sys_params.packet_len, 2);
    // reverse_bytes(&sys_params.baud_rate, 2);
    sys_params.status_reg = 0x04;
    sys_params.system_id = 0x0009;
    sys_params.capacity = 500;
    sys_params.security_level = FPM_FRR_5;
    sys_params.device_addr = 0xFF;
    sys_params.packet_len = FPM_PLEN_128;
    sys_params.baud_rate = FPM_BAUD_57600;
    
    if (user_params != NULL)
        memcpy(user_params, &sys_params, 16);
    
    return FPM_OK;
}

R308 fingerprint sensor just works on 57600 baud rate, so it's important you ensure your software serial works on 57600 baud rate.

Can you send me the code with which you could register your fingerprint on r308?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

@JavadMohammdi As explained in the README, there's an example already that shows how to setup your R308 to work with this library. You can easily port/transfer the setup() in that example to the other examples like enroll and templates.

from fpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.