ephraim / node-fprint

This nodejs node is a wrapper around the libfprint library.
MIT License
31 stars 16 forks source link

Use on mac? #5

Closed Koleok closed 6 years ago

Koleok commented 8 years ago

Before i get too deep here, I am trying to understand if this can be packaged into an electron app and be used across platforms. Is this possible?

ephraim commented 8 years ago

I don't own a mac and I don't even know about electron app. So I guess it's not possible for me, but perhaps you could do it on your own?

Koleok commented 8 years ago

I guess more specifically I have been trying to build libfprint on a mac as a pre-requisite to using your package, and at the make step of this installation process I am getting

Making all in libfprint
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -fvisibility=hidden -I./nbis/include -I/usr/local/include -I/usr/local/Cellar/glib/2.48.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.48.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.39/include -I/usr/include -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -I/usr/local/include -g -O2 -MT libfprint_la-poll.lo -MD -MP -MF .deps/libfprint_la-poll.Tpo -c -o libfprint_la-poll.lo `test -f 'poll.c' || echo './'`poll.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -I./nbis/include -I/usr/local/include -I/usr/local/Cellar/glib/2.48.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.48.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.39/include -I/usr/include -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -I/usr/local/include -g -O2 -MT libfprint_la-poll.lo -MD -MP -MF .deps/libfprint_la-poll.Tpo -c poll.c  -fno-common -DPIC -o .libs/libfprint_la-poll.o
poll.c:28:10: fatal error: 'libusb.h' file not found
#include <libusb.h>
         ^
