python-validity: Exception: Failed: 04af

I am very new to GitHub,so I want to thank for everyone who contributes this program. Also, English is not my native language, I’m sorry for any misspelled words.

The program complains about 04af error when I was trying to factory resetting my fingerprint driver. Every time after I run the following code sudo python3 /usr/share/python-validity/playground/factory-reset.py -v (no log produced, sudo validity-sensors-firmware runned, python3-validity.service stopped), sudo systemctl status python3-validity.service complains about 04af error. See the attached file for journalctl -u python3-validity.service -b (very long!) log.log You can see it complains about Exception: Failed: 04afwhen I flashing the fingerprint driver. I can not know what the error code mean, and I hope you can troubleshoot the error.

Addition note: I also reset the fingerprint in bios, but it does not work. The fingerprint on ubuntu used to work about 7 months ago, with https://github.com/3v1n0/libfprint/ , but one day I found out it did not work. Until today, I can not figure out why it’s not working. I even reinstall ubuntu, switch to Arch linux and run this program, but still no luck.

The following include my hardware information: OS: ubuntu 20.04 Kernel: 5.13.0-48-generic Host: 20F9A043HH ThinkPad T460s Fingerprint: Bus 001 Device 011: ID 138a:0090 Validity Sensors, Inc. VFS7500 Touch Fingerprint Sensor (via lsusb) DE: Gnome 3.36.8

I thank for everyone who develop this program

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 45 (14 by maintainers)

Most upvoted comments

Hey @udaemon , it is possible to use windows vm to pair with fingerprint, but it requires more work to finish. So, the problem with using windows vm is, the VM does not emulate the host BIOS information, so if pairing is occurred in VM, signature will be different than the host. To solve the problem, we need to emulate the host BIOS information.

Assume you are using VirtualBox and name your windows vm called “windows10”, follow these steps when you go into step 2 in above instruction.

  1. Install dmidecode. This tool is used to find out the BIOS information of the host (T460s)
  2. run sudo dmidecode. You will find it will output a lot of information, scoll up to session type 0. Screenshot from 2023-11-28 23-37-26
  3. we are now going to input BIOS information into VM. Replace windows10 with your name of the windows VM, and value of the string. Below step would just follow the pattern vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/something" "something", make sure you do not input incorrect information, otherwise you have to reset fingerprint again and redo the step.

If you input wrong, you would receive message when running VM. Screenshot from 2023-11-29 00-19-57 To remove wrong data, input vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersio" "" # replace DmiSystemVersio with value to be remove

Open a new terminal and type: vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "LENOVO" # Should be same as mine… unless you are not using a lenovo laptop vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "N1CET86W (1.54 )" #replace with your own value vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseDate" "12/06/2021" # replace with your own value

  1. Scroll down to session type 1 to input system information. Screenshot from 2023-11-28 23-48-41

vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "LENOVO"' # Should be same… vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct" "20F9A043HH" # replace with yours if value is different vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersion" "ThinkPad T460s" # replace with yours value if value is different vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "PC0E4WUK" # replace with your own value vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSKU" "LENOVO_MT_20F9_BU_Think_FM_ThinkPad T460s" # replace with your value vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemFamily" "ThinkPad T460s" # replace with your value if differnt vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemUuid" "b1b1abcc-328e-11b2-a85c-c86361a47c52" # replace with your value

  1. Scoll down to session type 2 to input board information Screenshot from 2023-11-28 23-58-42

vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBoardVendor" "LENOVO" vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBoardProduct" "20F9A043HH" # replace with your value if different vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBoardSerial" "L1HF65W01H5" # replace with your own value

if you finish typing all these, congratulations you finish the difficult part.

  1. Boot into your VM, install fingerprint driver. If installed already, just boot , login and shutdown.
  2. If open9x() return error in step 3, reset fingerprint in BIOS and redone the steps. Make sure you type the correct value. If it is still return error, inform me so I can investigate what wrong in the above steps.

Let me recall my memory what I do to get the fingerprint work on T460s… Here is a background information, the T460s has Windows preinstalled, so I shrink the windows partition and install a Ubuntu 20.04 alongside when I got the laptop.

Here what I do to get my fingerprint working on that time:

  1. reset fingerprint data in BIOS
  2. Boot into windows, do nothing, and reboot into linux system (Sound odd, but this is what I do. You can use a Windows VM to perform this action(?))
  3. clone the repo git clone https://github.com/uunicorn/python-validity and set up playground cd python-validity && sudo PYTHONPATH=scripts:. python3 , in python terminal input: from prototype import *, then type open9x()
  4. If the command open9x() return nothing about error, you have correctly set up the fingerprint
  5. return to home direction cd ~, clone fork of 3v1no/linfprint (because the result is more accurate, thanks @Shade30 for your fork) git clone https://github.com/Shade30/libfprint
  6. build and install forked libfrpint meson libfprint libfprint/_build && sudo ninja -C libfprint/_build install

The above instruction is what I do to get my fingerprint work. Hope it help in your case

That’s all right. This topic came up a few times and wanted to write everything up before I forget it.

To finish pairing, you can try this:

  • edit /usr/lib/python3/dist-packages/validitysensor/init_flash.py:
diff --git a/validitysensor/init_flash.py b/validitysensor/init_flash.py
index 6cd54ec..7dfd546 100644
--- a/validitysensor/init_flash.py
+++ b/validitysensor/init_flash.py
@@ -40,10 +40,6 @@ crypto_backend = default_backend()
 
 
 def get_partition_signature():
-    if usb.usb_dev().idVendor == 0x138a:
-        if usb.usb_dev().idProduct == 0x0090:
-            return b''
-
     return partition_signature
 
 
  • reboot
  • go to your BIOS settings and do another factory reset for the fingerprint reader
  • boot into Linux, and check the logs (e.g journalctl -u python3-validity.service -b)
  • if there are no errors and no python-validity activity for a few minutes, proceed (if you have any concerns at this point, stop here and share the logs)
  • remove python-validity, open-fprintd and fprintd-clients packages
  • install stock fprintd with @3v1n0 's libfprint fork