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)
Looks like your device logs are not fetched correctly. The error is raised because of missing device_attendance_log['user_id'] and device_attendance_log['timestamp']. Which are fetch one by one from device_attendance_logs[index_of_last+1:], and sent to erpnext api.
Share content from <Your Device Name>_<Your Device IP>_last_fetch_dump.json file located in the logs folder.
The employee_field_value and timestamp you are passing from send_to_erpnext method in data dictionary may not be right.
If the above doesn’t fix your problem then there might be something wrong with reading checkin-logs one by one and sending them to erpnext. The possibility is the data body is not right.
Push your code to a GitHub repository and share the link, I will have a look.
Did you try these? If this has not fixed your problem then I would like to know if you have changed the code in 'erpnext_sync.py`. If yes, share your code with the description of changes.
Yes i Did change the setting for the local config file as suggested by you .
Havent change anything in the erpnext_sync.py file following is the error log that it am getting now -
2021-06-08 13:45:10,184 ERROR Error during ERPNext API Call. 3 1623049777.0 test_1 IN Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 68, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 31, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 67, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1174, in call
return fn(*args, **newargs)
TypeError: add_log_based_on_employee_field() missing 2 required positional arguments: ‘employee_field_value’ and ‘timestamp’
2021-06-08 13:45:10,184 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “test_1”, “ip”: “192.168.0.104”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
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 129, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.