Prep AS608/R503 FIngerprint sensor support

This commit is contained in:
Theo Arends 2020-11-10 15:04:45 +01:00
parent 3e2f5e3c69
commit 3334fe58ed
67 changed files with 1402 additions and 4 deletions

View File

@ -0,0 +1,369 @@
/***************************************************
This is a library for our optical Fingerprint sensor
Designed specifically to work with the Adafruit Fingerprint sensor
----> 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"
#include <TasmotaSerial.h>
//#define FINGERPRINT_DEBUG
#if ARDUINO >= 100
#define SERIAL_WRITE(...) mySerial->write(__VA_ARGS__)
#else
#define SERIAL_WRITE(...) mySerial->write(__VA_ARGS__, BYTE)
#endif
#define SERIAL_WRITE_U16(v) SERIAL_WRITE((uint8_t)(v>>8)); SERIAL_WRITE((uint8_t)(v & 0xFF));
#define GET_CMD_PACKET(...) \
uint8_t data[] = {__VA_ARGS__}; \
Adafruit_Fingerprint_Packet packet(FINGERPRINT_COMMANDPACKET, sizeof(data), data); \
writeStructuredPacket(packet); \
if (getStructuredPacket(&packet) != FINGERPRINT_OK) return FINGERPRINT_PACKETRECIEVEERR; \
if (packet.type != FINGERPRINT_ACKPACKET) return FINGERPRINT_PACKETRECIEVEERR;
#define SEND_CMD_PACKET(...) GET_CMD_PACKET(__VA_ARGS__); return packet.data[0];
/***************************************************************************
PUBLIC FUNCTIONS
***************************************************************************/
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
/**************************************************************************/
/*!
@brief Instantiates sensor with Software Serial
@param ss Pointer to SoftwareSerial object
@param password 32-bit integer password (default is 0)
*/
/**************************************************************************/
Adafruit_Fingerprint::Adafruit_Fingerprint(TasmotaSerial *ss, uint32_t password) {
thePassword = password;
theAddress = 0xFFFFFFFF;
hwSerial = NULL;
swSerial = ss;
mySerial = swSerial;
}
#endif
/**************************************************************************/
/*!
@brief Instantiates sensor with Hardware Serial
@param hs Pointer to HardwareSerial object
@param password 32-bit integer password (default is 0)
*/
/**************************************************************************/
Adafruit_Fingerprint::Adafruit_Fingerprint(HardwareSerial *hs, uint32_t password) {
thePassword = password;
theAddress = 0xFFFFFFFF;
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
swSerial = NULL;
#endif
hwSerial = hs;
mySerial = hwSerial;
}
/**************************************************************************/
/*!
@brief Initializes serial interface and baud rate
@param baudrate Sensor's UART baud rate (usually 57600, 9600 or 115200)
*/
/**************************************************************************/
void Adafruit_Fingerprint::begin(uint32_t baudrate) {
delay(1000); // one second delay to let the sensor 'boot up'
if (hwSerial) hwSerial->begin(baudrate);
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
if (swSerial) swSerial->begin(baudrate);
#endif
}
/**************************************************************************/
/*!
@brief Verifies the sensors' access password (default password is 0x0000000). A good way to also check if the sensors is active and responding
@returns True if password is correct
*/
/**************************************************************************/
boolean Adafruit_Fingerprint::verifyPassword(void) {
return checkPassword() == FINGERPRINT_OK;
}
uint8_t Adafruit_Fingerprint::checkPassword(void) {
GET_CMD_PACKET(FINGERPRINT_VERIFYPASSWORD,
(uint8_t)(thePassword >> 24), (uint8_t)(thePassword >> 16),
(uint8_t)(thePassword >> 8), (uint8_t)(thePassword & 0xFF));
if (packet.data[0] == FINGERPRINT_OK)
return FINGERPRINT_OK;
else
return FINGERPRINT_PACKETRECIEVEERR;
}
/**************************************************************************/
/*!
@brief Ask the sensor to take an image of the finger pressed on surface
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_NOFINGER</code> if no finger detected
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
@returns <code>FINGERPRINT_IMAGEFAIL</code> on imaging error
*/
/**************************************************************************/
uint8_t Adafruit_Fingerprint::getImage(void) {
SEND_CMD_PACKET(FINGERPRINT_GETIMAGE);
}
/**************************************************************************/
/*!
@brief Ask the sensor to convert image to feature template
@param slot Location to place feature template (put one in 1 and another in 2 for verification to create model)
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_IMAGEMESS</code> if image is too messy
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
@returns <code>FINGERPRINT_FEATUREFAIL</code> on failure to identify fingerprint features
@returns <code>FINGERPRINT_INVALIDIMAGE</code> on failure to identify fingerprint features
*/
uint8_t Adafruit_Fingerprint::image2Tz(uint8_t slot) {
SEND_CMD_PACKET(FINGERPRINT_IMAGE2TZ,slot);
}
/**************************************************************************/
/*!
@brief Ask the sensor to take two print feature template and create a model
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
@returns <code>FINGERPRINT_ENROLLMISMATCH</code> on mismatch of fingerprints
*/
uint8_t Adafruit_Fingerprint::createModel(void) {
SEND_CMD_PACKET(FINGERPRINT_REGMODEL);
}
/**************************************************************************/
/*!
@brief Ask the sensor to store the calculated model for later matching
@param location The model location #
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_BADLOCATION</code> if the location is invalid
@returns <code>FINGERPRINT_FLASHERR</code> if the model couldn't be written to flash memory
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
uint8_t Adafruit_Fingerprint::storeModel(uint16_t location) {
SEND_CMD_PACKET(FINGERPRINT_STORE, 0x01, (uint8_t)(location >> 8), (uint8_t)(location & 0xFF));
}
/**************************************************************************/
/*!
@brief Ask the sensor to load a fingerprint model from flash into buffer 1
@param location The model location #
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_BADLOCATION</code> if the location is invalid
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
uint8_t Adafruit_Fingerprint::loadModel(uint16_t location) {
SEND_CMD_PACKET(FINGERPRINT_LOAD, 0x01, (uint8_t)(location >> 8), (uint8_t)(location & 0xFF));
}
/**************************************************************************/
/*!
@brief Ask the sensor to transfer 256-byte fingerprint template from the buffer to the UART
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
uint8_t Adafruit_Fingerprint::getModel(void) {
SEND_CMD_PACKET(FINGERPRINT_UPLOAD, 0x01);
}
/**************************************************************************/
/*!
@brief Ask the sensor to delete a model in memory
@param location The model location #
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_BADLOCATION</code> if the location is invalid
@returns <code>FINGERPRINT_FLASHERR</code> if the model couldn't be written to flash memory
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
uint8_t Adafruit_Fingerprint::deleteModel(uint16_t location) {
SEND_CMD_PACKET(FINGERPRINT_DELETE, (uint8_t)(location >> 8), (uint8_t)(location & 0xFF), 0x00, 0x01);
}
/**************************************************************************/
/*!
@brief Ask the sensor to delete ALL models in memory
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_BADLOCATION</code> if the location is invalid
@returns <code>FINGERPRINT_FLASHERR</code> if the model couldn't be written to flash memory
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
uint8_t Adafruit_Fingerprint::emptyDatabase(void) {
SEND_CMD_PACKET(FINGERPRINT_EMPTY);
}
/**************************************************************************/
/*!
@brief Ask the sensor to search the current slot 1 fingerprint features to match saved templates. The matching location is stored in <b>fingerID</b> and the matching confidence in <b>confidence</b>
@returns <code>FINGERPRINT_OK</code> on fingerprint match success
@returns <code>FINGERPRINT_NOTFOUND</code> no match made
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
/**************************************************************************/
uint8_t Adafruit_Fingerprint::fingerFastSearch(void) {
// high speed search of slot #1 starting at page 0x0000 and page #0x00A3
GET_CMD_PACKET(FINGERPRINT_HISPEEDSEARCH, 0x01, 0x00, 0x00, 0x00, 0xA3);
fingerID = 0xFFFF;
confidence = 0xFFFF;
fingerID = packet.data[1];
fingerID <<= 8;
fingerID |= packet.data[2];
confidence = packet.data[3];
confidence <<= 8;
confidence |= packet.data[4];
return packet.data[0];
}
/**************************************************************************/
/*!
@brief Ask the sensor for the number of templates stored in memory. The number is stored in <b>templateCount</b> on success.
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
/**************************************************************************/
uint8_t Adafruit_Fingerprint::getTemplateCount(void) {
GET_CMD_PACKET(FINGERPRINT_TEMPLATECOUNT);
templateCount = packet.data[1];
templateCount <<= 8;
templateCount |= packet.data[2];
return packet.data[0];
}
/**************************************************************************/
/*!
@brief Set the password on the sensor (future communication will require password verification so don't forget it!!!)
@param password 32-bit password code
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
/**************************************************************************/
uint8_t Adafruit_Fingerprint::setPassword(uint32_t password) {
SEND_CMD_PACKET(FINGERPRINT_SETPASSWORD, (password >> 24), (password >> 16), (password >> 8), password);
}
/**************************************************************************/
/*!
@brief Helper function to process a packet and send it over UART to the sensor
@param packet A structure containing the bytes to transmit
*/
/**************************************************************************/
void Adafruit_Fingerprint::writeStructuredPacket(const Adafruit_Fingerprint_Packet & packet) {
SERIAL_WRITE_U16(packet.start_code);
SERIAL_WRITE(packet.address[0]);
SERIAL_WRITE(packet.address[1]);
SERIAL_WRITE(packet.address[2]);
SERIAL_WRITE(packet.address[3]);
SERIAL_WRITE(packet.type);
uint16_t wire_length = packet.length + 2;
SERIAL_WRITE_U16(wire_length);
uint16_t sum = ((wire_length)>>8) + ((wire_length)&0xFF) + packet.type;
for (uint8_t i=0; i< packet.length; i++) {
SERIAL_WRITE(packet.data[i]);
sum += packet.data[i];
}
SERIAL_WRITE_U16(sum);
return;
}
/**************************************************************************/
/*!
@brief Helper function to receive data over UART from the sensor and process it into a packet
@param packet A structure containing the bytes received
@param timeout how many milliseconds we're willing to wait
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_TIMEOUT</code> or <code>FINGERPRINT_BADPACKET</code> on failure
*/
/**************************************************************************/
uint8_t Adafruit_Fingerprint::getStructuredPacket(Adafruit_Fingerprint_Packet * packet, uint16_t timeout) {
uint8_t byte;
uint16_t idx=0, timer=0;
while(true) {
while(!mySerial->available()) {
delay(1);
timer++;
if( timer >= timeout) {
#ifdef FINGERPRINT_DEBUG
//snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_DEBUG " Time out"));
//AddLog(LOG_LEVEL_INFO);
#endif
return FINGERPRINT_TIMEOUT;
}
}
byte = mySerial->read();
//mydata[0] = idx;
mydata[idx] = byte;
#ifdef FINGERPRINT_DEBUG
//Serial.print("<- 0x"); Serial.println(byte, HEX);
//snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_DEBUG "<- 0x%x", byte));
//AddLog(LOG_LEVEL_INFO);
#endif
switch (idx) {
case 0:
if (byte != (FINGERPRINT_STARTCODE >> 8))
continue;
packet->start_code = (uint16_t)byte << 8;
break;
case 1:
packet->start_code |= byte;
if (packet->start_code != FINGERPRINT_STARTCODE)
return FINGERPRINT_BADPACKET;
break;
case 2:
case 3:
case 4:
case 5:
packet->address[idx-2] = byte;
break;
case 6:
packet->type = byte;
break;
case 7:
packet->length = (uint16_t)byte << 8;
break;
case 8:
packet->length |= byte;
break;
default:
packet->data[idx-9] = byte;
if((idx-8) == packet->length)
return FINGERPRINT_OK;
break;
}
idx++;
}
// Shouldn't get here so...
return FINGERPRINT_BADPACKET;
}

