Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By dchanym
#29256 Hi,

Currently, I try to use the Fingerprint Scanner GT511C1R with ESP8266 12e. http://www.anarduino.com/fingerprint-sensor/ Basically, I use the Sparkfun library to drive the FPS https://github.com/sparkfun/Fingerprint_Scanner-TTL.

Got a little bit frustrated on using this module.... :| The problem is the FPS will stuck at the Open() API in every twice times.

I do further tracking on the code and finally found the it will stuck at the Serial.read(). It seems the FPS never return the Response package and the FPS wait forever at Serial.available()....

Weird thing is that the FPS can return the Response package if I reset it twice. That is, when ESP8266 is power up, it stuck at Open() command. If I press the reset button again, the Open() will work correctly.

// Gets the response to the command from the software serial channel (and waits for it)
Response_Packet* FPS_GT511C3::GetResponse()
{
byte firstbyte = 0;
bool done = false;
_serial.listen();
while (done == false) <== stuck at here and never get out
{
firstbyte = (byte)_serial.read();
if (firstbyte == Response_Packet::COMMAND_START_CODE_1)
{
done = true;
}
}
byte* resp = new byte[12];
resp[0] = firstbyte;
for (int i=1; i < 12; i++)
{
while (_serial.available() == false) delay(10);
resp[i]= (byte) _serial.read();
}
Response_Packet* rp = new Response_Packet(resp, UseSerialDebug);
delete resp;
if (UseSerialDebug)
{
Serial.print("FPS - RECV: ");
SendToSerial(rp->RawBytes, 12);
Serial.println();
Serial.println();
}
return rp;
};


Is the ESP8266 compatible to the FPS?
Is anyone can successfully drive the FPS scanner using ESP8266?

Any advice is welcome and thanks in advance.

Cheers,
Dick