Skip to content
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

Asus Vivobook 14 #5

Closed
kenohassler opened this issue May 5, 2021 · 30 comments
Closed

Asus Vivobook 14 #5

kenohassler opened this issue May 5, 2021 · 30 comments

Comments

@kenohassler
Copy link

kenohassler commented May 5, 2021

Just tested your code on my Vivobook 14 F412FJ, it works!
It uses PID 0x30c6 and proto detected sensor ID 0x6, so I added the following line to elanspi_id_table:

{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x30c6}, .driver_data = ELANSPI_180_ROTATE},

The img-capture example works fine, but enroll does not complete (although it produces an enrolled.pgm). Is this expected?

@mincrmatt12
Copy link
Owner

What do you mean by it "doesn't complete"? You should be requested to swipe your finger multiple times, but it might be hard to see it with all the output spam.

mincrmatt12 added a commit to mincrmatt12/libfprint that referenced this issue May 5, 2021
@kenohassler
Copy link
Author

Oh well, thanks a lot 🤦 enroll actually works fine, verify does as well 🥳

One more thing, I'm not exactly 100% sure about ELANSPI_180_ROTATE. In comparison to ELANSPI_NO_ROTATE, the image is mirrored. Which is correct?

@mincrmatt12
Copy link
Owner

Different sensors are installed in different orientations, and the only way to tell is based on the ID of the touchpad. Based on the driver config files, though, the default is a vertical flip and there didn't seem to be a special override for the setup in your laptop (0x30C6) so ELANSPI_180_ROTATE should be the correct setting.

@kenohassler
Copy link
Author

Ok, good to know! Thanks for your work on this, I'll close the issue.

@shubhamyeola
Copy link

can you explain the detailed procedure on how you got it to work on vivobook x412fj. I have the same model and I am unable to make it work.
Also, I am on the latest ubuntu 21.04

@kenohassler
Copy link
Author

kenohassler commented May 17, 2021

Thanks for your feedback, sure I can.
First, clone this repo and modify TP_PID in proto/hkeyvalue.h. The correct value should be 0x30C6. Now, compile the prototype and try it with ./prototype udev (probably you need to do this as root).
For me, it didn't find the device, so I needed to copy udev/99-elan-spi.rules to /etc/udev/rules.d/ and reload the rules (or reboot). After this, the prototype should work.

To get libfprint running, clone mincrmatt12/libfprint and make sure to git checkout mincrmatt12/elan-spi-new. Run:

meson build -D drivers=all
cd build
meson compile

Now, you should have an examples directory containing the binaries I talked about earlier. Test it with ./img-capture (again, you probably need to be root to open the sensor device).

@shubhamyeola
Copy link

Hey, thanks you for reply.
1.what you mean by compile the prototype? I just change the value and saved it.
2. I was not able to find ./prototype udev( even as root) I did copy paste the rules to etc/udev/rules.d and reboot.
3. what you mean by git checkout mincrmatt12/elan-spi-new, I tried running it in the termainal and got erro fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
4. meson build failed for me , I am attaching logs.
meson-log.txt

Again thanks for helping. I am quite new to linux and learning C nowdays.

@kenohassler
Copy link
Author

no problem, I'll explain:
You are missing cmake (it says so at the end of your logfile). Not a big deal, install it with sudo apt install cmake.
Now, in the elan-spi-fingerprint directory, do:

mkdir build
cd build
cmake ..
make

After this, the build directory you just made contains the prototype. Run it using sudo ./prototype udev and see if it works.

Next, libfprint. Go back to your working directory and git clone https://github.com/mincrmatt12/libfprint. Now, cd libfprint and continue as I described above.
If you have more questions, feel free to ask :)

@shubhamyeola
Copy link

  • this error on elan-spi-fingerprint
    image

  • this error for libfprint
  • i tried searching for installing older meson build , no luck
    image

@kenohassler
Copy link
Author

Oh damn, the first one is my bad. You have to be in the prototype sub-directory to build the prototype.
btw, don't do sudo mkdir. Root owns the folder after that, you might not be able to write files into it.

The second one basically says you upgraded meson after your first shot. The solution is to reconfigure, not to downgrade meson 😉
In the libfprint directory, do meson --reconfigure. After that, you can go back into the build directory and try meson compile again.