View File

@ -0,0 +1,157 @@
#ifndef ADAFRUIT_FINGERPRINT_H
#define ADAFRUIT_FINGERPRINT_H
/***************************************************
This is a library for our optical Fingerprint sensor
Designed specifically to work with the Adafruit Fingerprint sensor
----> 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 "Arduino.h"
#if defined(__AVR__) || defined(ESP8266)
//#include <SoftwareSerial.h>
#include <TasmotaSerial.h>
#elif defined(FREEDOM_E300_HIFIVE1)
#include <SoftwareSerial32.h>
#define SoftwareSerial SoftwareSerial32
#endif
#define FINGERPRINT_OK 0x00
#define FINGERPRINT_PACKETRECIEVEERR 0x01
#define FINGERPRINT_NOFINGER 0x02
#define FINGERPRINT_IMAGEFAIL 0x03
#define FINGERPRINT_IMAGEMESS 0x06
#define FINGERPRINT_FEATUREFAIL 0x07
#define FINGERPRINT_NOMATCH 0x08
#define FINGERPRINT_NOTFOUND 0x09
#define FINGERPRINT_ENROLLMISMATCH 0x0A
#define FINGERPRINT_BADLOCATION 0x0B
#define FINGERPRINT_DBRANGEFAIL 0x0C
#define FINGERPRINT_UPLOADFEATUREFAIL 0x0D
#define FINGERPRINT_PACKETRESPONSEFAIL 0x0E
#define FINGERPRINT_UPLOADFAIL 0x0F
#define FINGERPRINT_DELETEFAIL 0x10
#define FINGERPRINT_DBCLEARFAIL 0x11
#define FINGERPRINT_PASSFAIL 0x13
#define FINGERPRINT_INVALIDIMAGE 0x15
#define FINGERPRINT_FLASHERR 0x18
#define FINGERPRINT_INVALIDREG 0x1A
#define FINGERPRINT_ADDRCODE 0x20
#define FINGERPRINT_PASSVERIFY 0x21
#define FINGERPRINT_STARTCODE 0xEF01
#define FINGERPRINT_COMMANDPACKET 0x1
#define FINGERPRINT_DATAPACKET 0x2
#define FINGERPRINT_ACKPACKET 0x7
#define FINGERPRINT_ENDDATAPACKET 0x8
#define FINGERPRINT_TIMEOUT 0xFF
#define FINGERPRINT_BADPACKET 0xFE
#define FINGERPRINT_GETIMAGE 0x01
#define FINGERPRINT_IMAGE2TZ 0x02
#define FINGERPRINT_REGMODEL 0x05
#define FINGERPRINT_STORE 0x06
#define FINGERPRINT_LOAD 0x07
#define FINGERPRINT_UPLOAD 0x08
#define FINGERPRINT_DELETE 0x0C
#define FINGERPRINT_EMPTY 0x0D
#define FINGERPRINT_SETPASSWORD 0x12
#define FINGERPRINT_VERIFYPASSWORD 0x13
#define FINGERPRINT_HISPEEDSEARCH 0x1B
#define FINGERPRINT_TEMPLATECOUNT 0x1D
//#define FINGERPRINT_DEBUG
#define DEFAULTTIMEOUT 1000 ///< UART reading timeout in milliseconds
///! Helper class to craft UART packets
struct Adafruit_Fingerprint_Packet {
/**************************************************************************/
/*!
@brief Create a new UART-borne packet
@param type Command, data, ack type packet
@param length Size of payload
@param data Pointer to bytes of size length we will memcopy into the internal buffer
*/
/**************************************************************************/
Adafruit_Fingerprint_Packet(uint8_t type, uint16_t length, uint8_t * data) {
this->start_code = FINGERPRINT_STARTCODE;
this->type = type;
this->length = length;
address[0] = 0xFF; address[1] = 0xFF;
address[2] = 0xFF; address[3] = 0xFF;
if(length<64)
memcpy(this->data, data, length);
else
memcpy(this->data, data, 64);
}
uint16_t start_code; ///< "Wakeup" code for packet detection
uint8_t address[4]; ///< 32-bit Fingerprint sensor address
uint8_t type; ///< Type of packet
uint16_t length; ///< Length of packet
uint8_t data[64]; ///< The raw buffer for packet payload
};
///! Helper class to communicate with and keep state for fingerprint sensors
class Adafruit_Fingerprint {
public:
uint8_t mydata[100];
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
Adafruit_Fingerprint(TasmotaSerial *ss, uint32_t password = 0x0);
#endif
Adafruit_Fingerprint(HardwareSerial *hs, uint32_t password = 0x0);
void begin(uint32_t baud);
boolean verifyPassword(void);
uint8_t getImage(void);
uint8_t image2Tz(uint8_t slot = 1);
uint8_t createModel(void);
uint8_t emptyDatabase(void);
uint8_t storeModel(uint16_t id);
uint8_t loadModel(uint16_t id);
uint8_t getModel(void);
uint8_t deleteModel(uint16_t id);
uint8_t fingerFastSearch(void);
uint8_t getTemplateCount(void);
uint8_t setPassword(uint32_t password);
void writeStructuredPacket(const Adafruit_Fingerprint_Packet & p);
uint8_t getStructuredPacket(Adafruit_Fingerprint_Packet * p, uint16_t timeout=DEFAULTTIMEOUT);
/// The matching location that is set by fingerFastSearch()
uint16_t fingerID;
/// The confidence of the fingerFastSearch() match, higher numbers are more confidents
uint16_t confidence;
/// The number of stored templates in the sensor, set by getTemplateCount()
uint16_t templateCount;
private:
uint8_t checkPassword(void);
uint32_t thePassword;
uint32_t theAddress;
uint8_t recvPacket[20];
Stream *mySerial;
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
TasmotaSerial *swSerial;
#endif
HardwareSerial *hwSerial;
};
#endif

