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 4 years ago
- Comments: 45 (14 by maintainers)
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.
sudo dmidecode. You will find it will output a lot of information, scoll up to session type 0.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.
To remove wrong data, input
vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersio" ""# replace DmiSystemVersio with value to be removeOpen 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 laptopvboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "N1CET86W (1.54 )"#replace with your own valuevboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseDate" "12/06/2021"# replace with your own valuevboxmanage 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 differentvboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersion" "ThinkPad T460s"# replace with yours value if value is differentvboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "PC0E4WUK"# replace with your own valuevboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSKU" "LENOVO_MT_20F9_BU_Think_FM_ThinkPad T460s"# replace with your valuevboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemFamily" "ThinkPad T460s"# replace with your value if differntvboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemUuid" "b1b1abcc-328e-11b2-a85c-c86361a47c52"# replace with your valuevboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBoardVendor" "LENOVO"vboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBoardProduct" "20F9A043HH"# replace with your value if differentvboxmanage setextradata windows10 "VBoxInternal/Devices/pcbios/0/Config/DmiBoardSerial" "L1HF65W01H5"# replace with your own valueif you finish typing all these, congratulations you finish the difficult part.
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:
git clone https://github.com/uunicorn/python-validityand set up playgroundcd python-validity && sudo PYTHONPATH=scripts:. python3, in python terminal input:from prototype import *, then typeopen9x()open9x()return nothing about error, you have correctly set up the fingerprintcd ~, clone fork of 3v1no/linfprint (because the result is more accurate, thanks @Shade30 for your fork)git clone https://github.com/Shade30/libfprintmeson libfprint libfprint/_build && sudo ninja -C libfprint/_build installThe 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:
/usr/lib/python3/dist-packages/validitysensor/init_flash.py:journalctl -u python3-validity.service -b)python-validity,open-fprintdandfprintd-clientspackagesfprintdwith @3v1n0 'slibfprintfork138a:0090 issue is not trivial, so bear with me.
Background:
libfprintproject is an official Linux fingerprint driver. It supports heaps of sensors, but lacks Validity(Synaptics) devices support.python-validityproject is designed to support Match-On-Chip Validity sensors exclusively. It replaceslibfprint.libfprintproject and added partial support for 138a:0090 devices. Granted the device is already paired, his driver can scan your finger image and feed it back to thefprintdframework to do the matching and/or enrollment. There is a problem with calibration data being wrong, but it sort of works anyway as long as the device was at some point initialized/paired with the host (e.g using Windows multi-boot).python-validity. It does not use any enroll/identify functionality ofpython-validity, just the flash initialization and pairing part.So, to summarize:
python-validitynever fully supported 138a:0090. It only supposed to support the initial device pairing so that @3v1n0 's tool can use it.Looking at your log file I can see two types of errors: 0401 (which was happening before you’ve presumably done a factory reset) and 04af (which must have started happening after that).
0401 error means “unsupported command”. And it was a reply to a Match-On-Chip “start enrollment” command. Which is understandable - this is a Match-On-Host device which does not know how to enroll fingers on its own.
04af error is related to https://www.synaptics.com/sites/default/files/fingerprint-sensor-VFS7500-security-brief-2020-07-14.pdf . It indicates that the driver (python-validity) is trying to partition the flash without supplying a valid partition signature. I’ve added the signature for all other supported devices, however I had no one brave enough to help me extract this signature from the Windows driver logs, or check if a signed partition for some other device would work. Which is understandable -
python-validitywill likely never fully support MoH devices anyway.So, this concludes the diagnostics part of this issue. As for the fix - I’m not sure what’s next.
I guess, I can remove the stub for
138a:0090fromget_partition_signatureinvaliditysensor/init_flash.py. This will likely allow the device initialization to finish successfully. Howeverpython-validitystill have no idea how to enroll or identify your fingers on this device. You’ll need @3v1n0 'slibfprintfor that. And you can’t have bothpython-validityandlibfprintfinstalled at the same time. I guess, @3v1n0 can update his tool to send the signature, in which case you won’t needpython-validityat all.About 2 years ago I gave it a try to add the MoH support to
python-validity. 138a:0090 specifically. I decided that it is only worth doing if I can keep a full compatibility with the Windows driver. Since the template database is stored on-chip, Linux must be able to identify fingers enrolled by Windows and vice-versa. I actually managed to reverse engineer a large portion of the template format. It turns out it is based on a format called “digitalpersona”. It is sort of obfuscated by a TEA encryption with a hardcoded key. This format appears to be supported by alibdpfjlibrary. Heaps of android devices are using this library and it’s very easy to find a Linux version, but it’s not opensource, neither license allows you to re-distribute it. And while technically it’s possible, legally we can’t use it frompython-validity. And even if we could… it does not look like Validity is going to build more MoH devices anyway. All new devices are MoC. So… I finally gave up. The branchdevices/0090is still there in case if some one wants to waste their time on it.