fananimi / pyzk

Unofficial library of zkteco fingerprint attendance machine
GNU General Public License v2.0
501 stars 335 forks source link

Dates and times of attendance markings are listed in the future #92

Closed ricarcya closed 4 years ago

ricarcya commented 4 years ago

I am testing the library with the MA300-BT fingerprint device. Everything has worked well, until the moment of recovering the employee's assistance that appear with dates of several months or years in the future.

To Reproduce Steps to reproduce the behavior:

  1. date of test jue jun 18 19:21:36 -04 2020 (utc -4)
  2. Use ./test_machine.py -a 192.168.0.191 -f -v -r
  3. See error ATT 1: uid: 38, user_id: 38 t: 2026-06-06 12:35:12, s:8 p:39 ATT 2: uid: 38, user_id: 38 t: 2026-06-06 21:58:24, s:8 p:39 ATT 3: uid: 38, user_id: 38 t: 2026-06-07 03:35:28, s:8 p:39 ATT 4: uid: 38, user_id: 38 t: 2026-06-07 15:06:40, s:8 p:39

Expected behavior list of attendances with correct date/time test_machine_output.txt

Capture Data verbose output from test_machine attached

System (please complete the following information):

kurenai-ryu commented 4 years ago

please check #56 probably the same issue.

ricarcya commented 4 years ago

THX! .....its works

change the line 1563 of base.py to

uid, status, punch, timestamp = unpack('<HBB4s', attendance_data.ljust(8, b'\x00')[:8])

before change ATT 1: uid: 38, user_id: 38 t: 2026-06-06 12:35:12, s:8 p:39

after change ATT 1: uid: 38, user_id: 38 t: 2020-06-17 10:58:21, s:8 p:0

same device MA300-BT