@shubhamyeola
Copy link

  • ./prototype udev resutls( i didn't understand anthing in it, lol)
    image

  • meson --reconfigure result
    image

@kenohassler
Copy link
Author

  1. good, it detects your sensor. now run it as root (sudo ./prototype udev) and it should work.
  2. I suspect you ran meson as root before. In the libfprint folder, do sudo rm -rf build and run the meson stuff from the beginning (without sudo!).

@shubhamyeola
Copy link

Everything works smoothly as expected. Thank you again.
Now in examples I have img-capture.c
But, even as root it's giving error
image
I didn't try sudo this time, should i try it ?

@kenohassler
Copy link
Author

Nice! img-capture.c is the source code file, not the compiled program, thus you can't run it. The compiled files are in build/examples. These probably need to be run as root to open your sensor device.

PS: Prefixing sudo runs a program as root - so if you already are in a root shell, it does nothing.

@shubhamyeola
Copy link

image

@kenohassler
Copy link
Author

  • Did you include -D drivers=all when you did meson build?
  • Does git branch --show-current return mincrmatt12/elan-spi-new?

@shubhamyeola
Copy link

  1. Yes i included _d drivers=all in meson build
  2. git branch result
    image

Thanks for your feedback, sure I can.
First, clone this repo and modify TP_PID in proto/hkeyvalue.h. The correct value should be 0x30C6. Now, compile the prototype and try it with ./prototype udev (probably you need to do this as root).
For me, it didn't find the device, so I needed to copy udev/99-elan-spi.rules to /etc/udev/rules.d/ and reload the rules (or reboot). After this, the prototype should work.

To get libfprint running, clone mincrmatt12/libfprint and make sure to git checkout mincrmatt12/elan-spi-new. Run:

meson build -D drivers=all
cd build
meson compile

Now, you should have an examples directory containing the binaries I talked about earlier. Test it with ./img-capture (again, you probably need to be root to open the sensor device).

  • i have skipped this part i think 'git checkout mincrmatt12/elan-spi-new'

@kenohassler
Copy link
Author

Yes, indeed. The problem here is that the version you compiled doesn't include the driver.
Fix it by running git checkout mincrmatt12/elan-spi-new and recompiling with meson compile (in the build directory, of course).

@shubhamyeola
Copy link

image

  • It's working man! thank you
  • How can I use it to unlock my device?

@kenohassler
Copy link
Author

kenohassler commented May 17, 2021

nice! 🥳
I didn't actually try that though.
Afaik Ubuntu already has everything needed, so you could try running sudo meson install in the build directory. If it works, this replaces the standard libfprint with the version you made. Check whether you can enroll your fingers in gnome-settings 😃

@shubhamyeola
Copy link

sadly not working this way

@kenohassler
Copy link
Author

Hm, I need to check that out myself. Could take a while

@shubhamyeola
Copy link

No problem. Thanks for all the help, I learned a lot of new stuff.

@shubhamyeola
Copy link

shubhamyeola commented May 17, 2021

update:
image
image

  • I have to swipe to register it and if I get the error your swipe was too short then I will be not able to register it again.
  • on the lock screen I have an option but it always failed to recognize my fingerprint.

@mincrmatt12
Copy link
Owner

Hmm I think there may have been some stuff I changed regarding swipe cancellation which may have caused it to break after a failed attempt, could you get fprintd logs and put them in a new bug over at mincrmatt12/libfprint?

You can turn on the debug logs by passing G_MESSAGES_DEBUG=all to fprintd in its service file.

@shubhamyeola
Copy link

Sure, I happy to help. just tell me,

  1. where is fprintd service file located.( I tried searching)
  2. where will logs saved so I can copy them.

@mincrmatt12
Copy link
Owner

Sorry for the late reply, I've been a bit busy with other stuff recently.

  1. You should be able to add it by running systemctl edit fprintd.service, and in the editor opened add
    [Service]
    Environment="G_MESSAGES_DEBUG=all"
    
  2. The logs should be in the systemd journal, use journalctl -u fprintd.service to view them.

@BAnd313 BAnd313 mentioned this issue Jun 4, 2021
mincrmatt12 added a commit to mincrmatt12/libfprint that referenced this issue Jun 21, 2021
@ayusc
Copy link

ayusc commented Apr 8, 2024

Hi @kenohassler @mincrmatt12 @mincrmatt12 I hope that the post isnt dead. I recently bought this ASUS Vivobook 15 which has the same fingerprint sensor. And i have done all the steps. I have successfully done the part as you have mentioned and all the commands under build/examples are working fine after running sudo ./verify i got a verify.pgm which i could open with display verify.pgm so that means everything is working fine as expected but all now how to setup the fingerprint login ? For your reference i followed this

Also @kenohassler as you said i tried to install the newly built libfprint over the apt installed version but i get the following error (please see the snap)
screen

@kenohassler
Copy link
Author

Hi @ayusc I just read your post. Unfortunately, I don't have the laptop anymore, so I cannot assist with hardware issues.

However, your screenshot looks like a syntax error reported by the compiler. Did you forget inserting a comma? If this is still current, I suggest opening a new issue instead of replying to a closed three-year-old one 😉

@ayusc
Copy link

ayusc commented Aug 30, 2024

Hi @ayusc I just read your post. Unfortunately, I don't have the laptop anymore, so I cannot assist with hardware issues.

However, your screenshot looks like a syntax error reported by the compiler. Did you forget inserting a comma? If this is still current, I suggest opening a new issue instead of replying to a closed three-year-old one 😉

I fixed and built it and everything works fine but fails at the verification stage, i can enroll the fingerprint but could never verify the enrolled image it always results in verify-no-match and it's still a open issue here. The problem is with these particular inbuilt sensors (on the touchpad) which are really small to capture the small difference between the captured fingerprint images.

I think the libfprint library still need years to properly work on these small fingerprint sensors. Anyways i am using Zorin OS which has inbuilt fingerprint login support which also relies on libfprint, i also introduced the issue in thier forum but they are also helpless, the issue is with libfrint itself.
And all the patches you see here are already merged into the main branch of libfprint years ago, still the issue is there...

Big hats off to Windows they really outbeat Linux at this thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants