kurenai-ryu / pyzk

The unofficial library of zksoftware the fingerprint attendance machine
GNU General Public License v2.0
37 stars 23 forks source link

All attendance records have the same status #5

Closed davidtranhp closed 5 years ago

davidtranhp commented 6 years ago

Describe the bug The method get_attendance() return attendance records of the same status.

To Reproduce

  1. TCP Connect ZKTeco K50 (Ver 6.60 Jul 6 2016) which stores 20 attendance records in several status types (checkin, checkout, overtime checkin, overtime checkout)
  2. call get_attendance()
  3. All the 20 records were sucessfully fetched. However, they all have the same status 0 (Check in)

Repeat all the steps above with the device Ronald Jack B3C which stores ~17 thousand attendance records. All the records returns have the same status 1 (check out).

Test has also been carried out with the orignial pyzk for the Ronald Jack B3C (UDP) and found right results.

Expected behavior Attendance records should have their right status

System (please complete the following information):

kurenai-ryu commented 6 years ago

Please check the 'punch' property, it should have the value you need, if not, please attach a capture (pcap) to see if the structure of the response is different

davidtranhp commented 6 years ago

Did u mean punch should be used instead of status?

kurenai-ryu commented 6 years ago

yes, status should be (on newer devices) the type of register (finger, face, card) and punch should be check-in, check-out.

davidtranhp commented 6 years ago

@kurenai-ryu Thank you a lot for your respond. I retried with punch and the data looks right for me.

However, the two devices in my test fall into the third case where record_size==40: https://github.com/kurenai-ryu/pyzk/blob/d2c10f31b0a911128b3f2099c9ffc221bad49a3c/zk/base.py#L1518 How about the other cases for other devices (the older ones?)? Is that punch should be used as status for both those also?

kurenai-ryu commented 6 years ago

ok, I have only one device with record_size = 40 and sadly it doesn't have the check-in-check-out buttons (it's just a biometric lock)

if you can, please capture with wireshark the data packets,(pcap file) and the estimated response (maybe it's just enough to switch status and punch on line 1519)

davidtranhp commented 6 years ago

@kurenai-ryu Thanks for your kind!

I'd love to capture with wireshark the data packets,(pcap file) and the estimated response but I don't know how to do it. Would you mind advising?

P/s: I can let you connect to the ZKTeco K50 for your testing/further development. Please advise how I could transfer my IP privately to you.

kurenai-ryu commented 5 years ago

sorry for the late response, to capture data, please install wireshark then you can capture data (there is no need to add the dissector).

please add the response (if using test_machine.py) and the expected values (some examples are fine)

please note that old firmwares don't reflect the status value properly, and it will be reflected on the captured data...

kurenai-ryu commented 5 years ago

still waiting for some examples or sample data, please reopen if you can provide with more info...