View File

@ -0,0 +1,19 @@
# Adafruit Fingerprint Sensor Library [![Build Status](https://travis-ci.org/adafruit/Adafruit-Fingerprint-Sensor-Library.svg?branch=master)](https://travis-ci.org/adafruit/Adafruit-Fingerprint-Sensor-Library)
<img src="https://cdn-shop.adafruit.com/970x728/751-03.jpg" height="300"/>
Secure your project with biometrics - this all-in-one optical fingerprint sensor will make adding fingerprint detection and verification super simple. These modules are typically used in safes - there's a high powered DSP chip that does the image rendering, calculation, feature-finding and searching. Connect to any microcontroller or system with TTL serial, and send packets of data to take photos, detect prints, hash and search. You can also enroll new fingers directly - up to 162 finger prints can be stored in the onboard FLASH memory. There's a red LED in the lens that lights up during a photo so you know its working.
Designed specifically to work with the Adafruit Fingerprint sensor
* http://www.adafruit.com/products/751
Pick one up today in the adafruit shop!
These sensors 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, check license.txt for more information
All text above must be included in any redistribution

View File

@ -0,0 +1,7 @@
The file ZFM-20_Fingerprint_Module.pdf is an automatic translation of the original Chinese datasheet, as performed by Google Translate. We provide it as a courtesy only, and have not reviewed the translation for accuracy or completeness.
Original datasheet available here:
http://www.adafruit.com/datasheets/DY001fingerprint.pdf
-------
R.D. Lesniak, Oct. 31, 2012

