Repository navigation
Description
I'm trying to use your code on a P51 with 138a:0097 sensor.
And the same exception as #55 just jumped out when I tried to initialize the device, as below:
`Found device <DEVICE ID 138a:0097 on Bus 001 Address 005>
Downloading https://download.lenovo.com/pccbbs/mobiles/n1mgf03w.exe to extract 6_07f_lenovo_mis.xpfwext
Extracting "Synaptics Metallica MOC Touch Fingerprint Reader Driver for Windows 8.1 64-bit" - setup data version 5.5.0
- "app/WBF_Drivers/6_07f_lenovo_mis.xpfwext"
Done.
Found firmware at /tmp/tmp_50x3jwx/app/WBF_Drivers/6_07f_lenovo_mis.xpfwext
The device will be now reset to factory and associated to the current laptop.
Press Enter to continue (or Ctrl+C to cancel)...
Opening device 0x97
Factory reset...
Sleeping...
Pairing the sensor with device 20HJS0AR2P
Opening device 0x97
Initializing flash...
Detected Flash IC: W25Q80B, 1048576 bytes
Sleeping...
Try 1 failed with error: Failed: 04af
Opening device 0x97
Initializing flash...
Sleeping...
Try 2 failed with error: Unexpected TLS version 4 0
Opening device 0x97
Initializing flash...
Sleeping...
Try 3 failed with error: Unexpected TLS version 4 0
Opening device 0x97
Initializing flash...
Sleeping...
Try 4 failed with error: Unexpected TLS version 4 0
Opening device 0x97
Initializing flash...
Sleeping...
Try 5 failed with error: Unexpected TLS version 4 0
Device didn't reply in time...
Traceback (most recent call last):
File "/snap/validity-sensors-tools/65/vfs-tools/validity-sensors-tools.py", line 339, in
vfs_tools.initialize(fwpath, args.calibration_data)
File "/snap/validity-sensors-tools/65/vfs-tools/validity-sensors-tools.py", line 249, in initialize
self.pair(fwpath, calib_data)
File "/snap/validity-sensors-tools/65/vfs-tools/validity-sensors-tools.py", line 220, in pair
self.retry_command(init_flash_command, max_retries=5)
File "/snap/validity-sensors-tools/65/vfs-tools/validity-sensors-tools.py", line 112, in retry_command
raise(err)
File "/snap/validity-sensors-tools/65/vfs-tools/validity-sensors-tools.py", line 103, in retry_command
command()
File "/snap/validity-sensors-tools/65/vfs-tools/validity-sensors-tools.py", line 219, in init_flash_command
init_flash()
File "/snap/validity-sensors-tools/65/vfs-tools/proto9x/init_flash.py", line 97, in init_flash
partition_flash(flash_layout_hardcoded, client_public)
File "/snap/validity-sensors-tools/65/vfs-tools/proto9x/init_flash.py", line 70, in partition_flash
info = get_flash_info()
File "/snap/validity-sensors-tools/65/vfs-tools/proto9x/flash.py", line 28, in get_flash_info
rsp=tls.cmd(unhex('3e'))
File "/snap/validity-sensors-tools/65/vfs-tools/proto9x/tls.py", line 104, in cmd
rsp=self.app(cmd)
File "/snap/validity-sensors-tools/65/vfs-tools/proto9x/tls.py", line 138, in app
return self.parse_tls_response(self.usb.cmd(self.make_app_data(b)))
File "/snap/validity-sensors-tools/65/vfs-tools/proto9x/tls.py", line 336, in parse_tls_response
raise Exception('Unexpected TLS version %d %d' % (mj, mn))
Exception: Unexpected TLS version 4 0
`
I tried the same solution given there and it didn't worked. Instead when using the correction given in the README section
sudo systemctl status python3-validity
The following message comes up
`python3-validity.service - python-validity driver dbus service
Loaded: loaded (/lib/systemd/system/python3-validity.service; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-06-23 16:27:30 CEST; 26min ago
Process: 28828 ExecStart=/usr/lib/python-validity/dbus-service --debug (code=exited, status=1/FAILURE)
Main PID: 28828 (code=exited, status=1/FAILURE)
juin 23 16:27:30 user0 systemd[1]: Started python-validity driver dbus service.
juin 23 16:27:30 user0 dbus-service[28828]: Traceback (most recent call last):
juin 23 16:27:30 user0 dbus-service[28828]: File "/usr/lib/python-validity/dbus-service", line 17, in
juin 23 16:27:30 user0 dbus-service[28828]: import dbus
juin 23 16:27:30 user0 dbus-service[28828]: ModuleNotFoundError: No module named 'dbus'
juin 23 16:27:30 user0 systemd[1]: python3-validity.service: Main process exited, code=exited, status=1/FAILURE
juin 23 16:27:30 user0 systemd[1]: python3-validity.service: Failed with result 'exit-code'.
`
Activity
uunicorn commentedon Jun 23, 2021
It looks like your are using a mixture of tools here. You don't need
validity-sensors-toolsto runpython-validity.yunniel commentedon Jun 24, 2021
Actually, I removed
validity-sensors-toolsand I used the commands below to set upbut I get a
list_devices failed:message. So, I use the correction you preconize, and I tried to check the logs of thepython3-validitydaemon using$ sudo systemctl status python3-validitybut I obtained the following errorthe
startoption does nothing and theenableoption throws :going further, I tried a factory reset of the device using
and I obtained
but the next step
$ sudo python3 /usr/share/python-validity/playground/factory-reset.pyalso rises an error, as followsThis is the whole story , Thanks in advance for your support
uunicorn commentedon Jun 24, 2021
This is odd. The root cause seems to be this:
It does not look like you have dbus python bindings installed.
This is very strange because
python3-validitypackage from PPA must explicitly depend onpython3-dbus.yunniel commentedon Jun 25, 2021
Any idea on how to solve this issue?
I confirm that
python3-dbuswas already installed. Currently, I'm running Python 3.9.0luciorq commentedon Aug 12, 2021
Hi @yunniel, you are using Ubuntu, right?
The root of the problem looks like you are using a not default install of Python, which is not searching for the modules where they were installed by the PPA.
You can check where the
validitysensormodule is currently installed using:find /usr/lib -type d -iname 'validitysensor'And you can check where your Python install is searching for paths using:
python3 -c 'import sys; print(*sys.path, sep = "\n")'There are several ways of modifying your python installation to be forced to search modules at this path.
But I think a more stable solution (at least will not modify your python installations), is to modify the systemd service file to include the PYTHONPATH variable.
Environment=PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packagesto/lib/systemd/system/python3-validity.serviceafter[Service]headerThe file should look something like this:
After modifying the file you need to reload the systemd daemon and restart the service
This solution is not permanent, if the file get reinstalled from the PPA, the modifications will be overwritten.
sniffer commentedon Mar 7, 2022
I was getting this error with https://github.com/3v1n0/python-validity (validity-sensors-tools) project which it seems is now obsolete.
Have a look at https://gitter.im/Validity90/Lobby?at=601087ce063b6c68d51cb3bb uunicorn comment.
This is however strange because the code in tls.py is still there and is the same where it comes to this exception and error message (my Thinkpad x270 with latest firmware was giving me this exception).
Maybe someone finds it usefull.
mjzjz commentedon May 2, 2023
this works for me

i use manjaro and use anaconda.
apparently there are problems about the environment path.
i just try your steps and it works.
thank you
JGSphaela commentedon Apr 13, 2024
@rkochar Hi, have you try to add the python path that contain the correct package to the systemctl service like @luciorq mentioned above? I'm also on Manjaro and it solve the problem.
I also want to add that it might be the case that the line also need to be add to
open-fprintd.servicebecause in my case bothopen-fprintd.serviceandpython3-validity.servicecomplain about the missing module.Could you check that if adding
Environment=PYTHONPATH=/usr/lib/python3.9/site-packages/to bothopen-fprintd.serviceandpython3-validity.servicesystemctl file works?rkochar commentedon Apr 13, 2024
Hi, @JGSphaela . The original solution indeed works. I had a typo in PYTHONPATH. I have deleted the comment.