Closed yassine-fy94 closed 9 months ago
Firmware Version : Ver 6.64.0013 Oct 16 2018
I would suspect of the port, be sure of the 4370 value on both the device and the script.
if that's matched. it means the firmware version is incompatible with pyzk.. here there's one last thing to do.. use the official ZK software and record (pcap file with wireshark) of a read of attendance (or any interaction) to see if there are extra steps to start communication.
Thank you for your response i did exactly as you asked, by using ZK access 3.5 and capturing a comminication with wireshark : My Ip : 10.2.1.222 F16 IP : 10.2.1.160 F16 PORT : 4370 Attached are the wireshark capture file while getting attendance data, and a video that shows what we did.
https://github.com/kurenai-ryu/pyzk/assets/63519937/54a14e87-fe92-4b10-b1b2-8d869bb35e39
The images complete the video. Thank you.
This is a capture while executing the file basic_test.py (TCP) :
Ok, I reviewed the captured file, and I have bad news for you...
the protocol is completely different AS the Communication protocol manual
where pyzk is based of.
so , in conclusion that firmware version is incompatible with pyzk.
BTW, did you managed to chekc pyzatt ? its a different library, maybe you can have some luck there...
Thank you for your support, pyzatt is not working as expected.
The script basic_test.py is unable to establish a connection with the ZKTeco F16 biometric device. Despite successful ping responses and the standard port being open, no script is able to connect to the device or retrieve information using any protocol, including both UDP and TCP. This issue persists across various connection attempts and scripts, pointing towards a potential bug in the connection handling or device recognition process.
ip : 192.168.1.201 port : 4370 timeout : 20
To Reproduce Steps to reproduce the behavior:
Ensure the device is correctly powered and connected to the network and is reachable by both ping and using the zkaccess software 3.5 security system. Confirm network accessibility by pinging the device's IP address. The device responds to ping commands, indicating network visibility. Attempt to connect to the device using a standard script (e.g., a get-info script) over TCP/UDP. Observe that the script fails to connect to the device. No data is retrieved, and the connection is not established, despite the standard port being open and accessible. Expected behavior The expected behavior is for the script to successfully connect to the ZKTeco F16 device over the specified protocol (TCP/UDP) when the device is online, the port is open, and the network is configured correctly. Data retrieval or command execution should proceed without errors.
Capture Data
Network packet captures (pcap files) were taken during the connection attempts to analyze the traffic between the server and the ZKTeco F16 device. A tutorial for capturing and analyzing network packets can be found here. Verbose output from the connection attempt script (test_machine) is also provided for debugging purposes. System (please complete the following information):
OS: windows 11 + ubuntu - Python version 3.11.5 Additional context
The issue has been consistently reproducible under various network conditions. Any known compatibility issues with the device model or network specifics should be addressed. Similar connection attempts to other devices (ma300/f18/mb360) in the same network are successful, isolating the issue to interactions with the ZKTeco F16 device. Please provide any further insights or observations that might help us in the resolution of this connection failure issue with the ZKTeco F16 device.
Verbose while executing basic_test.py by adding this code to get more information :
except : exc_info = sys.exc_info() print(json.dumps({'connexion':'no' ,'erreur':'except','message':''.join(traceback.format_exception(*exc_info))}))
Connecting to device ...
{"connexion": "no", "erreur": "except", "message": "Traceback (most recent call last):\n File "C:\pyzk\zk\base.py", line 257, in send_command\n self.__data_recv = self.sock.recv(response_size)\n \nTimeoutError: timed out\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "C:\FAR\pyzk\basic_test.py", line 14, in \n conn = zk.connect()\n \n File "C:\pyzk\zk\base.py", line 373, in connect\n cmd_response = self.send_command(const.CMD_CONNECT)\n \n File "C:\pyzk\zk\base.py", line 260, in send_command\n raise ZKNetworkError(str(e))\nzk.exception.ZKNetworkError: timed out\n"}