View File

@ -0,0 +1,21 @@
//Leo_passthru
// Allows Leonardo to pass serial data between fingerprint reader and Windows.
//
// Red connects to +5V
// Black connects to Ground
// Green goes to Digital 0
// White goes to Digital 1
void setup() {
// put your setup code here, to run once:
Serial1.begin(57600);
Serial.begin(57600);
}
void loop() {
while (Serial.available())
Serial1.write(Serial.read());
while (Serial1.available())
Serial.write(Serial1.read());
}

View File

@ -0,0 +1,11 @@
// this sketch will allow you to bypass the Atmega chip
// and connect the fingerprint sensor directly to the USB/Serial
// chip converter.
// Red connects to +5V
// Black connects to Ground
// White goes to Digital 0
// Green goes to Digital 1
void setup() {}
void loop() {}

View File

@ -0,0 +1,62 @@
/***************************************************
This is an example sketch for our optical Fingerprint sensor
Designed specifically to work with the Adafruit Fingerprint sensor
----> 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>
// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
// #define mySerial Serial1
// 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)
// comment these two lines if using hardware serial
SoftwareSerial mySerial(2, 3);
// Using sensor without password
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
// Using sensor with password
//Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial, 1337);
void setup()
{
while (!Serial); // For Yun/Leo/Micro/Zero/...
Serial.begin(9600);
Serial.println("Adafruit fingerprint sensor, change password example");
// set the data rate for the sensor serial port
finger.begin(19200);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
Serial.println("Did not find fingerprint sensor :(");
while (1);
}
Serial.print("Set password... ");
uint8_t p = finger.setPassword(1337);
if (p == FINGERPRINT_OK) {
Serial.println("OK"); // Password is set
} else {
Serial.println("ERROR"); // Failed to set password
}
}
void loop()
{
}

View File

@ -0,0 +1,94 @@
/***************************************************
This is an example sketch for our optical Fingerprint sensor
Designed specifically to work with the Adafruit Fingerprint sensor
----> 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>
// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
// #define mySerial Serial1
// 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)
// comment these two lines if using hardware serial
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
Serial.begin(9600);
while (!Serial); // For Yun/Leo/Micro/Zero/...
delay(100);
Serial.println("\n\nDelete Finger");
// set the data rate for the sensor serial port
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
Serial.println("Did not find fingerprint sensor :(");
while (1);
}
}
uint8_t readnumber(void) {
uint8_t num = 0;
while (num == 0) {
while (! Serial.available());
num = Serial.parseInt();
}
return num;
}
void loop() // run over and over again
{
Serial.println("Please type in the ID # (from 1 to 127) you want to delete...");
uint8_t id = readnumber();
if (id == 0) {// ID #0 not allowed, try again!
return;
}
Serial.print("Deleting ID #");
Serial.println(id);
deleteFingerprint(id);
}
uint8_t deleteFingerprint(uint8_t id) {
uint8_t p = -1;
p = finger.deleteModel(id);
if (p == FINGERPRINT_OK) {
Serial.println("Deleted!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
Serial.println("Could not delete in that location");
return p;
} else if (p == FINGERPRINT_FLASHERR) {
Serial.println("Error writing to flash");
return p;
} else {
Serial.print("Unknown error: 0x"); Serial.println(p, HEX);
return p;
}
}

View File

@ -0,0 +1,60 @@
/***************************************************
This is an example sketch for our optical Fingerprint sensor
Designed specifically to work with the Adafruit Fingerprint sensor
----> 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>
// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
// #define mySerial Serial1
// 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)
// comment these two lines if using hardware serial
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
Serial.begin(9600);
while (!Serial); // For Yun/Leo/Micro/Zero/...
delay(100);
Serial.println("\n\nDeleting all fingerprint templates!");
Serial.println("Press 'Y' key to continue");
while (1) {
if (Serial.available() && (Serial.read() == 'Y')) {
break;
}
}
// set the data rate for the sensor serial port
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
Serial.println("Did not find fingerprint sensor :(");
while (1);
}
finger.emptyDatabase();
Serial.println("Now database is empty :)");
}
void loop() {
}

View File

@ -0,0 +1,212 @@
/***************************************************
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>
// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
// #define mySerial Serial1
// 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)
// comment these two lines if using hardware serial
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
uint8_t id;
void setup()
{
Serial.begin(9600);
while (!Serial); // For Yun/Leo/Micro/Zero/...
delay(100);
Serial.println("\n\nAdafruit Fingerprint sensor enrollment");
// set the data rate for the sensor serial port
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
Serial.println("Did not find fingerprint sensor :(");
while (1) { delay(1); }
}
}
uint8_t readnumber(void) {
uint8_t num = 0;
while (num == 0) {
while (! Serial.available());
num = Serial.parseInt();
}
return num;
}
void loop() // run over and over again
{
Serial.println("Ready to enroll a fingerprint!");
Serial.println("Please type in the ID # (from 1 to 127) you want to save this finger as...");
id = readnumber();
if (id == 0) {// ID #0 not allowed, try again!
return;
}
Serial.print("Enrolling ID #");
Serial.println(id);
while (! getFingerprintEnroll() );
}
uint8_t getFingerprintEnroll() {
int p = -1;
Serial.print("Waiting for valid finger to enroll as #"); Serial.println(id);
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image taken");
break;
case FINGERPRINT_NOFINGER:
Serial.println(".");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println("Imaging error");
break;
default:
Serial.println("Unknown error");
break;
}
}
// OK success!
p = finger.image2Tz(1);
switch (p) {
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;
}
Serial.println("Remove finger");
delay(2000);
p = 0;
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
}
Serial.print("ID "); Serial.println(id);
p = -1;
Serial.println("Place same finger again");
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image taken");
break;
case FINGERPRINT_NOFINGER:
Serial.print(".");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println("Imaging error");
break;
default:
Serial.println("Unknown error");
break;
}
}
// OK success!
p = finger.image2Tz(2);
switch (p) {
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!
Serial.print("Creating model for #"); Serial.println(id);
p = finger.createModel();
if (p == FINGERPRINT_OK) {
Serial.println("Prints matched!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_ENROLLMISMATCH) {
Serial.println("Fingerprints did not match");
return p;
} else {
Serial.println("Unknown error");
return p;
}
Serial.print("ID "); Serial.println(id);
p = finger.storeModel(id);
if (p == FINGERPRINT_OK) {
Serial.println("Stored!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
Serial.println("Could not store in that location");
return p;
} else if (p == FINGERPRINT_FLASHERR) {
Serial.println("Error writing to flash");
return p;
} else {
Serial.println("Unknown error");
return p;
}
}

View File

@ -0,0 +1,141 @@
/***************************************************
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>
// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
// #define mySerial Serial1
// 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)
// comment these two lines if using hardware serial
SoftwareSerial mySerial(2, 3);
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);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
Serial.println("Did not find fingerprint sensor :(");
while (1) { delay(1); }
}
finger.getTemplateCount();
Serial.print("Sensor contains "); Serial.print(finger.templateCount); Serial.println(" templates");
Serial.println("Waiting for valid finger...");
}
void loop() // run over and over again
{
getFingerprintIDez();
delay(50); //don't ned to run this at full speed.
}
uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
switch (p) {
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 (p) {
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.fingerFastSearch();
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;
}

View File

@ -0,0 +1,156 @@
/***************************************************
This is an example sketch for our optical Fingerprint sensor
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>
int getFingerprintIDez();
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
while(!Serial);
Serial.begin(9600);
Serial.println("Fingerprint template extractor");
// set the data rate for the sensor serial port
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
Serial.println("Did not find fingerprint sensor :(");
while (1);
}
// Try to get the templates for fingers 1 through 10
for (int finger = 1; finger < 10; finger++) {
downloadFingerprintTemplate(finger);
}
}
uint8_t downloadFingerprintTemplate(uint16_t id)
{
Serial.println("------------------------------------");
Serial.print("Attempting to load #"); Serial.println(id);
uint8_t p = finger.loadModel(id);
switch (p) {
case FINGERPRINT_OK:
Serial.print("Template "); Serial.print(id); Serial.println(" loaded");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
return p;
default:
Serial.print("Unknown error "); Serial.println(p);
return p;
}
// OK success!
Serial.print("Attempting to get #"); Serial.println(id);
p = finger.getModel();
switch (p) {
case FINGERPRINT_OK:
Serial.print("Template "); Serial.print(id); Serial.println(" transferring:");
break;
default:
Serial.print("Unknown error "); Serial.println(p);
return p;
}
// one data packet is 267 bytes. in one data packet, 11 bytes are 'usesless' :D
uint8_t bytesReceived[534]; // 2 data packets
memset(bytesReceived, 0xff, 534);
uint32_t starttime = millis();
int i = 0;
while (i < 534 && (millis() - starttime) < 20000) {
if (mySerial.available()) {
bytesReceived[i++] = mySerial.read();
}
}
Serial.print(i); Serial.println(" bytes read.");
Serial.println("Decoding packet...");
uint8_t fingerTemplate[512]; // the real template
memset(fingerTemplate, 0xff, 512);
// filtering only the data packets
int uindx = 9, index = 0;
while (index < 534) {
while (index < uindx) ++index;
uindx += 256;
while (index < uindx) {
fingerTemplate[index++] = bytesReceived[index];
}
uindx += 2;
while (index < uindx) ++index;
uindx = index + 9;
}
for (int i = 0; i < 512; ++i) {
//Serial.print("0x");
printHex(fingerTemplate[i], 2);
//Serial.print(", ");
}
Serial.println("\ndone.");
/*
uint8_t templateBuffer[256];
memset(templateBuffer, 0xff, 256); //zero out template buffer
int index=0;
uint32_t starttime = millis();
while ((index < 256) && ((millis() - starttime) < 1000))
{
if (mySerial.available())
{
templateBuffer[index] = mySerial.read();
index++;
}
}
Serial.print(index); Serial.println(" bytes read");
//dump entire templateBuffer. This prints out 16 lines of 16 bytes
for (int count= 0; count < 16; count++)
{
for (int i = 0; i < 16; i++)
{
Serial.print("0x");
Serial.print(templateBuffer[count*16+i], HEX);
Serial.print(", ");
}
Serial.println();
}*/
}
void printHex(int num, int precision) {
char tmp[16];
char format[128];
sprintf(format, "%%.%dX", precision);
sprintf(tmp, format, num);
Serial.print(tmp);
}
void loop()
{}