1 error generated.
make[2]: *** [libfprint_la-poll.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I understand that this problem is out of the jurisdiction of your project here, I am just hoping to pick up any contextual insight you may have here since you worked with this tool.

ephraim commented 8 years ago

libfprint depends on libusb, so you will need to build libusb too.

Once I had a mac book and I remember that " MacPorts" was good for such usually linux libraries. EDIT: https://www.macports.org/ports.php?by=name&substr=libusb Sadly they don't have integrated libfprint yet.

twferrell commented 8 years ago

@Koleok, I am thinking of trying out @ephraim 's library as well within an Electron app. In my case, I will be running on Linux (specifically Ubuntu). Curious if you had any success in getting this module to work with Electron? @ephraim, this looks promising! Really appreciate you sharing with the public! I want to use this to manage a U.are.U 4500 Reader. Is the best way to know how to utilize your module just to look at your test scripts? I didn't see any other documentation or anything I could utilize.

Koleok commented 8 years ago

@twferrell I am also using the U.are.U 4500. Right now in my electron app i am successfully using the npm java package to just wrap calls to a .jar that uses the java SDK that digitalPersona/crossmatch makes available.

This is just not ideal though since the target machine must have both a correct java runtime and the OEM dirvers installed.

The environment this app's customers use this electron app in is exclusively windows. So I'm not sure if i have much of a chance to use this lovely node-fprint after all.

ephraim commented 8 years ago

@twferrell: Sorry no real documentation available. But you can have a look at the node-red-contrib-fprint node, this utilizes node-fprint to bring the functionality into node-red.

ephraim commented 8 years ago

Ask if you have any questions about the api. Here the functions node-fprint exports:

init
exit

discoverDevices

openDevice
closeDevice

getEnrollStages <= How many times you need to enroll your finger, depends on the reader.
enrollStart
enrollStop

verifyStart
verifyStop

identifyStart
identifyStop

setDebug <= parameter goes directly into fp_set_debug

Hope that helps!

twferrell commented 8 years ago

@ephraim, really appreciate it. This should help. I'll go through the node-red examples today. By the way, this is my first time hearing about this node-red. This project itself looks interesting. Also looking at IBM Bluemix now, which I found while looking into node-red. I think I'll install node-red module and see if I can hook up your custom node to a debug node and see output from my device as it's getting discovered. Very interesting stuff. Thanks again!

twferrell commented 8 years ago

node-red

@ephraim, Okay, through much trial & error I finally got all the dependencies working (so exciting!!) and now able to see your extra functions in my node-red instance (see my screenshot here: https://www.dropbox.com/s/fbbz30sx6nou9uj/node-red.jpg?dl=0). Dumb question, but how do I actually see something happening in this? I tried connecting some of the FP functions to a Debug node, but not sure what I'm doing since new to node-red. Any feedback you can give me would be huge help as I'm excited about this now, but still learning...

twferrell commented 8 years ago

@ephraim, just wanted to let you know I got the module working today and using it successfully in my Electron application! Just wanted to say thanks a million for publishing this on github!! This really saved me some time! I gave this repo a Star!!

ephraim commented 8 years ago

Glad you made it! :+1:

For node-red: You have Input nodes (start nodes), Output Nodes (end nodes) and the rest (mostly function nodes). For the start you mostly use an Inject node and configure it to inject a blank message.

You can wire this to a fp enroll node for example and the positive output of the enroll node to a debug node and a fp verify node.

So if you successfully enrolled an finger, this finger will directly be verified.

felisio commented 8 years ago

@Koleok Could you share the solution found to connect the Electron in DigitalPersona? Thanks

Koleok commented 8 years ago

@felisio This issue kind of morphed, @twferrell was running on ubuntu, and therefore he was able to install libfprint and be off to the races with his electron integration, I am still very much in bind and have started work on a native c++/node wrapper with cmake/DP c++ sdk

felisio commented 8 years ago

@Koleok You say "Right now in my electron app i am successfully using the npm java package to just wrap calls to a .jar that uses the java SDK that digitalPersona/crossmatch makes available." I need the same solution, I'm trying to load the mac, most can not find the link that Drive in Java, will be that you could share I try to upload here?

vilipwong commented 6 years ago

Hi guys, is there a way to delete fingerprint ?

ephraim commented 6 years ago

node-fprint doesn't save any fingerprint data itself, when I remember correclty. So it depends on you where you save it and how you delete the fingerprint. Only the matching can't be done on a server or something, but needs to be done on a computing device with a fingerprint sensor connected.

vilipwong commented 6 years ago

@ephraim ok understood.

I was trying out with test script and node-red repo you provided. Enroll is working fine, and returning fingerprint, but i am not able to get past verify or identify. All the result is Match Failed. Screenshot below:

image

image

Occasionally on verify/identify it will throw error stated below:

Try again please. State: -5
enroll-unknown-error inside enroll start. -5
*** Error in `node': double free or corruption (fasttop): 0x00007f81780008c0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f819c9ca7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f819c9d337a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f819c9d753c]
/lib/x86_64-linux-gnu/libusb-1.0.so.0(+0x8a6f)[0x7f819a313a6f]
/lib/x86_64-linux-gnu/libusb-1.0.so.0(libusb_handle_events_timeout_completed+0xd3)[0x7f819a314b53]
/usr/lib/x86_64-linux-gnu/libfprint.so.0(fp_handle_events_timeout+0x86)[0x7f8188ef2af6]
/home//sites/node-sample/node_modules/node-fprint/build/Release/fingerprint.node(_Z7poll_fpPv+0x48)[0x7f819a749a48]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f819cd2a6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f819ca5a41d]

OS: Ubuntu 16.04 Device: Digital Persona 4000B Packages installed: libusb-dev, libfprint-dev, libfprint0

p.s What is the difference between verify and identify ?

vilipwong commented 6 years ago

Hi guys, been trying but still no luck. Is my device not supported ? @twferrell Have you encounter this before ?

ephraim commented 6 years ago

verify is comparing 1:1 identify is comparing 1:n

Are the test scripts from the repo working? Then node-red should work too. Can you reproduce the error via script instead of in node-red?

Cheers, Ephraim

vilipwong commented 6 years ago

I have tried both, script with nodejs and node-red, having the same issue, able to enroll but fail at verify/identify.

OS: Ubuntu 16.04 Device: Digital Persona 4000B

ephraim commented 6 years ago

Here is a list of supported devices of libfprint. https://www.freedesktop.org/wiki/Software/fprint/libfprint/Supported_devices/ As this issue is "Use on a Mac" and you don't use Mac OS, please do open another issue for further investigation.

The original issue was long time not updated so I close it now.