esp8266 12e working with Fingerprint Scanner GT511C1R
Posted: Thu Sep 17, 2015 10:51 am
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.
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
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