I am developing a finger authentication attendance app in ERPNext using zklib.
Can someone help me how to using zklib library.
I am new in erpnext.
where can but this script ,in windows or inside erpnext?
@zaidali install this software on a local server that has direct access to the biometric system
see Installing as a Windows service section:
@Mohammed_Redha
thank you brother ,
I install biometric-attendance-sync-tool on windows,but erpnext in another server ,how to access to erpnext
If you followed the guide then it should connect to your ERPNext instance no matter the location as the process is outlined in the implementation guide.
@flexy2ky After setting up config ,I executed using py erpnext_sync.py
display this error.
2021-07-12 16:03:36,961 ERROR 192.168.40.55 exception when fetching from deviceâŚ
Traceback (most recent call last):
File âC:\Users\Zaid.Melahi\Desktop\biometric-attendance-sync-tool-master\venv\lib\site-packages\pyzk-0.9-py3.7.egg\zk\base.pyâ, line 248, in __send_command
self.__sock.send(top)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File âerpnext_sync.pyâ, line 138, in get_all_attendance_from_device
conn = zk.connect()
File âC:\Users\Zaid.Melahi\Desktop\biometric-attendance-sync-tool-master\venv\lib\site-packages\pyzk-0.9-py3.7.egg\zk\base.pyâ, line 373, in connect
cmd_response = self.__send_command(const.CMD_CONNECT)
File âC:\Users\Zaid.Melahi\Desktop\biometric-attendance-sync-tool-master\venv\lib\site-packages\pyzk-0.9-py3.7.egg\zk\base.pyâ, line 260, in __send_command
raise ZKNetworkError(str(e))
zk.exception.ZKNetworkError: timed out
2021-07-12 16:03:36,965 ERROR exception when calling pull_process_and_push_data function for device{âdevice_idâ: âtest_1â, âipâ: â192.168.40.55â, âpunch_directionâ: null, âclear_from_device_on_fetchâ: false}
Traceback (most recent call last):
File âC:\Users\Zaid.Melahi\Desktop\biometric-attendance-sync-tool-master\venv\lib\site-packages\pyzk-0.9-py3.7.egg\zk\base.pyâ, line 248, in __send_command
self.__sock.send(top)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File âerpnext_sync.pyâ, line 138, in get_all_attendance_from_device
conn = zk.connect()
File âC:\Users\Zaid.Melahi\Desktop\biometric-attendance-sync-tool-master\venv\lib\site-packages\pyzk-0.9-py3.7.egg\zk\base.pyâ, line 373, in connect
cmd_response = self.__send_command(const.CMD_CONNECT)
File âC:\Users\Zaid.Melahi\Desktop\biometric-attendance-sync-tool-master\venv\lib\site-packages\pyzk-0.9-py3.7.egg\zk\base.pyâ, line 260, in __send_command
raise ZKNetworkError(str(e))
zk.exception.ZKNetworkError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File âerpnext_sync.pyâ, line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File âerpnext_sync.pyâ, line 78, in pull_process_and_push_data
device_attendance_logs = get_all_attendance_from_device(device[âipâ], device_id=device[âdevice_idâ], clear_from_device_on_fetch=device[âclear_from_device_on_fetchâ])
File âerpnext_sync.pyâ, line 159, in get_all_attendance_from_device
raise Exception(âDevice fetch failed.â)
Exception: Device fetch failed.
Whatâs your device model?
Can you paste your config here? you can leave out the url, secret and key
@flexy2ky
fingerTec TA200 plus
ERPNext related configs
ERPNEXT_API_KEY = ââ
ERPNEXT_API_SECRET = ââ
ERPNEXT_URL = ââ
operational configs
PULL_FREQUENCY = 60 # in minutes
LOGS_DIRECTORY = âlogsâ # logs of this script is stored in this directory
IMPORT_START_DATE = 20210710 # format: â20190501â
Biometric device configs (all keys mandatory)
#- device_id - must be unique, strictly alphanumerical chars only. no space allowed.
#- ip - device IP Address
#- punch_direction - 'IN'/'OUT'/'AUTO'/None
#- clear_from_device_on_fetch: if set to true then attendance is deleted after fetch is successful.
#(Caution: this feature can lead to data loss if used carelessly.)
devices = [
{âdevice_idâ:âtest_1â,âipâ:â192.168.40.55â, âpunch_directionâ: âAUTOâ, âclear_from_device_on_fetchâ: False},
#{âdevice_idâ:âtest_2â,âipâ:â192.168.40.55â, âpunch_directionâ: None, âclear_from_device_on_fetchâ: False}
]
Configs updating sync timestamp in the Shift Type DocType
shift_type_device_mapping = [
{âshift_type_nameâ: [âShift1â], ârelated_device_idâ: [âtest_1â]}
]
Your device is not compatible. Only ZKTeco devices can be used with zklib.
lâm using pyzk packages that is required inside requirements file in [frappe/biometric-attendance-sync-tool] .
what is the different between zklib and pyzk?
yesterday i did pull the data from biomtric device but now can not connect with it !
what is the problem?and how solve it?
Both of them are the same essentially. pyzk I the unofficial library (tweaked) while zklib is the official nodejs library developed for biometric data collection.
Now this is surprising because the library is only compatible with zkteco devices. Maybe thereâs some sort of similarities with the sdk used to develop the device youâre using but the fact that it failed later suggests thereâs inconsistencies somewhere. Even with ZKTeco devices, not all of them are supported (I learnt this the hard way) so basically if you want this biometric attendance system to work for you then you have to check device compatibility. If you check the pyzk package repo in the url below you will see the list of tested and compatible devices. Although the list is not exhaustive but the firmware and platform version indicates what devices will ultimately be compatible. That should guide you going forward.
Hope this helps
Thank you so much for help me.
What do you recommend me?
How can connect my device with erpnext?
Itâs rare to see a post about zklib. Can you ask me some questions? I want to receive data directly when scanning on the device and transmit it to the server, how do I do that?
how to done this need same guidance please