Comments (9)
The following PR #115 solve the problem.
from adafruit-fingerprint-sensor-library.
could be a regression failure. that said, softwareserial is pretty good at 57600 and we test at that speed no problem!
from adafruit-fingerprint-sensor-library.
Thanks for the quick response!
I'll have a check back through and see if there have been any commits that could have caused that function to regress - from what I can see in the (minimal!) datasheet, it certainly seems like it should work. I guess because there were no examples demonstrating its usage I just wondered whether there were any known issues, but I'll investigate and comment back if I find anything.
I find that 57600 baud for SoftSerial only works if you have a very simple sketch (and not much data being transmitted) - but as soon as you have any non-trivial logic in loop() you risk corrupted data. Part of this sketch involves transferring the library of fingerprint templates, so I'd prefer it to be robust. I could switch to AltSoftSerial, which is more reliable at higher speeds, but thought I'd try to drop to 9600 as it seemed like it should be easy to do! ;)
from adafruit-fingerprint-sensor-library.
The following PR #115 solve the problem.
Oh, good spot - can't believe I missed that! Thankyou :)
from adafruit-fingerprint-sensor-library.
Thanks @frami !
I tried it with this code:
finger.begin(57600);
Serial.println("Baudrate");
Serial.println(finger.baud_rate);
Serial.println("Set Baudrate. return value: (0 is ok, 1 is not ok)");
String ret = "";
ret=finger.setBaudRate(FINGERPRINT_BAUDRATE_9600);
Serial.println(ret);
Serial.println("Baudrate");
finger.begin(9600);
Serial.println(finger.baud_rate);
it returns:
Baudrate
57600
Set Baudrate. return value:
0
Baudrate
57600
Found fingerprint sensor!
So, it seems that the Baudrate remains at 57600 baud.
What am I doing wrong?
I also tried:
finger.begin(9600);
Serial.println("Baudrate");
Serial.println(finger.baud_rate);
Serial.println("Set Baudrate. return value: (0 is ok, 1 is not ok)");
String ret = "";
ret=finger.setBaudRate(FINGERPRINT_BAUDRATE_9600);
finger.begin(FINGERPRINT_BAUDRATE_9600);
Serial.println(ret);
Serial.println("Baudrate");
Serial.println(finger.baud_rate);
and get
Baudrate
57600
Set Baudrate. return value: (0 is ok, 1 is not ok)
0
Baudrate
57600
Apart from this: what is the idear behind set_baudrate? Will it be stored in the Sensor?
The reason I ask: My cable is a bit longer. Thus, the connection at the high baud rate may fail. I rely on the fact that the connection would always be done at 9600 baud.
Best regards,
Hendrik
from adafruit-fingerprint-sensor-library.
Thanks @frami ! I tried it with this code:
finger.begin(57600); Serial.println("Baudrate"); Serial.println(finger.baud_rate); Serial.println("Set Baudrate. return value: (0 is ok, 1 is not ok)"); String ret = ""; ret=finger.setBaudRate(FINGERPRINT_BAUDRATE_9600); Serial.println(ret); Serial.println("Baudrate"); finger.begin(9600); Serial.println(finger.baud_rate);
it returns:
Baudrate 57600 Set Baudrate. return value: 0 Baudrate 57600 Found fingerprint sensor!
So, it seems that the Baudrate remains at 57600 baud. What am I doing wrong?
I also tried:
finger.begin(9600); Serial.println("Baudrate"); Serial.println(finger.baud_rate); Serial.println("Set Baudrate. return value: (0 is ok, 1 is not ok)"); String ret = ""; ret=finger.setBaudRate(FINGERPRINT_BAUDRATE_9600); finger.begin(FINGERPRINT_BAUDRATE_9600); Serial.println(ret); Serial.println("Baudrate"); Serial.println(finger.baud_rate);
and get
Baudrate 57600 Set Baudrate. return value: (0 is ok, 1 is not ok) 0 Baudrate 57600
Apart from this: what is the idear behind set_baudrate? Will it be stored in the Sensor?
The reason I ask: My cable is a bit longer. Thus, the connection at the high baud rate may fail. I rely on the fact that the connection would always be done at 9600 baud.
Best regards, Hendrik
The PR has not been implemented into the master branch yet, so did you apply the changes yourself?
from adafruit-fingerprint-sensor-library.
Sorry, yes I should have mentioned that.
from adafruit-fingerprint-sensor-library.
Hello,
this was the problem:
ret=finger.setBaudRate(FINGERPRINT_BAUDRATE_9600);
finger.begin(FINGERPRINT_BAUDRATE_9600);
FINGERPRINT_BAUDRATE_9600
is 0x1
and used to SET the baudrate.
To connect, you need finger.begin(9600)
.
Nevertheless, I am a bit confused now....
finger.begin(9600);
Serial.println("Baudrate");
Serial.println(finger.baud_rate);
returns
Baudrate
57600
I finally found out, that
finger.getParameters();
needs to be called, before the baudrate is correctly reported.
Is that the intended behaviour? I would not expect that a wrong value is returned, if I do not call getParameters first.
I would expect "None" or so.
Anyway, for me it works now :-)
Please include the PR in the next release!
from adafruit-fingerprint-sensor-library.
Closing. Should be fixed by #115.
from adafruit-fingerprint-sensor-library.
Related Issues (20)
- arduino issue HOT 1
- Library compatible with PID 4750 sensor? HOT 5
- Library not working well for sensor GROW R503 on ATMega 2560 when using real UART HOT 1
- Copy fingerprint data to a new sensor HOT 1
- 1:1 matching HOT 1
- Fingerprint sensor constantly flashing. HOT 4
- Incorrectly matched fingerprints for: Rugged Panel Mount Fingerprint Sensor with Bi-Color LED Ring - R503 HOT 1
- More colors for LED color control HOT 3
- Type error: uint8_t - cycle is forever HOT 1
- storeModel by fingerprint templae HOT 1
- Library not suitable for asynchronous aplications HOT 1
- R503 support for Automatic registration template - AutoEnroll (0x31) & Automatic fingerprint verification - AutoIdentify (0x32)
- Adding fingerprint template transfer functionality to the Adafruit-Fingerprint library HOT 1
- check sum HOT 1
- Errors that aren't FINGERPRINT_PACKETRECIEVEERR are not returned
- Template Count = 0 when templates exist HOT 5
- Change the Security Level - Code Line HOT 2
- Enroll to first free model HOT 1
- show_fingerprint_templates example writes beyond array bounds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit-fingerprint-sensor-library.