How to connect a ZKTeco device with laravel which is protected by Communication Password

2.4k Views Asked by At

I am facing an issue that my client have an attendance device ZKTeco K50 which is protected by communication password. Using rats/zkteco when I send request for connecting with device it connects but after that I am unable to get data from device and send data to device due to communication password protection.

I checked in package but there is no way to send communication password and also tried to alter the package but it did nothing.

Please answer if anyone know anything.

2

There are 2 best solutions below

0
On

@KGG is correct. I will offer a few hints to get you started:

  1. this is the best description of the ZKTeco protocol that I have found: https://github.com/adrobinoga/zk-protocol . Reading it is a good idea.

  2. you will want to research the CMD_CONNECT message. When sending it gets a CMD_ACK_UNAUTH message in response, you need to fetch the comm key and compute the crazy ZKTeco secret

  3. You send a CMD_AUTH message to the clock inserting the magical number computed in point 2. If it is good you will get a CMD_ACK_OK message

  4. you will find a python library from the author of the protocol spec here: https://github.com/adrobinoga/pyzatt that looks pretty good to my eyes though I don't do python

  5. And here https://github.com/fananimi/pyzk you will find the function make_comm_key which should get you started

0
On

You have to check if your server provider gives you access to the Firewall in my case I manage WHM where I configure IP and port

enter image description here

enter image description here