View File

@ -0,0 +1,9 @@
name=Adafruit Fingerprint Sensor Library
version=1.1.2
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Arduino library for interfacing to the fingerprint sensor in the Adafruit shop
paragraph=Arduino library for interfacing to the fingerprint sensor in the Adafruit shop
category=Sensors
url=https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library
architectures=*

View File

@ -0,0 +1,26 @@
Software License Agreement (BSD License)
Copyright (c) 2012, Adafruit Industries
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -669,6 +669,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 TX"
#define D_SENSOR_DDS2382_RX "DDS238-2 RX"
#define D_SENSOR_DDSU666_TX "DDSU666 TX"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 - MS1"
#define D_SENSOR_OUTPUT_HI "Output - Hi"
#define D_SENSOR_OUTPUT_LO "Output - Lo"
#define D_SENSOR_AS608_TX "AS608 - TX"
#define D_SENSOR_AS608_RX "AS608 - RX"
#define D_SENSOR_DDS2382_TX "DDS238-2 - TX"
#define D_SENSOR_DDS2382_RX "DDS238-2 - RX"
#define D_SENSOR_DDSU666_TX "DDSU666 - TX"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -673,6 +673,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_OUTPUT_HI "Output Hi"
#define D_SENSOR_OUTPUT_LO "Output Lo"
#define D_SENSOR_AS608_TX "AS608 Tx"
#define D_SENSOR_AS608_RX "AS608 Rx"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"
#define D_SENSOR_DDSU666_TX "DDSU666 Tx"

