Biometric Attendance Sync Tool

Thanks for the tip. I think this just might work. I’ll have so sync the registration ID for each employee to maintain the same data. Both locations use the same biometric device so this shouldn’t be much of a problem (I hope).

No it wasn’t fixed. I got a different model (K40) instead of the MA300 and it worked without any of the errors faced. Even though the MA300 outputs the right date in the software I just could not get it to export same to ERPNext via the biometric tool so that device has been abandoned.

Thanks for your work. It is much appreciated.

Update: I am able to handle multiple biometric devices checkin using the same ID for employees as suggested by @JayRam and it’s working seamlessly. However, I am having issues pulling data from Zkteco WL10. It connects and pings device successfully but always returns zero records and there’s no error in the log to show why zero records are returned. I tried both the windows gui sync tool and installed the tool via command line and getting the same result.

Also, I am having this error when I run the windows service:


Any tip on how I can fix this?

Thanks.

I am Having essl X990 Model and i am trying to use the biometric sync tool
but there are list of challenges I am facing can somebody pls guide with stepwise method of how to use this tool , its quiet on urgent basis.
Stuff I ahve already done:
1: Created employee added biometric id as same as provided in biometric
2: Created Auto attendance marking Shift
3:Connected Biometric Machine in Local network to script running PC
4: Added information in the GUI
5: logs are also getting created but getting following errors as well

File "C:\Users\Amit K Mehta\Downloads\biometric-attendance-sync-tool-master\erpnext_sync.py", line 51, in main
    pull_process_and_push_data(device, device_attendance_logs)
  File "C:\Users\Amit K Mehta\Downloads\biometric-attendance-sync-tool-master\erpnext_sync.py", line 117, in pull_process_and_push_data
    erpnext_status_code, erpnext_message = send_to_erpnext(device_attendance_log['user_id'], device_attendance_log['timestamp'], device['device_id'], punch_direction)
  File "C:\Users\Amit K Mehta\Downloads\biometric-attendance-sync-tool-master\erpnext_sync.py", line 181, in send_to_erpnext
    response = requests.request("POST", url, headers=headers, data=data)
  File "C:\Users\Amit K Mehta\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\Amit K Mehta\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "C:\Users\Amit K Mehta\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 456, in prepare_request
    p.prepare(
  File "C:\Users\Amit K Mehta\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "C:\Users\Amit K Mehta\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 390, in prepare_url
    raise MissingSchema(error)

Pls guide where i am getting this wrong

The Biometric Device IP you are using in the local_config.py file, is it right? Double-check that as it may be the reason. Also, if you can, please share content from your local_config.py file here.

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.