Fingerprint authentication via MQTT

I flashed the wemos, connected the sensor, but it always gives me comunication error, and it doesn’t send any mqtt message
where am i wrong?

16:37:14.141 -> Welcome to the MQTT Fingerprint Sensor program!
16:37:15.167 -> Found fingerprint sensor!
16:37:15.261 -> Connecting……….
16:37:19.594 -> Connected, IP address: 192.168.1.206
16:37:19.594 -> Attempting MQTT connection…connected
16:37:37.978 -> Image taken
16:37:38.443 -> Image converted
16:37:38.443 -> Unknown error
16:37:42.956 -> Image taken
16:37:43.472 -> Image converted
16:37:43.472 -> Unknown error
16:37:43.846 -> Image taken
16:37:44.360 -> Image converted
16:37:44.360 -> Unknown error
16:37:44.736 -> Image taken
16:37:45.250 -> Image converted
16:37:45.250 -> Unknown error
16:37:45.624 -> Image taken
16:37:46.137 -> Image converted
16:37:46.137 -> Unknown error
16:37:46.510 -> Image taken
16:37:46.977 -> Image converted
16:37:46.977 -> Unknown error
16:37:47.351 -> Image taken
16:37:47.865 -> Image converted
16:37:47.865 -> Unknown error
16:37:48.238 -> Image taken
16:37:48.741 -> Image converted
16:37:48.741 -> Unknown error
16:37:49.115 -> Image taken
16:37:49.629 -> Image converted
16:37:49.629 -> Unknown error
16:37:50.003 -> Image taken
16:37:50.518 -> Image converted
16:37:50.518 -> Unknown error
16:37:50.894 -> Image taken
16:37:51.362 -> Image converted
16:37:51.362 -> Unknown error
16:38:04.881 -> Communication error
16:38:12.900 -> Communication error
16:38:29.381 -> Image taken
16:38:29.894 -> Image converted
16:38:29.894 -> Unknown error
16:38:32.923 -> Image taken
16:38:33.391 -> Image converted
16:38:33.391 -> Unknown error
16:38:55.567 -> Communication error
16:38:59.804 -> Communication error

please help me
i have tried to download the program to my esp822
and i get this error.
I have updated the library

olny one .ino in the folder
you have to choose which version to use. you have all 4 instead

I can store and delete fingerprints via home hassistant. I cannot read for stored fingerprints. it gives me back Unkown error.
if it can be useful I customized all the error messages.
random gives me this error message:
13:43:35.792 -> Communication error_A

in code:

uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
switch § {
case FINGERPRINT_OK:
Serial.println(“Image taken”);
break;
case FINGERPRINT_NOFINGER:
//Serial.println(“No finger detected”);
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error_A”);
return p;
case FINGERPRINT_IMAGEFAIL:
Serial.println(“Imaging error 1”);
return p;
default:
Serial.println(“Unknown error 2”);
return p;
}

while when I read the fingerprint it gives me this error:

in code:
// OK converted!
p = finger.fingerFastSearch();
if (p == FINGERPRINT_OK) {
Serial.println(“Found a print match!”);
lastID = finger.fingerID;
lastConfidenceScore = finger.confidence;
return p;
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println(“Communication error 2”);
return p;
} else if (p == FINGERPRINT_NOTFOUND) {
Serial.println(“Did not find a match”);
return p;
} else {
Serial.println(“Unknown error 4”);
return p;
}

I state that with another simple sketch the tellor works correctly.

which sensor are you using?
start working with the file
fingerprint-mqtt.ino

I use this sensor
FPM10A Optical Fingerprint Reader Sensor Module Door Lock Fingerprint Scanner Detector identification UART TTL USB for Arduino
thank you very much
it worked. I just successfully generated this code
fingerprint-mqtt.ino

Did you manage to get it working?

Did you manage to get it working or still having s problem?

no, the problem persists

with this code it recognizes fingerprints, but obviously there is no wifi, mqtt and the functions of learning and deleting the fingerprints

