Variables and constants in RAM (global, static), used 30264 / 80192 bytes (37%)
║ SEGMENT BYTES DESCRIPTION
╠══ DATA 1516 initialized variables
╠══ RODATA 1596 constants
╚══ BSS 27152 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 62559 / 65536 bytes (95%)
║ SEGMENT BYTES DESCRIPTION
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 29791 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 278912 / 1048576 bytes (26%)
║ SEGMENT BYTES DESCRIPTION
╚══ IROM 278912 code in flash
///////////////////////////////MYCODE/////////////////////////////////
// NodeMCU --------------------------
#include <Arduino.h>
#include <WiFiClient.h>
#include <ESP8266WiFi.h>
#include <SoftwareSerial.h>
#include <ESP8266HTTPClient.h>
#include <SimpleTimer.h>
// OLED -----------------------------
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_Fingerprint.h>
// Function prototypes
void CheckMode();
void ChecktoAddID();
void CheckFingerprint();
void ChecktoDeleteID();
void connectToWiFi();
void confirmAdding(int id);
void initializeSerial();
uint8_t getFingerprintEnroll();
uint8_t getFingerprintID();
//************************************************************************
// Fingerprint scanner Pins
#define Finger_Rx 14 // D5
#define Finger_Tx 12 // D6
// Declaration for SSD1306 display connected using software I2C (pins are 22 SCL, 21 SDA)
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET 0 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
//************************************************************************
SimpleTimer timer;
SoftwareSerial mySerial(Finger_Rx, Finger_Tx);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
//************************************************************************
/* Set these to your desired credentials. */
const char *ssid = "Airtel_DWARAKA";
const char password = "airdwaraka";
const char device_token = "e1caa0b5c8bc5418";
//************************************************************************
String getData, Link;
String URL = "http://192.168.xx.xx/sandeepani_balagokulam_attendance/getdata.php"; // Computer IP or the server domain
//************************************************************************
int FingerID = 0, t1, t2; // The Fingerprint ID from the scanner
bool device_Mode = false; // Default Mode Enrollment
bool firstConnect = false;
uint8_t id;
unsigned long previousMillis = 0;
//Biometric Icons********
#define Wifi_start_width 54
#define Wifi_start_height 49
const uint8_t PROGMEM Wifi_start_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1f,0xf0,0x00,0x00,0x00,
0x00,0x03,0xff,0xff,0x80,0x00,0x00,
0x00,0x1f,0xf0,0x1f,0xf0,0x00,0x00,
0x00,0x7e,0x00,0x00,0xfc,0x00,0x00,
0x01,0xf0,0x00,0x00,0x1f,0x00,0x00,
0x03,0xc0,0x00,0x00,0x07,0xc0,0x00,
0x0f,0x00,0x00,0x00,0x01,0xe0,0x00,
0x1c,0x00,0x00,0x00,0x00,0x70,0x00,
0x38,0x00,0x07,0xc0,0x00,0x38,0x00,
0x70,0x00,0xff,0xfe,0x00,0x1e,0x00,
0xe0,0x03,0xfc,0x7f,0xc0,0x0e,0x00,
0x00,0x1f,0x80,0x03,0xf0,0x00,0x00,
0x00,0x3c,0x00,0x00,0x78,0x00,0x00,
0x00,0xf0,0x00,0x00,0x1c,0x00,0x00,
0x01,0xe0,0x00,0x00,0x0c,0x00,0x00,
0x03,0x80,0x00,0x00,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3f,0xf8,0x07,0x1e,0x00,
0x00,0x00,0xff,0xfe,0x1f,0xbf,0x80,
0x00,0x03,0xe0,0x04,0x7f,0xff,0xc0,
0x00,0x0e,0x00,0x00,0xff,0xff,0xe0,
0x00,0x0c,0x00,0x00,0x7f,0xff,0xc0,
0x00,0x00,0x00,0x00,0xfe,0x07,0xe0,
0x00,0x00,0x00,0x03,0xf8,0x03,0xf8,
0x00,0x00,0x07,0xe7,0xf9,0xf1,0xfc,
0x00,0x00,0x1f,0xe7,0xf1,0xf9,0xfc,
0x00,0x00,0x1f,0xe7,0xf3,0xf9,0xfc,
0x00,0x00,0x3f,0xe7,0xf3,0xf9,0xfc,
0x00,0x00,0x3f,0xf3,0xfc,0x07,0xf8,
0x00,0x00,0x1f,0xf0,0x7f,0x0f,0xc0,
0x00,0x00,0x0f,0xe0,0x7f,0xff,0xe0,
0x00,0x00,0x07,0xc0,0xff,0xff,0xe0,
0x00,0x00,0x00,0x00,0x7f,0xff,0xe0,
0x00,0x00,0x00,0x00,0x3f,0xff,0x80,
0x00,0x00,0x00,0x00,0x1f,0xbf,0x00,
0x00,0x00,0x00,0x00,0x03,0x18,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
#define Wifi_connected_width 63
#define Wifi_connected_height 49
const uint8_t PROGMEM Wifi_connected_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0xff,0xff,0x80,0x00,0x00,
0x00,0x00,0x3f,0xff,0xff,0xf8,0x00,0x00,
0x00,0x01,0xff,0xff,0xff,0xff,0x00,0x00,
0x00,0x0f,0xff,0xff,0xff,0xff,0xe0,0x00,
0x00,0x3f,0xff,0xc0,0x07,0xff,0xf8,0x00,
0x00,0xff,0xf8,0x00,0x00,0x3f,0xfe,0x00,
0x03,0xff,0x80,0x00,0x00,0x03,0xff,0x80,
0x07,0xfe,0x00,0x00,0x00,0x00,0xff,0xc0,
0x1f,0xf8,0x00,0x00,0x00,0x00,0x3f,0xf0,
0x3f,0xe0,0x01,0xff,0xff,0x00,0x0f,0xf8,
0x7f,0x80,0x0f,0xff,0xff,0xe0,0x03,0xfc,
0xff,0x00,0x7f,0xff,0xff,0xfc,0x01,0xfe,
0xfc,0x01,0xff,0xff,0xff,0xff,0x00,0x7e,
0x78,0x07,0xff,0xc0,0x07,0xff,0xc0,0x3c,
0x00,0x0f,0xfc,0x00,0x00,0x7f,0xe0,0x00,
0x00,0x1f,0xf0,0x00,0x00,0x1f,0xf0,0x00,
0x00,0x3f,0xc0,0x00,0x00,0x07,0xf8,0x00,
0x00,0x7f,0x00,0x01,0x00,0x01,0xfc,0x00,
0x00,0x7e,0x00,0x7f,0xfc,0x00,0xfc,0x00,
0x00,0x3c,0x03,0xff,0xff,0x80,0x78,0x00,
0x00,0x00,0x07,0xff,0xff,0xc0,0x00,0x00,
0x00,0x00,0x1f,0xff,0xff,0xf0,0x00,0x00,
0x00,0x00,0x3f,0x80,0x03,0xf8,0x00,0x00,
0x00,0x00,0x3f,0x00,0x01,0xf8,0x00,0x00,
0x00,0x00,0x1c,0x00,0x00,0x70,0x00,0x00,
0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x00,
0x00,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00,
0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00,
0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
#define FinPr_start_width 64
#define FinPr_start_height 64
const uint8_t PROGMEM FinPr_start_bits[] = {
0x00,0x00,0x00,0x1f,0xe0,0x00,0x00,0x00,
0x00,0x00,0x01,0xff,0xfe,0x00,0x00,0x00,
0x00,0x00,0x03,0xff,0xff,0x80,0x00,0x00,
0x00,0x00,0x0f,0xc0,0x0f,0xe0,0x00,0x00,
0x00,0x00,0x1f,0x00,0x01,0xf8,0x00,0x00,
0x00,0x00,0x3c,0x00,0x00,0x7c,0x00,0x00,
0x00,0x00,0x78,0x00,0x00,0x3e,0x00,0x00,
0x00,0x00,0xf0,0x3f,0xf8,0x0f,0x00,0x00,
0x00,0x01,0xe0,0xff,0xfe,0x07,0x80,0x00,
0x00,0x03,0xc3,0xff,0xff,0x03,0x80,0x00,
0x00,0x03,0x87,0xc0,0x07,0xc3,0xc0,0x00,
0x00,0x07,0x0f,0x00,0x03,0xe1,0xc0,0x00,
0x00,0x0f,0x0e,0x00,0x00,0xe0,0xe0,0x00,
0x00,0x0e,0x1c,0x00,0x00,0xf0,0xe0,0x00,
0x00,0x0c,0x3c,0x1f,0xe0,0x70,0xe0,0x00,
0x00,0x00,0x38,0x3f,0xf0,0x38,0x70,0x00,
0x00,0x00,0x78,0x78,0xf8,0x38,0x70,0x00,
0x00,0x00,0x70,0x70,0x3c,0x18,0x70,0x00,
0x00,0x00,0xe0,0xe0,0x1e,0x1c,0x70,0x00,
0x00,0x03,0xe1,0xe0,0x0e,0x1c,0x70,0x00,
0x00,0x0f,0xc1,0xc3,0x0e,0x1c,0x70,0x00,
0x00,0x3f,0x03,0xc3,0x8e,0x1c,0x70,0x00,
0x00,0x30,0x07,0x07,0x0e,0x18,0xe0,0x00,
0x00,0x00,0x0e,0x0e,0x0e,0x38,0xe0,0x00,
0x00,0x00,0x3e,0x1e,0x1e,0x38,0xe0,0x00,
0x00,0x00,0xf8,0x1c,0x1c,0x38,0xe0,0x00,
0x00,0x03,0xf0,0x38,0x3c,0x38,0xe0,0x00,
0x00,0x3f,0xc0,0xf8,0x78,0x38,0xe0,0x00,
0x00,0x7f,0x01,0xf0,0x70,0x38,0xf0,0x00,
0x00,0x78,0x03,0xe0,0xe0,0x38,0x70,0x00,
0x00,0x00,0x0f,0x81,0xe0,0x38,0x7c,0x00,
0x00,0x00,0x3f,0x03,0xc0,0x38,0x3e,0x00,
0x00,0x00,0xfc,0x0f,0x80,0x38,0x1e,0x00,
0x00,0x07,0xf0,0x1f,0x1c,0x1c,0x04,0x00,
0x00,0x3f,0xc0,0x3e,0x3f,0x1e,0x00,0x00,
0x00,0x7f,0x00,0xf8,0x7f,0x0f,0x00,0x00,
0x00,0x38,0x01,0xf0,0xf7,0x07,0xc0,0x00,
0x00,0x00,0x07,0xe1,0xe3,0x83,0xf8,0x00,
0x00,0x00,0x3f,0x87,0xc3,0xc0,0xfc,0x00,
0x00,0x01,0xfe,0x0f,0x81,0xe0,0x3c,0x00,
0x00,0x0f,0xf8,0x1f,0x00,0xf0,0x00,0x00,
0x00,0x1f,0xc0,0x7c,0x00,0x7c,0x00,0x00,
0x00,0x1e,0x01,0xf8,0x00,0x3f,0x00,0x00,
0x00,0x00,0x07,0xe0,0x78,0x0f,0xc0,0x00,
0x00,0x00,0x3f,0x81,0xfe,0x07,0xf0,0x00,
0x00,0x01,0xfe,0x07,0xff,0x01,0xf0,0x00,
0x00,0x07,0xf8,0x0f,0x87,0x80,0x30,0x00,
0x00,0x07,0xc0,0x3f,0x03,0xe0,0x00,0x00,
0x00,0x06,0x00,0xfc,0x01,0xf8,0x00,0x00,
0x00,0x00,0x03,0xf0,0x00,0x7e,0x00,0x00,
0x00,0x00,0x0f,0xc0,0x00,0x3f,0x80,0x00,
0x00,0x00,0x7f,0x00,0xf8,0x0f,0x80,0x00,
0x00,0x00,0xfc,0x03,0xfe,0x01,0x80,0x00,
0x00,0x00,0xf0,0x1f,0xff,0x80,0x00,0x00,
0x00,0x00,0x00,0x7f,0x07,0xe0,0x00,0x00,
0x00,0x00,0x00,0xfc,0x03,0xf8,0x00,0x00,
0x00,0x00,0x03,0xf0,0x00,0x78,0x00,0x00,
0x00,0x00,0x0f,0xc0,0x00,0x18,0x00,0x00,
0x00,0x00,0x0f,0x01,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xfe,0x00,0x00,0x00,
0x00,0x00,0x00,0x1f,0xfe,0x00,0x00,0x00,
0x00,0x00,0x00,0x1e,0x0e,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,
};
#define FinPr_valid_width 64
#define FinPr_valid_height 64
const uint8_t PROGMEM FinPr_valid_bits[] = {
0x00,0x00,0x03,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0x1f,0xff,0xe0,0x00,0x00,0x00,
0x00,0x00,0x7f,0xff,0xf8,0x00,0x00,0x00,
0x00,0x00,0xfc,0x00,0xfe,0x00,0x00,0x00,
0x00,0x03,0xe0,0x00,0x1f,0x00,0x00,0x00,
0x00,0x07,0xc0,0x00,0x07,0x80,0x00,0x00,
0x00,0x0f,0x80,0x00,0x03,0xe0,0x00,0x00,
0x00,0x0e,0x03,0xff,0x01,0xe0,0x00,0x00,
0x00,0x1c,0x1f,0xff,0xe0,0xf0,0x00,0x00,
0x00,0x3c,0x3f,0xff,0xf0,0x78,0x00,0x00,
0x00,0x78,0x7c,0x00,0xf8,0x3c,0x00,0x00,
0x00,0x70,0xf0,0x00,0x3c,0x1c,0x00,0x00,
0x00,0xe1,0xe0,0x00,0x1e,0x1c,0x00,0x00,
0x00,0xe1,0xc0,0x00,0x0f,0x0e,0x00,0x00,
0x00,0xc3,0x81,0xfc,0x07,0x0e,0x00,0x00,
0x00,0x03,0x83,0xff,0x07,0x8e,0x00,0x00,
0x00,0x07,0x07,0x8f,0x83,0x87,0x00,0x00,
0x00,0x1e,0x0e,0x01,0xc3,0x87,0x00,0x00,
0x00,0x3c,0x1c,0x00,0xe1,0x87,0x00,0x00,
0x00,0xf8,0x1c,0x30,0xe1,0x87,0x00,0x00,
0x07,0xf0,0x38,0x70,0xe1,0x86,0x00,0x00,
0x07,0xc0,0x78,0x70,0xe3,0x8e,0x00,0x00,
0x02,0x00,0xf0,0xf0,0xe3,0x8e,0x00,0x00,
0x00,0x01,0xe0,0xe0,0xe3,0x8e,0x00,0x00,
0x00,0x03,0xc1,0xe1,0xc3,0x8e,0x00,0x00,
0x00,0x0f,0x83,0xc3,0xc3,0x8e,0x00,0x00,
0x00,0x7f,0x07,0x83,0x83,0x0e,0x00,0x00,
0x07,0xfc,0x0f,0x07,0x83,0x0e,0x00,0x00,
0x07,0xf0,0x1e,0x0f,0x03,0x0e,0x00,0x00,
0x07,0x80,0x7c,0x1e,0x03,0x07,0x00,0x00,
0x00,0x00,0xf8,0x3c,0x03,0x87,0x80,0x00,
0x00,0x03,0xf0,0x78,0x03,0x83,0xc0,0x00,
0x00,0xff,0x01,0xe1,0xc0,0x0c,0x00,0x00,
0x07,0xfc,0x03,0xc3,0xe1,0xff,0xc0,0x00,
0x07,0xe0,0x0f,0x87,0xc7,0xff,0xf0,0x00,
0x00,0x00,0x7c,0x3e,0x3f,0xff,0xfe,0x00,
0x00,0x03,0xf8,0x7c,0x3f,0xff,0xff,0x00,
0x00,0x1f,0xe0,0xf0,0x7f,0xff,0xff,0x80,
0x00,0xff,0x83,0xe0,0xff,0xff,0xff,0x80,
0x01,0xfc,0x07,0xc1,0xff,0xff,0xe3,0xc0,
0x01,0xe0,0x1f,0x01,0xff,0xff,0xc3,0xc0,
0x00,0x00,0xfe,0x01,0xff,0xff,0x87,0xe0,
0x00,0x03,0xf8,0x13,0xff,0xff,0x0f,0xe0,
0x00,0x1f,0xe0,0x73,0xff,0xfe,0x1f,0xe0,
0x00,0x7f,0x81,0xf3,0xff,0xfc,0x1f,0xe0,
0x00,0xfc,0x03,0xe3,0xef,0xf8,0x3f,0xe0,
0x00,0x60,0x0f,0xc3,0xc7,0xf0,0x7f,0xe0,
0x00,0x00,0x3f,0x03,0xc3,0xe0,0xff,0xe0,
0x00,0x00,0xfc,0x03,0xc1,0xc1,0xff,0xe0,
0x00,0x07,0xf0,0x13,0xe0,0x83,0xff,0xe0,
0x00,0x0f,0xc0,0x7b,0xf8,0x07,0xff,0xe0,
0x00,0x0f,0x01,0xf9,0xfc,0x0f,0xff,0xc0,
0x00,0x00,0x07,0xf1,0xfe,0x1f,0xff,0xc0,
0x00,0x00,0x1f,0xc0,0xff,0x3f,0xff,0x80,
0x00,0x00,0x7e,0x00,0xff,0xff,0xff,0x80,
0x00,0x00,0xfc,0x00,0x7f,0xff,0xff,0x00,
0x00,0x00,0xf0,0x1f,0x3f,0xff,0xfe,0x00,
0x00,0x00,0x00,0x7f,0x1f,0xff,0xfc,0x00,
0x00,0x00,0x01,0xff,0x8f,0xff,0xf8,0x00,
0x00,0x00,0x03,0xe0,0xe3,0xff,0xe0,0x00,
0x00,0x00,0x01,0x80,0x00,0x7f,0x00,0x00,
};
#define FinPr_invalid_width 64
#define FinPr_invalid_height 64
const uint8_t PROGMEM FinPr_invalid_bits[] = {
0x00,0x00,0x03,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0x1f,0xff,0xe0,0x00,0x00,0x00,
0x00,0x00,0x7f,0xff,0xf8,0x00,0x00,0x00,
0x00,0x00,0xfc,0x00,0xfe,0x00,0x00,0x00,
0x00,0x03,0xe0,0x00,0x1f,0x00,0x00,0x00,
0x00,0x07,0xc0,0x00,0x07,0x80,0x00,0x00,
0x00,0x0f,0x80,0x00,0x03,0xe0,0x00,0x00,
0x00,0x0e,0x03,0xff,0x01,0xe0,0x00,0x00,
0x00,0x1c,0x1f,0xff,0xe0,0xf0,0x00,0x00,
0x00,0x3c,0x3f,0xff,0xf0,0x78,0x00,0x00,
0x00,0x78,0x7c,0x00,0xf8,0x3c,0x00,0x00,
0x00,0x70,0xf0,0x00,0x3c,0x1c,0x00,0x00,
0x00,0xe1,0xe0,0x00,0x1e,0x1c,0x00,0x00,
0x00,0xe1,0xc0,0x00,0x0f,0x0e,0x00,0x00,
0x00,0xc3,0x81,0xfc,0x07,0x0e,0x00,0x00,
0x00,0x03,0x83,0xff,0x07,0x8e,0x00,0x00,
0x00,0x07,0x07,0x8f,0x83,0x87,0x00,0x00,
0x00,0x0f,0x0f,0x03,0xc3,0x87,0x00,0x00,
0x00,0x1e,0x0e,0x01,0xc3,0x87,0x00,0x00,
0x00,0x3c,0x1c,0x00,0xe1,0x87,0x00,0x00,
0x00,0xf8,0x1c,0x30,0xe1,0x87,0x00,0x00,
0x07,0xf0,0x38,0x70,0xe1,0x86,0x00,0x00,
0x07,0xc0,0x78,0x70,0xe3,0x8e,0x00,0x00,
0x02,0x00,0xf0,0xf0,0xe3,0x8e,0x00,0x00,
0x00,0x01,0xe0,0xe0,0xe3,0x8e,0x00,0x00,
0x00,0x03,0xc1,0xe1,0xc3,0x8e,0x00,0x00,
0x00,0x0f,0x83,0xc3,0xc3,0x8e,0x00,0x00,
0x00,0x7f,0x07,0x83,0x83,0x0e,0x00,0x00,
0x07,0xfc,0x0f,0x07,0x83,0x0e,0x00,0x00,
0x07,0xf0,0x1e,0x0f,0x03,0x0e,0x00,0x00,
0x07,0x80,0x7c,0x1e,0x03,0x07,0x00,0x00,
0x00,0x00,0xf8,0x3c,0x03,0x87,0x80,0x00,
0x00,0x03,0xf0,0x78,0x03,0x83,0xc0,0x00,
0x00,0x1f,0xc0,0xf0,0x02,0x00,0x00,0x00,
0x00,0xff,0x01,0xe1,0xc0,0x00,0x00,0x00,
0x07,0xfc,0x03,0xc3,0xe1,0xff,0xc0,0x00,
0x07,0xe0,0x0f,0x87,0xc7,0xff,0xf0,0x00,
0x07,0x00,0x3f,0x0f,0x0f,0xff,0xf8,0x00,
0x00,0x00,0x7c,0x3e,0x1f,0xff,0xfe,0x00,
0x00,0x03,0xf8,0x7c,0x3f,0xff,0xff,0x00,
0x00,0x1f,0xe0,0xf0,0x7f,0xff,0xff,0x00,
0x00,0xff,0x83,0xe0,0xfe,0xff,0xbf,0x80,
0x01,0xfc,0x07,0xc0,0xfc,0x7f,0x1f,0xc0,
0x01,0xe0,0x1f,0x01,0xf8,0x3e,0x0f,0xc0,
0x00,0x00,0xfe,0x01,0xf8,0x1c,0x07,0xe0,
0x00,0x03,0xf8,0x13,0xf8,0x00,0x0f,0xe0,
0x00,0x1f,0xe0,0x73,0xfc,0x00,0x1f,0xe0,
0x00,0x7f,0x81,0xf3,0xfe,0x00,0x3f,0xe0,
0x00,0xfc,0x03,0xe3,0xff,0x00,0x7f,0xe0,
0x00,0x60,0x0f,0xc3,0xff,0x80,0xff,0xe0,
0x00,0x00,0x3f,0x03,0xff,0x00,0x7f,0xe0,
0x00,0x00,0xfc,0x03,0xfe,0x00,0x3f,0xe0,
0x00,0x07,0xf0,0x13,0xfc,0x00,0x1f,0xe0,
0x00,0x0f,0xc0,0x79,0xf8,0x08,0x0f,0xe0,
0x00,0x0f,0x01,0xf9,0xf8,0x1c,0x0f,0xc0,
0x00,0x00,0x07,0xf1,0xfc,0x3e,0x1f,0xc0,
0x00,0x00,0x1f,0xc0,0xfe,0x7f,0x3f,0x80,
0x00,0x00,0x7e,0x00,0xff,0xff,0xff,0x80,
0x00,0x00,0xfc,0x00,0x7f,0xff,0xff,0x00,
0x00,0x00,0xf0,0x1f,0x3f,0xff,0xfe,0x00,
0x00,0x00,0x00,0x7f,0x1f,0xff,0xfc,0x00,
0x00,0x00,0x01,0xff,0x8f,0xff,0xf8,0x00,
0x00,0x00,0x03,0xe0,0xe3,0xff,0xe0,0x00,
0x00,0x00,0x01,0x80,0x00,0x7f,0x00,0x00,
};
#define FinPr_failed_width 64
#define FinPr_failed_height 64
const uint8_t PROGMEM FinPr_failed_bits[] = {
0x00,0x00,0x3f,0xe0,0x00,0x00,0x00,0x00,
0x00,0x01,0xff,0xfe,0x00,0x00,0x00,0x00,
0x00,0x0f,0xc0,0x1f,0x80,0x00,0x00,0x00,
0x00,0x1e,0x00,0x03,0xc0,0x00,0x00,0x00,
0x00,0x78,0x00,0x00,0xf0,0x00,0x00,0x00,
0x00,0xe0,0x00,0x00,0x38,0x00,0x00,0x00,
0x01,0xc0,0x00,0x00,0x1c,0x00,0x00,0x00,
0x03,0x80,0x00,0x00,0x0e,0x00,0x00,0x00,
0x07,0x00,0x7f,0xe0,0x07,0x00,0x00,0x00,
0x06,0x01,0xff,0xf8,0x03,0x00,0x00,0x00,
0x0c,0x03,0xc0,0x3c,0x03,0x80,0x00,0x00,
0x1c,0x0f,0x00,0x0e,0x01,0x80,0x00,0x00,
0x18,0x0c,0x00,0x03,0x00,0xc0,0x00,0x00,
0x18,0x18,0x00,0x01,0x80,0xc0,0x00,0x00,
0x30,0x38,0x00,0x01,0xc0,0xe0,0x00,0x00,
0x30,0x30,0x0f,0x00,0xc0,0x60,0x00,0x00,
0x30,0x30,0x3f,0xc0,0xe0,0x60,0x00,0x00,
0x70,0x60,0x78,0xe0,0x60,0x60,0x00,0x00,
0x60,0x60,0x60,0x60,0x60,0x70,0x00,0x00,
0x60,0x60,0x60,0x60,0x60,0x30,0x00,0x00,
0x60,0x60,0x60,0x60,0x30,0x30,0x00,0x00,
0x60,0x60,0x60,0x30,0x30,0x20,0x00,0x00,
0x60,0x60,0x60,0x30,0x30,0x01,0xe0,0x00,
0x60,0x60,0x60,0x30,0x30,0x0f,0xfc,0x00,
0x60,0x60,0x60,0x30,0x30,0x3f,0xff,0x00,
0x60,0x60,0x60,0x30,0x18,0x78,0x03,0x80,
0x60,0x60,0x60,0x30,0x1c,0x60,0x01,0x80,
0x60,0x60,0x30,0x38,0x0c,0xc0,0x00,0xc0,
0x00,0x60,0x30,0x18,0x00,0xc0,0x00,0xc0,
0x00,0x60,0x30,0x18,0x00,0xc0,0x00,0xc0,
0x00,0xe0,0x30,0x0c,0x01,0xc0,0x00,0xe0,
0x00,0xc0,0x18,0x0e,0x01,0xc0,0x00,0xe0,
0x60,0xc0,0x18,0x07,0x01,0xc0,0x00,0xe0,
0x01,0xc0,0x1c,0x03,0x81,0xc0,0x00,0xe0,
0x01,0x80,0x0c,0x01,0xc1,0xc0,0x00,0xe0,
0x03,0x80,0x0e,0x00,0xf1,0xc0,0x00,0xe0,
0x0f,0x00,0x06,0x00,0x01,0xc0,0x00,0xe0,
0x3e,0x01,0x03,0x00,0x01,0xc0,0x00,0xe0,
0x30,0x03,0x83,0x80,0x1f,0xff,0xff,0xfe,
0x00,0x03,0x81,0xc0,0x3f,0xff,0xff,0xff,
0x00,0x07,0xc0,0xe0,0x30,0x00,0x00,0x03,
0x00,0x0e,0xc0,0x78,0x30,0x00,0x00,0x03,
0x00,0x3c,0x60,0x1e,0x30,0x00,0x00,0x03,
0x00,0x78,0x70,0x0f,0x30,0x00,0x00,0x03,
0x03,0xe0,0x38,0x03,0x30,0x00,0x00,0x03,
0x07,0x80,0x1c,0x00,0x30,0x00,0x00,0x03,
0xc0,0x00,0x0f,0x00,0x30,0x00,0x00,0x03,
0xc0,0x00,0x03,0x80,0x30,0x01,0xe0,0x03,
0x00,0x18,0x01,0xe0,0x30,0x03,0xf0,0x03,
0x00,0x18,0x00,0x7c,0x30,0x07,0x38,0x03,
0x00,0x0c,0x00,0x1f,0x30,0x06,0x18,0x03,
0x18,0x0e,0x00,0x07,0x30,0x06,0x18,0x03,
0x0c,0x07,0x80,0x00,0x30,0x07,0x38,0x03,
0x0e,0x03,0xc0,0x00,0x30,0x03,0x30,0x03,
0x07,0x00,0xf0,0x00,0x30,0x03,0x30,0x03,
0x03,0x00,0x7e,0x00,0x30,0x03,0x30,0x03,
0x01,0x80,0x1f,0xc0,0x30,0x03,0x30,0x03,
0x01,0xc0,0x03,0xe1,0x30,0x07,0xf8,0x03,
0x00,0xf0,0x00,0x01,0x30,0x03,0xf0,0x03,
0x00,0x38,0x00,0x00,0x30,0x00,0x00,0x03,
0x00,0x1e,0x00,0x00,0x30,0x00,0x00,0x03,
0x00,0x07,0xc0,0x00,0x30,0x00,0x00,0x03,
0x00,0x01,0xff,0x80,0x3f,0xff,0xff,0xff,
0x00,0x00,0x3f,0x80,0x1f,0xff,0xff,0xfe,
};
#define FinPr_scan_width 64
#define FinPr_scan_height 64
const uint8_t PROGMEM FinPr_scan_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x1f,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x7f,0xff,0x00,0x00,0x00,
0x00,0x00,0x01,0xfc,0x7f,0xc0,0x00,0x00,
0x00,0x00,0x03,0xc0,0x03,0xe0,0x00,0x00,
0x00,0x00,0x07,0x80,0x00,0xf0,0x00,0x00,
0x00,0x00,0x0e,0x00,0x00,0x3c,0x00,0x00,
0x00,0x00,0x1c,0x1f,0xfc,0x1c,0x00,0x00,
0x00,0x00,0x38,0x7f,0xfe,0x0e,0x00,0x00,
0x00,0x00,0x78,0xf8,0x0f,0x87,0x00,0x00,
0x00,0x00,0x71,0xe0,0x03,0xc7,0x00,0x00,
0x00,0x00,0xe3,0x80,0x01,0xc3,0x80,0x00,
0x00,0x00,0xc3,0x83,0xc0,0xe3,0x80,0x00,
0x00,0x00,0xc7,0x0f,0xf0,0x71,0x80,0x00,
0x00,0x00,0x06,0x1f,0xf8,0x71,0xc0,0x00,
0x00,0x00,0x0e,0x1c,0x3c,0x31,0xc0,0x00,
0x00,0x00,0x1c,0x38,0x1c,0x31,0xc0,0x00,
0x00,0x00,0x38,0x70,0x0e,0x39,0xc0,0x00,
0x00,0x01,0xf0,0x71,0x8e,0x39,0xc0,0x00,
0x00,0x03,0xe0,0xe1,0x86,0x31,0xc0,0x00,
0x00,0x03,0x81,0xe3,0x8e,0x31,0x80,0x00,
0x00,0x00,0x03,0xc3,0x8e,0x33,0x80,0x00,
0x00,0x00,0x07,0x87,0x0c,0x73,0x80,0x00,
0x00,0x00,0x1f,0x0e,0x1c,0x73,0x80,0x00,
0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0xf0,0x1e,0x3e,0x1c,0x00,0x00,
0x00,0x03,0x80,0x7c,0x77,0x0f,0x00,0x00,
0x00,0x00,0x01,0xf0,0xe3,0x07,0xc0,0x00,
0x00,0x00,0x07,0xe3,0xc3,0x81,0xf0,0x00,
0x00,0x00,0x3f,0x87,0x81,0xc0,0x60,0x00,
0x00,0x01,0xfc,0x1f,0x00,0xf0,0x00,0x00,
0x00,0x01,0xe0,0x3c,0x00,0x7c,0x00,0x00,
0x00,0x00,0x00,0xf8,0x78,0x1f,0x00,0x00,
0x00,0x00,0x07,0xe0,0xfc,0x0f,0xc0,0x00,
0x00,0x00,0x3f,0x83,0xef,0x03,0xc0,0x00,
0x00,0x00,0xfc,0x0f,0x87,0x80,0x00,0x00,
0x00,0x00,0x70,0x1f,0x03,0xe0,0x00,0x00,
0x00,0x00,0x00,0x7c,0x00,0xf8,0x00,0x00,
0x00,0x00,0x01,0xf0,0x00,0x3e,0x00,0x00,
0x00,0x00,0x0f,0xc0,0xf8,0x0f,0x00,0x00,
0x00,0x00,0x1f,0x03,0xfe,0x02,0x00,0x00,
0x00,0x00,0x0c,0x0f,0x8f,0x80,0x00,0x00,
0x00,0x00,0x00,0x3f,0x03,0xe0,0x00,0x00,
0x00,0x00,0x00,0xf8,0x00,0xf0,0x00,0x00,
0x00,0x00,0x01,0xe0,0x00,0x30,0x00,0x00,
0x00,0x00,0x01,0xc0,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xfe,0x00,0x00,0x00,
0x00,0x00,0x00,0x0f,0x8e,0x00,0x00,0x00,
0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
//************************************************************************
void setup() {
Serial.begin(115200); // Initialize Serial communication
connectToWiFi(); // Call the function to connect to WiFi
delay(1000);
// Initialize OLED display
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Don't proceed, loop forever
}
// Display Adafruit logo (optional)
display.display();
delay(2000); // Pause for 2 seconds
display.clearDisplay();
// Initialize fingerprint sensor
finger.begin(57600);
Serial.println("\n\nAdafruit finger detect test");
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
display.clearDisplay();
display.drawBitmap(34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
display.display();
} else {
Serial.println("Did not find fingerprint sensor :(");
display.clearDisplay();
display.drawBitmap(32, 0, FinPr_failed_bits, FinPr_failed_width, FinPr_failed_height, WHITE);
display.display();
while (1) { delay(1); }
}
// Get template count
finger.getTemplateCount();
Serial.print("Sensor contains "); Serial.print(finger.templateCount); Serial.println(" templates");
Serial.println("Waiting for valid finger...");
// Timers
timer.setInterval(25000L, CheckMode);
t1 = timer.setInterval(10000L, ChecktoAddID); // Check for new fingerprints every 10 seconds
t2 = timer.setInterval(15000L, ChecktoDeleteID); // Check for IDs to delete every 15 seconds
CheckMode();
}
//************************************************************************
void loop() {
timer.run(); // Keep the timer running
if (!WiFi.isConnected()) {
if (millis() - previousMillis >= 10000) {
previousMillis = millis();
connectToWiFi(); // Retry to connect to Wi-Fi
}
}
CheckFingerprint(); // Check the sensor for a fingerprint
delay(10);
}
//************************************************************************
void connectToWiFi() {
Serial.println("Connecting to WiFi...");
WiFi.mode(WIFI_OFF); // Prevent reconnection issues
delay(1000);
WiFi.mode(WIFI_STA); // Set WiFi to station mode
WiFi.begin(ssid, password); // Start the connection
// Display connecting message on the OLED
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.print(F("Connecting to \n"));
display.setCursor(0, 50);
display.setTextSize(2);
display.print("Mangalappallil");
display.display();
// Wait for connection
uint32_t periodToConnect = 30000L; // 30 seconds timeout
for (uint32_t StartToConnect = millis(); (millis() - StartToConnect) < periodToConnect;) {
if (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
} else {
break;
}
}
if (WiFi.isConnected()) {
Serial.println("");
Serial.println("Connected");
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(8, 0);
display.print(F("Connected \n"));
display.drawBitmap(33, 15, Wifi_connected_bits, Wifi_connected_width, Wifi_connected_height, WHITE);
display.display();
Serial.print("IP address: ");
Serial.println(WiFi.localIP()); // Print the local IP address
} else {
Serial.println("");
Serial.println("Not Connected");
WiFi.mode(WIFI_OFF);
delay(1000);
}
delay(1000);
}
//************************************************************************
void CheckFingerprint() {
FingerID = getFingerprintID();
DisplayFingerprintID();
}
//////////////////////////////////////////////////////////////////////////
void CheckMode() {
Serial.println("Checking Mode");
if (WiFi.isConnected()) {
HTTPClient http; // Declare object of class HTTPClient
WiFiClient client; // Create a WiFiClient object
// GET Data
String getData = "?Check_mode=get_mode&device_token=" + String(device_token);
String Link = URL + getData;
// Initiate HTTP request
http.begin(client, Link);
int httpCode = http.GET(); // Send the request
String payload = http.getString(); // Get the response payload
if (payload.substring(0, 4) == "mode") {
String dev_mode = payload.substring(4);
int devMode = dev_mode.toInt();
if (!firstConnect) {
device_Mode = devMode;
firstConnect = true;
}
if (device_Mode && devMode) {
device_Mode = false;
timer.disable(t1);
timer.disable(t2);
Serial.println("Device Mode: Attendance");
} else if (!device_Mode && !devMode) {
device_Mode = true;
timer.enable(t1);
timer.enable(t2);
Serial.println("Device Mode: Enrollment");
}
}
http.end(); // Close connection
}
}
//Display the fingerprint ID state on the OLED*
void DisplayFingerprintID() {
if (FingerID > 0) {
display.clearDisplay();
display.drawBitmap(34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
display.display();
SendFingerprintID(FingerID); // Send the Fingerprint ID to the website.
delay(2000);
} else if (FingerID == 0) {
display.clearDisplay();
display.drawBitmap(32, 0, FinPr_start_bits, FinPr_start_width, FinPr_start_height, WHITE);
display.display();
} else if (FingerID == -1) {
display.clearDisplay();
display.drawBitmap(34, 0, FinPr_invalid_bits, FinPr_invalid_width, FinPr_invalid_height, WHITE);
display.display();
} else if (FingerID == -2) {
display.clearDisplay();
display.drawBitmap(32, 0, FinPr_failed_bits, FinPr_failed_width, FinPr_failed_height, WHITE);
display.display();
}
}
//send the fingerprint ID to the website*
void SendFingerprintID(int finger) {
Serial.println("Sending the Fingerprint ID");
if (WiFi.isConnected()) {
HTTPClient http; // Declare object of class HTTPClient
WiFiClient client; // Create a WiFiClient object
char getData[100];
snprintf(getData, sizeof(getData), "?FingerID=%d&device_token=%s", finger, device_token);
// Use the WiFiClient object with the begin method
http.begin(client, Link); // Initiate HTTP request
int httpCode = http.GET(); // Send the request
String payload = http.getString(); // Get the response payload
Serial.println(httpCode); // Print HTTP return code
Serial.println(payload); // Print request response payload
Serial.println(finger); // Print fingerprint ID
if (payload.substring(0, 5) == "login") {
String user_name = payload.substring(5);
display.clearDisplay();
display.setTextSize(2); // Normal 2:2 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(15, 0); // Start at top-left corner
display.print(F("Welcome"));
display.setCursor(0, 20);
display.print(user_name);
display.display();
} else if (payload.substring(0, 6) == "logout") {
String user_name = payload.substring(6);
display.clearDisplay();
display.setTextSize(2); // Normal 2:2 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(10, 0); // Start at top-left corner
display.print(F("Good Bye"));
display.setCursor(0, 20);
display.print(user_name);
display.display();
}
delay(10);
http.end(); // Close connection
}
}
//**Get the Fingerprint ID
uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
break;
case FINGERPRINT_NOFINGER:
return 0;
case FINGERPRINT_PACKETRECIEVEERR:
return -2;
case FINGERPRINT_IMAGEFAIL:
return -2;
default:
return -2;
}
p = finger.image2Tz();
switch (p) {
case FINGERPRINT_OK:
break;
case FINGERPRINT_IMAGEMESS:
return -1;
case FINGERPRINT_PACKETRECIEVEERR:
return -2;
case FINGERPRINT_FEATUREFAIL:
return -2;
case FINGERPRINT_INVALIDIMAGE:
return -2;
default:
return -2;
}
p = finger.fingerFastSearch();
if (p == FINGERPRINT_OK) {
Serial.print("Found ID #"); Serial.print(finger.fingerID);
Serial.print(" with confidence of "); Serial.println(finger.confidence);
return finger.fingerID;
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
return -2;
} else if (p == FINGERPRINT_NOTFOUND) {
return -1;
} else {
return -2;
}
}
//Check if there a Fingerprint ID to delete
void ChecktoDeleteID() {
Serial.println("Check to Delete ID");
if (WiFi.isConnected()) {
HTTPClient http; // Declare object of class HTTPClient
WiFiClient client; // Create a WiFiClient object
// GET Data
String getData = "?DeleteID=check&device_token=" + String(device_token);
String Link = URL + getData; // Ensure Link is defined as a String
// Correct usage of http.begin()
http.begin(client, Link); // Initiate HTTP request with Link
int httpCode = http.GET(); // Send the request
String payload = http.getString(); // Get the response payload
if (payload.substring(0, 6) == "del-id") {
String del_id = payload.substring(6);
Serial.println(del_id);
http.end(); // Close connection
deleteFingerprint(del_id.toInt());
delay(1000);
}
http.end(); // Close connection
}
}
//*Delete Fingerprint ID
uint8_t deleteFingerprint(int id) {
uint8_t p = -1;
p = finger.deleteModel(id);
if (p == FINGERPRINT_OK) {
display.clearDisplay();
display.setTextSize(2); // Normal 2:2 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.print(F("Deleted!\n"));
display.display();
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
display.clearDisplay();
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.print(F("Communication error!\n"));
display.display();
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
display.clearDisplay();
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.print(F("Could not delete in that location!\n"));
display.display();
return p;
} else if (p == FINGERPRINT_FLASHERR) {
display.clearDisplay();
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.print(F("Error writing to flash!\n"));
display.display();
return p;
} else {
display.clearDisplay();
display.setTextSize(2); // Normal 2:2 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.print(F("Unknown error:\n"));
display.display();
return p;
}
return p;
}
//Check if there a Fingerprint ID to add
void ChecktoAddID() {
if (WiFi.isConnected()) {
HTTPClient http; // Declare object of class HTTPClient
WiFiClient client; // Create a WiFiClient object
// GET Data
String getData = "?Get_Fingerid=get_id&device_token=" + String(device_token);
String Link = URL + getData;
// Correct usage of http.begin()
http.begin(client, Link); // Initiate HTTP request
int httpCode = http.GET(); // Send the request
String payload = http.getString(); // Get the response payload
if (payload.substring(0, 6) == "add-id") {
String add_id = payload.substring(6);
Serial.println("Add ID: " + add_id);
int id = add_id.toInt();
http.end(); // Close connection
// Call the function to enroll the fingerprint
// getFingerprintEnroll(id);
}
http.end(); // Close connection
}