fananimi / pyzk

Unofficial library of zkteco fingerprint attendance machine
GNU General Public License v2.0
489 stars 319 forks source link

Advice on connecting biometric machine with pyzk #6

Closed mdacruzredmine closed 5 years ago

mdacruzredmine commented 7 years ago

Hello: Fanani M. Ihsan:

I am writing you to ask for advice on connecting to a biometric attendance machine via TCP/IP using the pyzk library.

The biometric machine model is "uFace402" and is made by ZKTeco (ZKsoftware). The firmware version is: 8.0.3.3-20161012

The computer used to connect has O.S. Ubuntu Linux 12.04, kernel 3.2.0-126-generic #169-Ubuntu i686. Python version is 2.7.3 (default, Oct 26 2016, 21:04:23) [GCC 4.6.3] The Library Pyzk is installed using the pip command, and the version is 0.5.

I used commands in "http://pyzk.readthedocs.io/en/latest/" to connect to the biometric machine. Here are the output of the commands in the python console:

Python 2.7.3 (default, Oct 26 2016, 21:04:23) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from zk import ZK, const conn = None zk = ZK('192.168.1.201', port=4370, timeout=5) conn = zk.connect() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/zk/base.py", line 155, in connect raise ZKErrorResponse("Invalid response") zk.exception.ZKErrorResponse: Invalid response

The output ends with the message "Invalid response" and the connection cannot be established. I would appreciate your help, what you suggest I could try to connect?

Many thanks,

Martín da Cruz

University of the Republic Uruguay

arahmanhamdy commented 7 years ago

Did you try to set comm key to be 0?

fananimi commented 7 years ago

@mdacruzredmine I'm not sure it's work with your firmware version.

hurelhuyag commented 6 years ago

How can I use custom comm key?

kurenai-ryu commented 6 years ago

You can take a look to https://bitbucket.org/luke_dixon/zkclock and use make_commkey

and use it when there's a CMD_ACK_UNAUTH response.

here's my modified base.py base.py.txt

it's barely tested but it works...

mdacruzredmine commented 6 years ago

Hello kurenai-ryu: many thanks for your suggestion, I will give it a try.

Martín

kurenai-ryu commented 5 years ago

should work now...