View File

@ -658,7 +658,9 @@ void ResponseAppendFeatures(void)
#if defined(USE_I2C) && defined(USE_EZOPMP)
feature7 |= 0x00000400; // xsns_78_ezopmp.ino
#endif
// feature7 |= 0x00000800;
#ifdef USE_AS608
feature7 |= 0x00000800; // xsns_79_as608.ino
#endif
// feature7 |= 0x00001000;
// feature7 |= 0x00002000;

View File

@ -148,6 +148,7 @@ enum UserSelectablePins {
GPIO_DYP_RX,
GPIO_MIEL_HVAC_TX, GPIO_MIEL_HVAC_RX, // Mitsubishi Electric HVAC
GPIO_WE517_TX, GPIO_WE517_RX, // ORNO WE517 Serial interface
GPIO_AS608_TX, GPIO_AS608_RX, // Serial interface AS608 / R503
GPIO_SENSOR_END };
enum ProgramSelectablePins {
@ -253,7 +254,8 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_ZIGBEE_RST "|"
D_SENSOR_DYP_RX "|"
D_SENSOR_MIEL_HVAC_TX "|" D_SENSOR_MIEL_HVAC_RX "|"
D_SENSOR_WE517_TX "|" D_SENSOR_WE517_RX
D_SENSOR_WE517_TX "|" D_SENSOR_WE517_RX "|"
D_SENSOR_AS608_TX "|" D_SENSOR_AS608_RX
;
const char kSensorNamesFixed[] PROGMEM =
@ -566,6 +568,10 @@ const uint16_t kGpioNiceList[] PROGMEM = {
AGPIO(GPIO_BOILER_OT_TX),
AGPIO(GPIO_BOILER_OT_RX),
#endif
#ifdef USE_AS608
AGPIO(GPIO_AS608_TX),
AGPIO(GPIO_AS608_RX),
#endif
/*-------------------------------------------------------------------------------------------*\
* Other sensors

View File

@ -236,7 +236,7 @@ a_features = [[
],[
"USE_EZOORP","USE_EZORTD","USE_EZOHUM","USE_EZOEC",
"USE_EZOCO2","USE_EZOO2","USE_EZOPRS","USE_EZOFLO",
"USE_EZODO","USE_EZORGB","USE_EZOPMP","",
"USE_EZODO","USE_EZORGB","USE_EZOPMP","USE_AS608",
"","","","",
"","","","",
"","","","",
@ -269,7 +269,7 @@ else:
obj = json.load(fp)
def StartDecode():
print ("\n*** decode-status.py v20201107 by Theo Arends and Jacek Ziolkowski ***")
print ("\n*** decode-status.py v20201110 by Theo Arends and Jacek Ziolkowski ***")
# print("Decoding\n{}".format(obj))