-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding Issue with Date Handling in pyzk Package #221
Comments
go to pyzk folder and open base.py then goto line number 334 and overwrite the code
|
"The issue occurs during the unpacking process with unpack('<H24sB4sB8s', attendance_data.ljust(40, b'\x00')[:40]), particularly when decoding the date. The unpacked data does not align correctly, leading to incorrect date values." |
We have also been facing the same issue with our attendance device. Has there been any workaround solution ? Any help would be appreciated. |
what your device model ? and whats unpack bytes return from device? |
@devinvento our device model is ZKTeco Speedface V5L and the byte unpacked is such as below : b'10111\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04%\x91/\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff255\x00\x00\x00\x00\x00\x06\x0010111\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04d\x91/\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff255\x00\x00\x00\x00\x00\x07\x0010111\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\xd2\x91/\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff255\x00\x00\x00\x00\x00\x08\x0010111\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x0e\x92/\x01\x00\x00\x00\x00\x00\x00\x00\x00\xff255\x00\x00\x00\x00\x00\t\x0010111\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04L\x92/\x01\x00\x00\x00\x00\x00\x00\x00\x00\xff255\x00\x00\x00\x00\x00' |
goto base.py then goto def get_attendance(self): method
|
The Problem is not solved and persists @devinvento. Do you have any other suggestion ? |
@TisSanal I have found the issue to be occurring due to attendance device firmware version (Hardware problem). Kindly, inform your vendor to update the firmware version of the device and this issue will be solved hopefully. In our case this was the solution to - incorrect date formats and unknown populated user ids. cc: @devinvento |
We are using the pyzk library for our ZKTeco integration and have encountered an issue with date encoding. The library is returning dates that are not valid, and we are receiving errors due to incorrect date formats.
Issue Description:
Problem: The pyzk library is producing invalid dates such as 2025 2 30 21 12 20 (February 30th, which is not a valid date). We are also seeing dates like 2000 1 1 0 0 0 which seems incorrect as well.
Error Message: "Failed to connect to the device: day is out of range for month"
Sample Output:
2000 1 1 0 0 0
2024 8 9 9 49 50
2025 2 30 21 12 20
Impact: This issue results in errors related to date handling, which affects the overall functionality and data integrity in our application.
We kindly request your assistance in addressing this encoding problem. If there is an updated version of the pyzk library or specific guidance on resolving this issue, please provide us with the necessary information.
Thank you for your support and prompt attention to this matter.
The text was updated successfully, but these errors were encountered: