Biometric Attendance Integration with zkt uface800

I have set up the computer on the local LAN along with zkt uface800 to run the biometric-attendance-sync-tool. The attendance is not pulled to erpnext & below are the error logs. Please help

2023-06-08 15:54:33,309	ERROR	10.10.10.121 exception when fetching from device...
Traceback (most recent call last):
  File "C:\Users\MohammedUsmanahsan\Downloads\biometric-attendance-sync-tool-master\biometric-attendance-sync-tool-master\erpnext_sync.py", line 149, in get_all_attendance_from_device
    conn = zk.connect()
  File "C:\Users\MohammedUsmanahsan\AppData\Local\Programs\Python\Python310\lib\site-packages\zk\base.py", line 384, in connect
    raise ZKErrorResponse("Unauthenticated")
zk.exception.ZKErrorResponse: Unauthenticated
2023-06-08 15:54:33,321	ERROR	exception when calling pull_process_and_push_data function for device{"device_id": "office_1", "ip": "10.10.10.121", "punch_direction": "", "clear_from_device_on_fetch": ""}
Traceback (most recent call last):
  File "C:\Users\MohammedUsmanahsan\Downloads\biometric-attendance-sync-tool-master\biometric-attendance-sync-tool-master\erpnext_sync.py", line 149, in get_all_attendance_from_device
    conn = zk.connect()
  File "C:\Users\MohammedUsmanahsan\AppData\Local\Programs\Python\Python310\lib\site-packages\zk\base.py", line 384, in connect
    raise ZKErrorResponse("Unauthenticated")
zk.exception.ZKErrorResponse: Unauthenticated

@karthikeyan5 sorry for tagging you. Can i get some help here.

What did the most significant (according to your criteria) google search result return? And why was that not leading to an answer? (If you have a ChatGPT account, that might even give a more contextual answer, still).

Hello @blaggacao .
Thanks for the directions. I tried a few things before posting here. From the Google search, I checked Advice on connecting biometric machine with pyzk · Issue #6 · fananimi/pyzk · GitHub. It talks about using make_commkey. I see that the pyzk library installed already has that functionality.

I tried downloading & installing the latest pyzk from GitHub. The result was no different.

The chatgpt talks about device credentials for resolving the issue. But because the local.config file in the erpnext biometric attendance sync tool has no such parameter. I thought of checking with the community.

Please let me know if i have missed something which was very obvious to get to the solution. Thanks in advance.

Thank you! Interesting, indeed!

Could you link me to the connection factory of the erpnext biometric attendance sync tool (in the code)?

From what you report, I have a hunch that there may be a local.config item (i.e. an entry in site_config.json) that you’re missing? (or the attendance tool’s connection factory doesn’t support authenticated connections :smile: :shrimp: )

This is the function that connects to the device.

In the pyzk library, In the connect function there is a argument for password. I am not sure what password is this & no provision to specify this password in erpnext biometric attendance sync tool.

This is the template for configurations. I have generated & provided the ERPNext API Key & Secret properly. But I don’t find any place to specify the device credentials as such.

We have to set up the comm key on the ZKTeco device to 0 for this to work. I will update you here if it works for us.