fingerprint_fps_GT511C3

Hello Everyone,

I am only getting started with Particle and I am loving it! I am trying to use the fingerprint scanner (TTL GT511C1R). I can find the library when I search for it on the IDE (Dev). All examples, however, fail to compile. The error is always “compiler timed out or encountered an error.”

I tried other libraries and it all worked as charm. So I figured that the issue has to do with the FPS library. Any thoughts on how to fix it ?

Thank you

@alriabdu, the library looks like an older unsupported library (no github link). I assume you are referring to the “FINGERPRINT_FPS_GT511C3” library on the web IDE, correct? It would need to be updated to libraries v2 and reposted.

1 Like

@peekay123 … yes you are right. This is the library i am refering too (it should work with the C1R type as well). I want to use the sensor with my photon and it seems the only way to do so is to use this library. Is it possible for me to fix the library ? If so, would you please tell me how ? The problem that the error (compiler timed out …etc) doesn’t provide enough information on where the problem is and, thus, it is hard for me to debug the original code. I would appreciate any thoughts on this.

Thank you for your time.

Hi @peekay123, I use this “GT511C1R” Fingerprint Scanner since over 2 years now and all works well. I just want to point out an issue which may also affect others:

Now and then I am updating the fingerprints in my unit with the ‘enroll’ application.
Normally I use ParticleDev to reflash both applications, and that still works well.

Today, I wanted to try and use the Web IDE instead.
So, I pasted my application in and loaded the library “Fingerprint_FPS_GT511C3.h” instead of the “old” library “FPS_GT511C3.h” (Updated by @peekay123 on Oct 24, 2015) I am using (locally) with Particle Dev.

The application compiles OK.
However, after 15s blinking cyan, my Photon disconnects and starts blinking green.
Nothing works!

When I flash the same application with ParticleDev and the “old” library, all works well again…

So, I suppose something must be wrong with that “new” library…
I saw it contains a recent message: “Adapted for Particle Libraries by Michael Frontz, April 2017”

Anybody else experiencing this?
:older_man:

Bad news: I was happy to say that @peekay123’s old library still worked for me… No more!
From today, even with that library, my Photon disconnects and starts blinking green (after 15s blinking cyan)

Does anybody have a clue how the “FINGERPRINT_FPS_GT511C3” library can be repaired? (Or another solution to use these fingerprint scanners?)
:sweat:

@FiDel, did you recompile and that’s why it’s no longer working? Are you running in SYSTEM_THREAD(ENABLED) mode? Is the library the issue or your own code possibly?

1 Like

Thanks for coming back to this @peekay123!

Indeed, I recompiled my "FPS_IDFinger" sketch after adding some fingerprints with the "Enroll" sketch.
After that, it started to disconnect and blink green.
Even with the original example "FPS_IDFinger" sketch the same happens now...
To be honest I should say also that I changed the connections slightly: Instead of using 3.3V I now use 5V to power the FPS module.

I did not add any specific instructions in that direction.

Suggestion: Shall we focus on testing the standard example, included with your (old) library?

Here it is:

/* 
	FPS_Enroll.ino - Library example for controlling the GT-511C3 Finger Print Scanner (FPS)
	Created by Josh Hawley, July 23rd 2013
	Licensed for non-commercial use, must include this license message
	basically, Feel free to hack away at it, but just give me credit for my work =)
	TLDR; Wil Wheaton's Law

	This sketch will attempt to identify a previously enrolled fingerprint.
	
	Modified for Particle Photon by Paul Kourany (peekay123), Oct 24, 2105
*/

#include "FPS_GT511C3.h"

// Hardware setup - FPS connected to:
//	  digital pin 4(arduino rx, fps tx)
//	  digital pin 5(arduino tx - 560ohm resistor fps tx - 1000ohm resistor - ground)
//		this brings the 5v tx line down to about 3.2v so we dont fry our fps

FPS_GT511C3 fps;

void setup()
{
	Serial.begin(9600);
	delay(100);
	fps.Open();
	fps.SetLED(true);
}

void loop()
{

	// Identify fingerprint test
	if (fps.IsPressFinger())
	{
		fps.CaptureFinger(false);
		int id = fps.Identify1_N();
		if (id <200)
		{
			Serial.print("Verified ID:");
			Serial.println(id);
		}
		else
		{
			Serial.println("Finger not found");
		}
	}
	else
	{
		Serial.println("Please press finger");
	}
	delay(100);
}

Today, I will try to find some time to try out a few more things.

PS:

  1. I found also another similar thread where you helped making this device work: LINK
  2. Here is the 'old' library ported by Paul: LINK

Hmm, the library found in Web IDE does use a different #include statement.
Unfortunaltely there is no GitHub link nor does it contain a change log.