/***************************************************
This is an example sketch for our optical Fingerprint sensor

Designed specifically to work with the Adafruit BMP085 Breakout
----> http://www.adafruit.com/products/751

These displays use TTL Serial to communicate, 2 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/

#include <Adafruit_Fingerprint.h>

#if (defined(AVR) || defined(ESP8266)) && !defined(AVR_ATmega2560)
// For UNO and others without hardware serial, we must use software serial…
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
// Set up the serial port to use softwareserial…
SoftwareSerial mySerial(12, 14);

#else
// On Leonardo/M0/etc, others with hardware serial, use hardware serial!
// #0 is green wire, #1 is white
#define mySerial Serial1

#endif

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

void setup()
{
Serial.begin(9600);
while (!Serial); // For Yun/Leo/Micro/Zero/…
delay(100);
Serial.println("\n\nAdafruit finger detect test");

// set the data rate for the sensor serial port
finger.begin(57600);
delay(5);
if (finger.verifyPassword()) {
Serial.println(“Found fingerprint sensor!”);
} else {
Serial.println(“Did not find fingerprint sensor :(”);
while (1) { delay(1); }
}

Serial.println(F(“Reading sensor parameters”));
finger.getParameters();
Serial.print(F(“Status: 0x”)); Serial.println(finger.status_reg, HEX);
Serial.print(F(“Sys ID: 0x”)); Serial.println(finger.system_id, HEX);
Serial.print(F("Capacity: ")); Serial.println(finger.capacity);
Serial.print(F("Security level: ")); Serial.println(finger.security_level);
Serial.print(F("Device address: ")); Serial.println(finger.device_addr, HEX);
Serial.print(F("Packet len: ")); Serial.println(finger.packet_len);
Serial.print(F("Baud rate: ")); Serial.println(finger.baud_rate);

finger.getTemplateCount();

if (finger.templateCount == 0) {
Serial.print(“Sensor doesn’t contain any fingerprint data. Please run the ‘enroll’ example.”);
}
else {
Serial.println(“Waiting for valid finger…”);
Serial.print(“Sensor contains “); Serial.print(finger.templateCount); Serial.println(” templates”);
}
}

void loop() // run over and over again
{
getFingerprintID();
delay(500); //don’t ned to run this at full speed.
}

uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
switch § {
case FINGERPRINT_OK:
Serial.println(“Image taken”);
break;
case FINGERPRINT_NOFINGER:
Serial.println(“No finger detected”);
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error”);
return p;
case FINGERPRINT_IMAGEFAIL:
Serial.println(“Imaging error”);
return p;
default:
Serial.println(“Unknown error”);
return p;
}

// OK success!

p = finger.image2Tz();
switch § {
case FINGERPRINT_OK:
Serial.println(“Image converted”);
break;
case FINGERPRINT_IMAGEMESS:
Serial.println(“Image too messy”);
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error”);
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println(“Could not find fingerprint features”);
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println(“Could not find fingerprint features”);
return p;
default:
Serial.println(“Unknown error”);
return p;
}

// OK converted!
p = finger.fingerSearch();
if (p == FINGERPRINT_OK) {
Serial.println(“Found a print match!”);
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println(“Communication error”);
return p;
} else if (p == FINGERPRINT_NOTFOUND) {
Serial.println(“Did not find a match”);
return p;
} else {
Serial.println(“Unknown error”);
return p;
}

// found a match!
Serial.print(“Found ID #”); Serial.print(finger.fingerID);
Serial.print(" with confidence of "); Serial.println(finger.confidence);

return finger.fingerID;
}

// returns -1 if failed, otherwise returns ID #
int getFingerprintIDez() {
uint8_t p = finger.getImage();
if (p != FINGERPRINT_OK) return -1;

p = finger.image2Tz();
if (p != FINGERPRINT_OK) return -1;

p = finger.fingerFastSearch();
if (p != FINGERPRINT_OK) return -1;

// found a match!
Serial.print(“Found ID #”); Serial.print(finger.fingerID);
Serial.print(" with confidence of "); Serial.println(finger.confidence);
return finger.fingerID;
}

If you want to find me on Discord (not sure I can advertise the link here) I’d be happy to help. Which sketch are you using?

I’m ondiscord. I’m using fingerprint-mqtt.ino

I finished my fingerprints
when I perform dump program fingerprint-mqtt-led-touch-oled.ino
is faulty
I have added this to the library
Adafruit_Fingerprint.h
Below the initial define section add this

#define FINGERPRINT_OPENLED 0x50
#define FINGERPRINT_CLOSELED 0x51
and this too
Adafruit_Fingerprint.cpp
but still this error please help me

in the readme file there are instructions for modifying two libraries

I fixed those two libraries

this might be interesting.
finger print and id storage

Can you share your configuration?

Sure! as soon as possible I will make a “package” and publish it.

ok you are awesome

code: