Can't reach device error while Biometric Attendance Integration

Hello @karthikeyan5

I had successful integration of biometric integration but now I am getting the error mentioned in the below screenshot.
Please give me a solution to that error

image

Thank you!

Please check your network, check if you are able to ping the device from the computer that runs this.

Also, please search on Google and this forum and mention how you tried to solve your issue and where you got stuck with this error, before you ask your question. That might help you get better solutions on this forum.

One more thing, please paste the error as text rather than screenshot, this will help make the error searchable for others.

I have got the below error

2023-02-08 15:11:34,831	ERROR	192.168.29.235 exception when fetching from device...
Traceback (most recent call last):
  File "erpnext_sync.py", line 149, in get_all_attendance_from_device
    conn = zk.connect()
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\zk\base.py", line 367, in connect
    raise ZKNetworkError("can't reach device (ping %s)" % self.__address[0])
zk.exception.ZKNetworkError: can't reach device (ping 192.168.29.235)
2023-02-08 15:11:34,833	ERROR	exception when calling pull_process_and_push_data function for device{"device_id": "x2008", "ip": "192.168.29.235", "punch_direction": "AUTO", "clear_from_device_on_fetch": false}
Traceback (most recent call last):
  File "erpnext_sync.py", line 149, in get_all_attendance_from_device
    conn = zk.connect()
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\zk\base.py", line 367, in connect
    raise ZKNetworkError("can't reach device (ping %s)" % self.__address[0])
zk.exception.ZKNetworkError: can't reach device (ping 192.168.29.235)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "erpnext_sync.py", line 62, in main
    pull_process_and_push_data(device, device_attendance_logs)
  File "erpnext_sync.py", line 89, 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 170, in get_all_attendance_from_device
    raise Exception('Device fetch failed.')
Exception: Device fetch failed.

Also, I have tried to ping the device but I am getting the below result:

image

Thank you

Hello @karthikeyan5
I am getting the below error but I don’t have any idea what this error indicates
Please help me with it

2023-02-14 17:19:40,824	ERROR	192.168.001.117 exception when fetching from device...
Traceback (most recent call last):
  File "D:\biometric-attendance-sync-tool-master\erpnext_sync.py", line 149, in get_all_attendance_from_device
    conn = zk.connect()
           ^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\zk\base.py", line 368, in connect
    if not self.force_udp and self.helper.test_tcp() == 0:
                              ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\zk\base.py", line 97, in test_tcp
    res = self.client.connect_ex(self.address)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 11001] getaddrinfo failed
2023-02-14 17:19:40,831	ERROR	exception when calling pull_process_and_push_data function for device{"device_id": "1739274", "ip": "192.168.001.117", "punch_direction": "AUTO", "clear_from_device_on_fetch": false}
Traceback (most recent call last):
  File "D:\biometric-attendance-sync-tool-master\erpnext_sync.py", line 149, in get_all_attendance_from_device
    conn = zk.connect()
           ^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\zk\base.py", line 368, in connect
    if not self.force_udp and self.helper.test_tcp() == 0:
                              ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\zk\base.py", line 97, in test_tcp
    res = self.client.connect_ex(self.address)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\biometric-attendance-sync-tool-master\erpnext_sync.py", line 62, in main
    pull_process_and_push_data(device, device_attendance_logs)
  File "D:\biometric-attendance-sync-tool-master\erpnext_sync.py", line 89, 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 "D:\biometric-attendance-sync-tool-master\erpnext_sync.py", line 170, in get_all_attendance_from_device
    raise Exception('Device fetch failed.')
Exception: Device fetch failed.

Thank you