https://build.particle.io/libs/Fingerprint_FPS_GT511C3/1.0.6/tab/Fingerprint_FPS_GT511C3.cpp

Can you give this a try?
If it works fine, but if it doesn’t we might want to take it down or take it over into the eliteio GitHub repo since it doesn’t seem to be included in any project anyway - @peekay123?

About the disconnect issue, I believe it’s due to some communication problem which causes this section in Response_Packet* FPS_GT511C3::GetResponse() to kill the connection

	while (done == false)
	{
		if(Serial1.available() > 0)
		{
			///firstbyte = (byte)_serial.read();
			firstbyte = (byte) Serial1.read();
			if (firstbyte == Response_Packet::COMMAND_START_CODE_1)
			{
				done = true;
			}
		}
	}

Adding SYSTEM_THREAD(ENABLED)at the top of you sketch - as Paul suggested - might cure that, but won’t remove the root cause for the blocking.

1 Like

I tried also with SYSTEM_THREAD(ENABLED) at the top of different sketches. The LED keeps flashing cyan but there is no activity (serial output) and it cannot be reflashed.
(After putting it in safe mode, it can be re-flashed of course)

Even the simple “FPS_Blink.ino” sketch cannot be made to work: Not with the “old” library via Particle Dev or with the new library via Web IDE.

Here is that sketch:

/* 
	FPS_Enroll.ino - Library example for controlling the GT-511C3 Finger Print Scanner (FPS)
	Created by Josh Hawley, July 23rd 2013
	Licensed for non-commercial use, must include this license message
	basically, Feel free to hack away at it, but just give me credit for my work =)
	TLDR; Wil Wheaton's Law

	This simple sketch turns the LED on and off similar to the Arduino blink sketch.
	It is used to show that communications are working.
	
	Adapted for Particle Libraries by Michael Frontz, April 2017
*/

#include <Fingerprint_FPS_GT511C3.h>

/* Hardware setup - FPS connected to Photon using JST SH Jumper 4 Wire Assembly (https://www.sparkfun.com/products/10359)
	If the JST SH jumper wires were numbered left to right as 1-4 (with black wire being Wire 4), the connections would be:	
	FPS Wire 1 (White) = VCC --> Photon 3.3V
	FPS Wire 2 (White) = GND --> Photon GND
	FPS Wire 3 (White) = RX --> Photon TX
	FPS Wire 4 (Black) = TX --> Photon RX
	
	Built-in green LED on FPS will light up if wiring is correct
*/

FPS_GT511C3 fps;

void setup()
{
	Serial.begin(9600);
	fps.UseSerialDebug = true; // so you can see the messages in the serial debug screen
	fps.Open();
}


void loop()
{
	// FPS Blink LED Test
	fps.SetLED(true); // turn on the LED inside the fps
	delay(1000);
	fps.SetLED(false);// turn off the LED inside the fps
	delay(1000);
}

:sweat:

I just found another library for this FPS called “gt511c3.h”.
Too late here now, I’ll try it out tomorrow…
:sleeping:

Hi,

As promised, I tried to compile the simplest example sketch for this fingerprint scanner (FPS_Blink.ino) with the second FPS module library “gt511c3.h” but it does not compile:

Error message: “lib/gt511c3/gt511c3.cpp:12:18: fps.h: No such file or directory

Indeed, the library calls for this file: “#include “fps.h”;” and there is no such file in the collection.
There is this file: “gt511c3.h”…

So, it looks like I’m really stuck now with my FPS modules.
Should I look out for another type?

:wave: :older_man:

When including "SYSTEM_THREAD(ENABLED)", the Photon seems not to disconnect (Keeps flashing cyan)
But in reality the program is not running and it is not connected: Cannot be reflashed without putting it in safe mode.

I have built-in a publish command in the below test sketch, to see if it's connected but the message does not appear in the console...

/* 
	FPS_Blink.ino - Library example for controlling the GT-511C3 Finger Print Scanner (FPS)
	Created by Josh Hawley, July 23rd 2013
	Licensed for non-commercial use, must include this license message
	basically, Feel free to hack away at it, but just give me credit for my work =)
	TLDR; Wil Wheaton's Law

	This simple sketch turns the LED on and off similar to the Arduino blink sketch.
	It is used to show that communications are working.
	
	Adapted for Particle Libraries by Michael Frontz, April 2017
*/

    SYSTEM_THREAD(ENABLED); // Not in original; Helps avoid disconnects => https://docs.particle.io/reference/firmware/photon/#system-thread
    //#include <gt511c3.h> // Alternative Web IDE library
    #include <Fingerprint_FPS_GT511C3.h> // NEW Web IDE library

