-
Notifications
You must be signed in to change notification settings - Fork 55
Template upload/download fixes, misc improvements #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bugfixes for send/get data packet new example for template upload/download
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank for for this PR -- The clean-up and added features are very nice.
I tested this on a Raspberry Pi 4 and it worked well.
Also tested basic function on GrandCentral_M4 -- no issues
edited to add:
It looks like the functions added should also work on the other supported FingerPRint sensors.
The example has some R503 specific code (settings the LED). Would other changes be necessary for a different sensor?
Should the example be names as specifically for the R503.
I think the CI failure was due to missing License/Copyright lines in the example.
I don't have any other concerns.
adafruit_fingerprint.py
Outdated
@@ -25,7 +25,12 @@ | |||
https://github.com/adafruit/circuitpython/releases | |||
""" | |||
|
|||
from micropython import const | |||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why this was added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm running these on Windows PC so needed a way to get around the micropython requirements. Any suggestion on how to get around it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand - I thought the micropython modue was satisfied buy the Blinka interface -- at least, it is on a Raspberry Pi.
Does the example work an a Windows system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah -- I see -- the import of board is also commented out in the example so it is not using any CircuitPython specific modules. I have no objection to the try/except -- just curious about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I looked into this further, the issue was that my venv was missing Blinka. I thought setup had installed but apparently not. I removed the pseudo code. The examples work on both Linux (Ubuntu) and Windows 10.
"""Compares a new fingerprint template to an existing template stored in a file | ||
This is useful when templates are stored centrally (i.e. in a database)""" | ||
print("Waiting for finger print...") | ||
finger.set_led(color=3, mode=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LED control is specifically to the R503 sensor -- should this example be limited to the R503
Will it work on other supported sensors like the ZFM-20 sensor? It appears to have the same functions but i don't have access to one to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Not sure about this. We can designate the example as R503.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully another reviewer has one and can test it. In any case, we may need an r503 version for the LED, so I'd suggest just changing the name of this example to reflect that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrapped the LED call with a try/except block. Now, Theoretically, it should simply get ignored if a board doesn't support it.
changed import micropython code
Now I think you need to run "black" on the files to make CI happy.... |
Oh boy... Let me see... |
@jerryneedell Okay, finally got the CI finishing without errors. Needed both Pylint corrections and Black formatting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested updates on RPi 4 -- Looks good to me.
adafruit_fingerprint.py
Outdated
@@ -25,7 +25,12 @@ | |||
https://github.com/adafruit/circuitpython/releases | |||
""" | |||
|
|||
from micropython import const | |||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah -- I see -- the import of board is also commented out in the example so it is not using any CircuitPython specific modules. I have no objection to the try/except -- just curious about it.
This looks fine to me -- I'll let others have a day or two to review/comment then will merge. |
It would be very helpful is someone with a different fingerprint sensor than the R503 could test this. |
@giacomoverdi It sounds like you are still using the old library. |
Yeah, that comes across as if the library adafruit_fingerprint.py has not been updated to the latest version. Can you double check? |
Thanks. Now it's working! It's amazing!! Is there any way to load the template0.dat to the fingerprint reader? |
@giacomoverdi You mean permanently load it into a flash location? |
Yes
Il giorno gio 18 feb 2021 alle 23:09 Aaron Rouhi <[email protected]>
ha scritto:
… @giacomoverdi <https://github.com/giacomoverdi> You mean permanently load
it into a flash location?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEMNCPWCFYKOFAHXEW4QHFTS7WF2ZANCNFSM4XVL7PEQ>
.
|
You should be able to use |
The template0.dat file is only a fingerprint? or fingers print are appended in template0.dat? |
Just one fingerprint. |
@admiralmaggie I was hoping to get confirmation from someone that that the changes do not cause any issues with the non-r503 sensors. I don't see anything gin the code that should so if you are OK with it, I think we can merge this and make a new release. Are there any other changes you want to make first? |
@jerryneedell I think I'm good for now. I did order a ZFM-20 from Adafruit but missed the UPS deadline on Friday. I should it get it early next week. I can run a few tests then. |
That would be great. We can wait until then to merge it. |
Another question: is there a way to set a system id (or module address) for recognize each fingerprint reader? |
@giacomoverdi Right now, the address is hardcoded to 0xFFFFFFFF. We could potentially make it user configurable but not sure the use case for it though... |
Can you help me to make that? I need to assign each readers to each reles. |
I have 4 readers and 4 rele. Each reader must be connected to one rele |
@giacomoverdi The current module is not really designed to handle multiple sensors at once and I don't think it would be an easy task to make those changes. Also, It is risky to have multiple sensors on a shared UART since there is no built in collision management protocol (nothing prevents sensors from talking at once). It might be easier to connect each sensor to a low cost MCU and then "network" the MCUs with Ethernet/Wifi/RS422/RS485 etc (or use an MCU with 4 available UART port). |
@jerryneedell I contacted Grow Technology Co. and asked for an updated datasheet since some statements didn't make sense (i.e. buffer size was incorrect). They sent me an updated one. This has some changes compare to one hosted on Adafruit. One major change is that it support up to 6 characteristic buffers (instead of 2). This means we can create a fingerprint template out of 6 scans instead of 2 that we are currently doing. This improves accuracy. Tricky change to implement so I will hold off making any changes for now. |
@admiralmaggie Wow! Thanks for the updated sheet. Do you know which version your sensor will support? From Register 0x3A? I guess any change would have to check that ? |
@jerryneedell At this point, It should support all versions. I think if we decide to support the 6 buffer capability, then we need to check the version/model. |
@jepler Did you do any testing with this. If so , which sensor? |
@admiralmaggie Did you get your ZFM-20 sensor to test this with? |
@jerryneedell I did but I haven't had a chance to run a test. It's on my list for this weekend. |
No rush -- I see it was merged - I suggest we hold off releasing the new version until you have tested it. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_Fingerprint to 2.2.0 from 2.1.4: > Merge pull request adafruit/Adafruit_CircuitPython_Fingerprint#28 from admiralmaggie/master Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.8.0 from 3.7.1: > Merge pull request adafruit/Adafruit_CircuitPython_GPS#57 from lesamouraipourpre/bad-sentences Updating https://github.com/adafruit/Adafruit_CircuitPython_HT16K33 to 4.1.5 from 4.1.4: > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#86 from SAK917/master Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 3.0.1 from 3.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#39 from dglaude/patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_MONSTERM4SK to 0.1.2 from 0.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_MONSTERM4SK#6 from FoamyGuy/pylintrc_update > Removed pylint process from github workflow Updating https://github.com/adafruit/Adafruit_CircuitPython_AirLift to 1.0.1 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_AirLift#2 from FoamyGuy/pylintrc > Set correct black and reuse versions > Removed pylint process from github workflow > Hardcoded black version Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.15.4 from 2.15.1: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#132 from jposada202020/tab_replacement > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#130 from kmatch98/master > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#126 from FoamyGuy/label_base_class Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.2.2 from 0.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#9 from tannewt/audiobusio_examples > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#13 from FoamyGuy/pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_Pixel_Framebuf to 1.1.2 from 1.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_Pixel_Framebuf#4 from FoamyGuy/main > Hardcoded black version
Per our discussion, I have made the following changes:
compare_templates
read_sysparam
soft_reset
_print_debug
examples\fingerprint_template_file_compare.py
_get_data
and_send_data
functions.