kurenai-ryu / pyzk

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

Ability to differentiate between check-in and checkout #3

Closed Ali-Shaikh closed 6 years ago

Ali-Shaikh commented 6 years ago

Is it possible to get some kind of identifier which allows us to differentiate between check-in and checkout?

kurenai-ryu commented 6 years ago

Yes, the Attendance Object, has two properties status and punch

status is the kind of recognition used (only newer devices, has this attribute) it has values of 1 for finger, 3 for password, 4 for card and 15 for face (older devices, has status as 0 all the time)

punch has the identifier you need, it has values for 0 to 5 to differentiate ( between CheckIn CheckOut, IntCheckIn IntCheckOut ExtCheckIn ExtCheckOut) But remember, this value is chosen by the user before registering attendance (in my devices, we have 6 buttons to select all these options, as far as I know, there's no way to update this automatically on device)

Ali-Shaikh commented 6 years ago

Thank you for the information, it's very useful. I realised the script does not output 'punch, status' so I have modified it to get that output. My device is Z40 which is quite old. I am writing a script to get the attendance data which I would then pass on to our time tracking software but its a touch and go sometimes I am able to connect to the device and sometimes it fails and I have to unplug the ethernet for a few seconds.

I will be using the punch identifier and take it from there.

Thank you for your script and advice.

kurenai-ryu commented 6 years ago

you're welcome!

if you have more problems with the communication, try capturing both the verbose output and a wireshark capture (to identify missing packets or any problem with the communication)