/* Hardware setup - FPS connected to Photon using JST SH Jumper 4 Wire Assembly (https://www.sparkfun.com/products/10359)
	If the JST SH jumper wires were numbered left to right as 1-4 (with black wire being Wire 4), the connections would be:	
	FPS Wire 1 (White) = VCC --> Photon 3.3V
	FPS Wire 2 (White) = GND --> Photon GND
	FPS Wire 3 (White) = RX --> Photon TX
	FPS Wire 4 (Black) = TX --> Photon RX
	
	Built-in green LED on FPS will light up if wiring is correct
*/

FPS_GT511C3 fps;

void setup()
{
	Serial.begin(9600);
	fps.UseSerialDebug = true; // so you can see the messages in the serial debug screen
	fps.Open();
}


void loop()
{
	// FPS Blink LED Test
	fps.SetLED(true); // turn on the LED inside the fps
	delay(1000);
	fps.SetLED(false);// turn off the LED inside the fps
	delay(1000);
	
    Particle.publish("FPS", "FPS program runs",60,PRIVATE);// For debugging purpose: Is the program running?
}

The fact that your publish does not happen does not actually tell that the program is not running.
As pointed out the library may trap the flow in a tight loop which prevents the code from ever reaching the publish line but still servicing the system thread.
To properly check that theory you can add a Software Timer - which runs in its own thread - and toggle the D7 LED like below

SYSTEM_THREAD(ENABLED); // Not in original; Helps avoid disconnects => https://docs.particle.io/reference/firmware/photon/#system-thread
//#include <gt511c3.h> // Alternative Web IDE library
#include <Fingerprint_FPS_GT511C3.h> // NEW Web IDE library

FPS_GT511C3 fps;

void blink() {
  digitalWrite(D7, !digitalRead(D7));
}

Timer t(1000, blink);

void setup()
{
  Serial.begin(9600);
  pinMode(D7, OUTPUT);
  t.start();
  fps.UseSerialDebug = true; // so you can see the messages in the serial debug screen
  fps.Open();
}

void loop()
{
  // FPS Blink LED Test
  fps.SetLED(true); // turn on the LED inside the fps
  delay(1000);
  fps.SetLED(false);// turn off the LED inside the fps
  delay(1000);

  // this may never happen since the code got trapped somewhere before that 	
  Particle.publish("FPS", "FPS program runs",60,PRIVATE);// For debugging purpose: Is the program running?
}

But as mentioned before

1 Like

Thanks for this great tip @ScruffR !

Today I only have internet via my smartphone: The network outside is down for 2 days, so all my Photons are blinking green… :frowning:

I’ll test it when they come back on-line.

1 Like

You could let your Photons join your Phones mobile hotspot :wink:

1 Like

OK thanks again for the tip, but maybe this should be outside of this thread… (PM?)


Yes, I’m aware of that possibility and I have tested some Photons already via my tethered phone some time ago.
But right now, to register the 10 Photons spread though the house (60 km away from my current home) is too troublesome and timeconsuming…

However, when we’ll move there to live permanently in our new home, I may need a “Back-up solution” like that in order to be able to ensure the continuity of the vital systems like heating.

Currently the floor heating system is already controlled by the Photons. When they don’t connect to the cloud we are in trouble…

So, I am always interested in studying “best practice” to solve these issues…
:wave::older_man:

@FiDel, ANY control system designed for automation must have autonomous or failsafe operation. If any controlled system cannot operate independently without the internet/cloud connection then your design is incorrect. One approach is to use a local cloud, independent of the Particle cloud. Another is to create failsafe code which continues autonomous control of the devices based on preset, failsafe setpoints. :wink:

2 Likes

OK @ScruffR, now that we have internet connection again here, I tried your above test sketch and the blue D7 led keeps blinking indeed.

Even when I blank out “SYSTEM_THREAD(ENABLED);”, the Photon RGB led turns to green the blue D7 led keeps blinking but the FPS led does not blink at all. Also when I use @peekay123’s library “FPS_GT511C3.h”, via Particle Dev the same thing happens…

Once the test sketch is flashed, the Photon disconnects and I cannot flash it anymore without putting it in safe mode first.

I cannot think otherwise than that both GT511C3 libraries available in the web IDE as well as @peekay123’s library “FPS_GT511C3.h” are creating this disconnection issue, don’t you think so?

Maybe I should try with an Arduino…

:wave: :older_man:

Indeed, you are absolutely right!
So, even in our heating system, we have the possibility to open the circuits manually: Not that we will freeze due to a Particle malfunctioning... :yum:

@FiDel, do you have a link to the actual fingerprint scanner you are using?