Biometric Attendance Sync Tool

Hi. Can anyone guide me as to how to connect ZKTeco devices located at multiple locations to ERPNext. I have static IP at ERPNext hosted location. Dont have it at device locations.

Thank you.

Hey @Muzzy, read this post. Hope you’ll find a solution here.

Currently, it’s not possible to access biometric devices on WAN. If the devices are on same LAN, then you can find a way out. Also, the CAMS Solution API can help you with devices located on different networks.

1 Like

That’s not completely correct. I was able to achieve WAN connection using 3 optional methods:

  1. Configuring a WAN IP on the biometric attendance device
  2. Using port- forwarding to forward both the device LAN IP address and the UDP Port 4370 via WAN
  3. Using site-to-site VPN to connect both sites together and push LAN through the site.

Option 1 is hardly feasible for most use cases because most ISPs will not give you public IPs or your network infrastructure may prevent you from being able to deploy WAN-facing devices. Option 2 works if you know how to configure port forwarding and option 3 affords you cross-site connectivity even beyond biometric data syncing.

I opted for option 3 as it afforded me the opportunity to link multiple locations for other services beyond biometric time attendance. So you can indeed link multiple locations, you just need to pick which option is easiest for you to implement.

7 Likes

@flexy2ky very smart and respectful response :slight_smile:

1 Like

How to run this tool?

Just follow the instructions in the link below:

2 Likes

Have you found a solution for the Windows service problem? I got the same error message and the service don’t want to run.

Thank you!

Nope. I gave up running it as a windows service.

Ok so you sync it manually now and then?

No. Just run the python script on cmd and leave it. it will continue to run. The difference between this and the service is that the service will kick in every time the computer restarts but you have to run the script manually if the computer restarts.

3 Likes

You can use the non-sucking service manager to make your script run each time your computer runs.

Another option is to create a bat file and use a task manager to schedule so that it runs the py script.

I am on windows, right now I use the .exe (attendance-sync.exe) file to run the program but it always need to be open to run the sync. What is the command to start the script without having to open the .exe file?

I tried in command :

python erpnext_sync_win.py

but how do I know if the script run in the background?

Thank you for your help :slight_smile:

Whenever I see Biometric Tool Integration for Attendance System, a question always arises in my mind, why we cannot make our own face recognition system within Frappe because we have a powerful hardware (your cloud) and a powerful software (Frappe).

may be i wrong and lots of people already thought about this and possibly already made this but at-least we can try this. little bit development and testing from this side.

9 Likes

Hello,

I was using ERPNext on virtualbox on windows machine.

I was using this tool (biometric-attendance-sync-tool-v1.0-win64) and GUI asks me for ERPNext URL but I am testing it on local PC. What URL should I use? I tried the IP address, IP address and port number, localhost, … but it fails to upload to the ERPNext. It communicates and downloads data from the device but not sending it to the system.

This is the ERROR i am getting. Current URL I am using is http://localhost:8080

2021-09-23 15:13:43,190	ERROR	exception when calling pull_process_and_push_data function for device{"device_id": "nfjn", "ip": "192.168.1.201", "punch_direction": "", "clear_from_device_on_fetch": ""}
Traceback (most recent call last):
  File "C:\Users\mybek\OneDrive\Desktop\biometric-attendance-sync-tool-v1.0-win64\erpnext_sync.py", line 51, in main
    pull_process_and_push_data(device, device_attendance_logs)
  File "C:\Users\mybek\OneDrive\Desktop\biometric-attendance-sync-tool-v1.0-win64\erpnext_sync.py", line 129, in pull_process_and_push_data
    raise Exception('API Call to ERPNext Failed.')
Exception: API Call to ERPNext Failed.

Any assistance is appreciated …

Hi @myhabesha first check your VM IP by running ‘ifconfig’ command in terminal then try accessing ERPNext in your host-OS (Win) using VM’s IP in browser and also use the same IP as ERPNext URL in biometric service app http://x.x.x.x

Hey, I keep getting this error in the Attendance Failed Log.

|2022-01-25 21:21:57,554|ERROR|401|11544|55|1642626134.0|1|1|{"uid": 11544, "user_id": "55", "timestamp": "2022-01-20 00:02:14", "status": 1, "punch": 1}|
|---|---|---|---|---|---|---|---|---|
|2022-01-25 21:23:01,963|ERROR|401|11544|55|1642626134.0|1|1|{"uid": 11544, "user_id": "55", "timestamp": "2022-01-20 00:02:14", "status": 1, "punch": 1}|
|2022-01-25 21:24:06,157|ERROR|401|11544|55|1642626134.0|1|1|{"uid": 11544, "user_id": "55", "timestamp": "2022-01-20 00:02:14", "status": 1, "punch": 1}|
|2022-01-25 21:25:10,351|ERROR|401|11544|55|1642626134.0|1|1|{"uid": 11544, "user_id": "55", "timestamp": "2022-01-20 00:02:14", "status": 1, "punch": 1}|
|2022-01-25 21:26:14,587|ERROR|401|11544|55|1642626134.0|1|1|{"uid": 11544, "user_id": "55", "timestamp": "2022-01-20 00:02:14", "status": 1, "punch": 1}|

The ID 55 keeps showing up even if it’s not the ID used.
My Log file shows that a log was fetched but nothing happens on the ERP side.

Check your attendance machine, there must be someone assigned ID 55. The data you see is the data extracted from the biometric device and I am pretty sure the device does not manufacture such data.

So audit employees registered on the machine to re-confirm no one was assigned ID 55.

Yes someone is assigned ID 55, but when another user checks-in the log shows error for ID 55 and not the actual ID checked-in

Ok so if the ID 55 is in the machine but not assigned to an employee in ERPNext, this can also cause the error you’re seeing. So if you have assigned ID 55 to an employee on the machine but not on ERPNext, you have to either assign the 55 on ERPNext or delete the ID from the machine. This error I assume does not stop your sync from being successful. It just lets you know there is an ID on the machine that is not being uploaded to ERPNext.

The ID 55 is actually already assigned to an employee on both the Machine and on ERPNext.
Also the successful Attendance Log I can not seem to see any logs for check-ins