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'.
`
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
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-validityThe 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'.
`