cobisja / tad-php Goto Github PK
View Code? Open in Web Editor NEWPHP Library for ZK Time & Attendance Devices
License: MIT License
PHP Library for ZK Time & Attendance Devices
License: MIT License
Hi
We want to connect BioPro MH20 device via this API .
Before connecting , i need your confirmation.
http://www.zkteco.me/product-details/biopro-mh20
Thanks
Hi i try from Attendace Managment program all work fine but try tad-php not working
Fatal error: Uncaught exception 'TADPHP\Exceptions\ConnectionError' with message 'Imposible iniciar conexión con dispositivo 192.168.1.201' in C:\xampp\htdocs\zk\tad\lib\TAD.php:408 Stack trace: #0 C:\xampp\htdocs\zk\tad\lib\TAD.php(271): TADPHP\TAD->check_for_connection() #1 C:\xampp\htdocs\zk\index.php(26): TADPHP\TAD->__call('get_date', Array) #2 C:\xampp\htdocs\zk\index.php(26): TADPHP\TAD->get_date() #3 {main} thrown in C:\xampp\htdocs\zk\tad\lib\TAD.php on line 408
is there a way i can pull data from the zkteco wdms database using php
it would be awesome to have this feature.
I want to connect to a remote device. The router of the network where the device is, only has 4370 port opened. How can I make sure the Class won't try to connect using port 80?
Thanks
hello
i want to automatically set date for zk attendance device
all codes works great .. but the setting date not working
i used the zk_lip and set the code
$tad = $tad_factory->get_instance();
$response = $tad->set_date();
when i open the php page it shows
Warning: socket_recvfrom(): unable to recvfrom [10060]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\AppServ\www\Web\assets\php\tad\lib\Providers\TADZKLib.php on line 436
when i use the code
$response = $tad->get_date();
the result in php page returns
1970-01-0100:17:35
Hi,
I would like to know if there is any option to push multiple users in one request, instead of executing function set_user_info
for each user?
Each set_user_info
execution takes about 0.5 second. For 100 users it would be 50 seconds. Could you suggest my how could I improve it?
hi, howto install this in symfony
I must add in composer.json
"require": {
??
Thank you
i copy direcoty TDAPHP in symfony/vendor
Attempted to load class "TADFactory" from namespace "TADPHP".
Did you forget a "use" statement for another namespace?
Hi, first thank you for your effort and to be able to ask a question, there is a way to get the schedules that are saved in the device,
thank you very much
It would be nice to install this package via composer directly, so I ask @cobisja to submit package on https://packagist.org/packages/submit
Hi
Your code works well for ZKteco . But I have to Connect the device by device (company supplied) software before showing data by web browser. i.e If I try to execute php page before initializing company software, php page is showing `no data'. But after initializing/ connecting from company supplied software, if I browse that same php page, attendance data is showing.
I think this php library could not connect to the device independently.
How to resolve this issue so that I don't have to initialize company software at first?
Hello.
Does it support ZKTECO VF380 Face Recognition device ?
How can I know if the watch is in online status or in its offline status? from SOAP commands
After I set the connection password. it returns CMD_ACK_UNAUTH (2005)
when connecting.
how to authorized the connection?
i have 3 devices on authentication error issue on device display and restarting problem plz help
[email protected]
hi, can we push log data into the machine? thanks
Hello, I am currently using tad-php but I have a problem when I am setting user options.
For example, I need to set name users, so I use set_user_info (I extract user's template first, and I provide them after I set user's configuration).
This is an example:
$settingUser = $tad->set_user_info([
'pin' => $user->PIN,
'name'=> $userNames[$key],
'privilege'=> $user->Privilege,
'group'=>$user->Group,
'password' => $user->Password,
'card'=> $user->Card,
'pin2'=> $user->PIN2,
'tz1'=> $user->TZ1,
'tz2'=> $user->TZ2,
'tz3'=> $user->TZ3,
]);
The problem is after running this code, the user's group is set to 12, if I change the group directly from code (to 1, for example) it is changed to -12 in the device.
I think the error occurs parsing the data. The device model is F18. Do you know what could it be the parse error?
Thanks in advance.
[Sorry, i didn't notice @stainless77 already posted same issue : https://github.com/cobisja/tad-php/issues/19 ]
Hi,
i'm starting to use this lib but i'm having this problem.
I can get data from my attendance machine. for simple connection test, i can get the date by calling get_date()
method. Also method get_all_user_info()
run very well. But when i call get_att_log()
or get_mac_address()
. i get this response :
get_att_log()
:
object(TADPHP\TADResponse)#126 (4) { ["response_header":"TADPHP\TADResponse":private]=> string(58) "" ["response_body":"TADPHP\TADResponse":private]=> string(103) "0No data!" ["encoding":"TADPHP\TADResponse":private]=> string(9) "iso8859-1" ["is_empty_response":"TADPHP\TADResponse":private]=> bool(true) }
get_mac_address()
:
object(TADPHP\TADResponse)#127 (4) { ["response_header":"TADPHP\TADResponse":private]=> string(58) "" ["response_body":"TADPHP\TADResponse":private]=> string(108) "0Fail!" ["encoding":"TADPHP\TADResponse":private]=> string(9) "iso8859-1" ["is_empty_response":"TADPHP\TADResponse":private]=> bool(false) }
how can i run every method available correctly? And also one additional question, if i can get all att_log, how to find & filter by date & PIN2 ?
thanks in advance.
get_all_user_info() , get_att_log() Does not work
but work with https://github.com/dnaextrim/php_zklib
why ??
Hi!
I woul like to know if the library works on a public hosting?
Thanks.
Hi @cobisja,
i m using this library for fetching user information from machine but error occurs while triggering the get_all_user_info
function, the error message is here
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xFB 0x86 0x3C 0x2F in C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php on line 462
Warning: SimpleXMLElement::__construct(): 1><TZ2>0</TZ2><TZ3>0</TZ3></Row><Row><PIN>12</PIN><Name>20-weweweweee kkkiiikiik in C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php on line 462
Warning: SimpleXMLElement::__construct(): ^ in C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php on line 462
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : PCDATA invalid Char value 1 in C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php on line 462
Warning: SimpleXMLElement::__construct(): ><TZ2>0</TZ2><TZ3>0</TZ3></Row><Row><PIN>14</PIN><Name>21-weweweweee kkkiiikiik2 in C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php on line 462
Warning: SimpleXMLElement::__construct(): ^ in C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php on line 462
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php:462 Stack trace: #0 C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php(462): SimpleXMLElement->__construct('<GetAllUserInfo...') #1 C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php(446): TADResponse->get_items_number('<GetAllUserInfo...') #2 C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php(95): TADResponse->is_there_no_data('<GetAllUserInfo...') #3 C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php(70): TADResponse->set_response('<GetAllUserInfo...') #4 C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\Providers\TADSoap.php(108): TADResponse->__construct('<?xml version="...', 'iso8859-1') #5 C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TAD.php(290): TADSoap->execute_soap_command('get_all_user_in...', Array, 'iso8859-1') #6 C:\Program Files in C:\Program Files (x86)\xampp\htdocs\hrm\libraries\tad\lib\TADResponse.php on line 462
Any ideas how to resolve this issue.
hi, i am unable to get attendance logs using the function 'get_att_log', returns "No data!". note that i am able to get user info all, get dat etc but unable to get attendance log. kindly help
Dear i just want to know any face recognizance attendance that will work with this script
Thank you in advance
Hi,
First I want to thank you for this great script and the great effort you made to figure all this but beside all this I was looking for a small function or let's say the command that can be used to give the machine order to open the door in the access control system.
Actually I tried all the code and sdk of the device but I didn't figure it out although it is present in the web2.0 build in version which also I failed getting the source of it to modify and then get the command
So can you help me getting this command
Thanks
Hello. I'm trying to access a remote device but can't get the connection to work. It was working fine when the device and the PHP server where sharing the same network.
I've tried to open the ports 80 and 4370 on the server but got the following error:
'TADPHP\Exceptions\ConnectionError' with message 'Imposible iniciar conexión con dispositivo obraargentina.ddns.net' in /opt/bitnami/apps/sistema-tecnofort/htdocs/tad/lib/TAD.php:408 Stack trace: #0 /opt/bitnami/apps/sistema-tecnofort/htdocs/tad/lib/TAD.php(271): TADPHP\TAD->check_for_connection() #1 /opt/bitnami/apps/sistema-tecnofort/htdocs/tad.php(29): TADPHP\TAD->__call('get_date', Array) #2 /opt/bitnami/apps/sistema-tecnofort/htdocs/tad.php(29): TADPHP\TAD->get_date() #3 {main}
Did you get this working with a remote device like that?
Hi There,
Could you tell me how to encode the fingerprints using BioBridge Algorithm VX 9.0 or 10.
Any Suggestion please.
I am trying to configure this library but I am getting an error saying
Message: Class 'SoapClient' not found
Filename: lib/TADFactory.php
I have enabled soap extension in php.ini file.
further i am using Bitnami wampstack
Any help would be highly appreciated
Hey i am getting this error
Fatal error: Uncaught exception 'TADPHP\Exceptions\ConnectionError' with message 'Imposible iniciar conexión con dispositivo 192.168.0.126' in C:\xampp\htdocs\tad\lib\TAD.php:409 Stack trace: #0 C:\xampp\htdocs\tad\lib\TAD.php(271): TADPHP\TAD->check_for_connection() #1 C:\xampp\htdocs\tad\index.php(32): TADPHP\TAD->__call('set_user_info', Array) #2 C:\xampp\htdocs\tad\index.php(32): TADPHP\TAD->set_user_info(Array) #3 {main} thrown in C:\xampp\htdocs\tad\lib\TAD.php on line 409
and my device is zk iface 302 can you please help me with that.
This TAD-PHP is helpful for me and my organization.
However, I have no idea how to set the user template (BioBridge algorithm VX 9.0) from PHP by using finger reader.
If anyone know how to do, please kindly share to me. thanks.
Well we have this device VF380
http://www.zktechnology.ae/products_details.php?id=194
this lib can working with ( in01-a ) & ( Tk14 ) time attendance machine ?
I have ZKTeco K40 pro which have web service, but could not connect to device with this SDK. Also i have tried with UDP.
Very glad to find here for save me a lot of time!!!
Thank you cobisja for answer me in here
http://hk.zksoftware.com:82/bbs1/viewthread.php?tid=5088&pid=22208&page=1&extra=page%3D1#pid22208
I have a new problem, maybe it has no associate with tad-php.
Either I can use default com_key 0 or set com_key to 100 to set user info like this.
$options = [
'ip' => '192.168.196.252',
'com_key' => 100, // not set this or set to 100
'encoding' => 'gb2312'
];
$tad_factory = new TADFactory($options);
$tad = $tad_factory->get_instance();
$r = $tad->set_user_info([
'pin' => 47,
'name'=> '-username-',
'password' => 4321
]);
The reason is hardware device not set com_key?
One device can set two com_key? one key for fetching data and another key for updating data?
how do i link machine with my php file and how will it submit me the finger print id/number?
can you please guide me and let me know about the api in action or a sample.
Hola a todos, es posible disparar el metodo para enrolar la huella digital de un usuario que ya existe en el lector?
Mi inquietud surge porque estoy evaluando la migración de mi sistema actual de administración de socios de un gimnasio, el cual está en visual basic.net a una versión web utilizando nodejs, meteor, react y graphql.
Para esto quiero asegurarme de que voy a poder migrar todas las funciones de mi sistema actual.
Actualmente, he ejecutado los test de esta libreria y funcionan con el lector zk f8.
Otra pregunta seria, el evento online de verificación huella digital, es posible accederlo con esta libreria?
Gracias por el excelente trabajo, saludos.
I have set on the device Comm. -> PC Connection -> Comm Key to 8, Device ID is 1
`<?php
require 'tad/lib/TADFactory.php';
require 'tad/lib/TAD.php';
require 'tad/lib/TADResponse.php';
require 'tad/lib/Providers/TADSoap.php';
require 'tad/lib/Providers/TADZKLib.php';
require 'tad/lib/Exceptions/ConnectionError.php';
require 'tad/lib/Exceptions/FilterArgumentError.php';
require 'tad/lib/Exceptions/UnrecognizedArgument.php';
require 'tad/lib/Exceptions/UnrecognizedCommand.php';
use TADPHP\TADFactory;
use TADPHP\TAD;
$options = [
'ip' => '192.168.1.201',
'internal_id' => 1,
'com_key' => 8,
'udp_port' => 4370,
'encoding' => 'utf-8'
];
$tad_factory = new TADFactory($options);
$tad = $tad_factory->get_instance();
echo $tad->get_device_name();
?>`
This results to "0Fail!" even though the com_key is correct... When I set Comm. -> PC Connection -> Comm Key back to 0... the com_key value at $options does not matter and it will return back the device name...
I connected the device to my laptop atm using a patch cable...
How can I get the fingerprint of each user with the code ??? so far I could not do it, the function getUserTemplarte () only shows me numbers and I want something like this for each user:
ocosgoulTUEdNKVRwRQ0I27BDTEkdMEONK9KQQunMVSBK6VPLEENk9MwgQ + DP3PBC1FTXEEG4ihpQQQ3vFQBO4K + WwERYilHAQ8ztktBEBbKQ0ELDtJrwQ7dqCiBCz + / + IgEGKrBjQQhEO0zBFQNDQYEKFbhrQQdLF1wBDxclfUELMNFXwQRvvmHBCslKUAEZfU1OQRzmIU5BXRW0eoEKPMltgQnQGUyBJQSfRIEUSzIdAQ45l3gBByHUTMEJ5yVhQQmi0UZBFHvYPUEGeKxTAQ6rFGNBCIYURoEOZS9VwR 1M4RoE5m0DRUTF8DHd6HdqxHAxWmj393M28DDX2FkanKi / t7LGsDCWqGarmt1BaL / 25nAwVaiipu / cgcQGKG6mcDBU6KYmr5wChQcobmJIsDBUKKJmZ1uExyi iZVYyD3JhoQJFTMDBLKJlVUIKcWShBVVTwMIkoWVkFQhyaaEVZ1rAwh6hVlUPAW + + + ZaYwMFMgU2CQCSinYdnJsDBR4Ghl3Q4owa3dnfAwUamdlZlR5p2Zi7AwUSndERlfOpWZlfAwUOiQzVkLDhDopRUVTLAwT2iQ0ZjIzVMolNFRcDBN6I0ZlQebVaiEjRVwMEyolVVUxVxXKEBRUTAwS iNGd3wMIToWdlBnWiRWZ3aMDDCqRmZjRpZmrAxASjd2Vnh2 / GAA ==
please help.
hi i've been try to connect the device to my web app using Tad-PHP but in both the way you show us but i can even get the ipv4 for the device( i need your help to guide me).thank here is my email [email protected]
Any idea about empty response of the filter_by_datetime function?
Hi,
Thank you for this repo.
I face a problem when I am trying to implement your repo. When I run this command it show me following error:
Code: $b1->execute_command_via_zklib('get_device_name')
Error: Warning: unpack(): Type H: not enough input, need 1, have 0
lib/Providers/TADZKLib.php on line 425, on line 437, 549, 351, 549
Thank you.
How i can calculate the logs . i use foreach any idea?
I get this error when running the library
The code I'm using is
use TADPHP\TADFactory;
use TADPHP\TAD;
$tad = (new TADFactory(['ip'=>'192.168.37.201', 'com_key'=>0]))->get_instance();
And send me this mistake
Fatal error: Call to undefined function TADPHP\Providers\socket_create() in C:\xampp\htdocs\marcador\lib\Providers\TADZKLib.php on line 258
I am getting this error while trying the get_date() function
Fatal error: Uncaught TADPHP\Exceptions\ConnectionError: Imposible iniciar conexión con dispositivo 192.168.2.150 in C:\xampp\htdocs\time\lib\TAD.php:408 Stack trace: #0 C:\xampp\htdocs\time\lib\TAD.php(271): TADPHP\TAD->check_for_connection() #1 C:\xampp\htdocs\time\index.php(15): TADPHP\TAD->__call('get_date', Array) #2 {main} thrown in C:\xampp\htdocs\time\lib\TAD.php on line 408
My device is ZKTeco TX628 and I set the IP address of the device to 192.168.2.150, and from the command prompt I can ping it also I can access it via telnet client. As per the Device info, it has VX10.0 fingerprint algorithm and the Platform is ZMM200_TFT and here is the link for the data sheet for further information about the device.
http://www.hilite.com.pk/datasheet/attendance/tx-628.pdf
Can I use this SDK for my device? If yes, can you help me what's giving the error? Thanks
Unable to connect to device even device has its own web server and I can ping its IP from my laptop.
The code i am using is
<?php
require 'tad/lib/TADFactory.php';
require 'tad/lib/TAD.php';
require 'tad/lib/TADResponse.php';
require 'tad/lib/Providers/TADSoap.php';
require 'tad/lib/Providers/TADZKLib.php';
require 'tad/lib/Exceptions/ConnectionError.php';
require 'tad/lib/Exceptions/FilterArgumentError.php';
require 'tad/lib/Exceptions/UnrecognizedArgument.php';
require 'tad/lib/Exceptions/UnrecognizedCommand.php';
use TADPHP\TADFactory;
use TADPHP\TAD;
$options = [
'ip' => '192.168.10.90', // '169.254.0.1' by default (totally useless!!!).
'udp_port' => 4370, // 4370 by default.
];
$tad_factory = new TADFactory($options);
$tad = $tad_factory->get_instance();
$logs = $tad->is_alive();
var_dump($logs);die();
?>
also tried different functions other than $tad->is_alive()
but not working at all. When I use $tad->get_att_log();
i get error
Fatal error: Uncaught TADPHP\Exceptions\ConnectionError: Imposible iniciar conexión con dispositivo 192.168.10.90 in C:\xampp\htdocs\projects\tx628\tad\lib\TAD.php:408 Stack trace: #0 C:\xampp\htdocs\projects\tx628\tad\lib\TAD.php(271): TADPHP\TAD->check_for_connection() #1 C:\xampp\htdocs\projects\tx628\test.php(23): TADPHP\TAD->__call('get_att_log', Array) #2 {main} thrown in C:\xampp\htdocs\projects\tx628\tad\lib\TAD.php on line 408
Can you please tell what is the issue with it? One thing also to share is this device was working properly with ZK_Lib.
I've bought a new ZK device (from a X628 to an IN01-A) and the attendance data stopped bringing correct User ids.
In other words, both the uids and the index in the attendance data are incremental, and not related to the users:
1228 =>
array (
0 => 12,
1 => 0,
2 => 1,
3 => '2016-05-02 08:31:07',
),
1229 =>
array (
0 => 13,
1 => 0,
2 => 1,
3 => '2016-05-02 08:31:12',
),
1230 =>
array (
0 => 14,
1 => 0,
2 => 1,
3 => '2016-05-02 08:39:40',
),
1231 =>
array (
0 => 15,
1 => 0,
2 => 1,
3 => '2016-05-02 08:50:16',
),
1232 =>
array (
0 => 16,
1 => 0,
2 => 1,
3 => '2016-05-02 08:54:55',
),
1233 =>
array (
0 => 17,
1 => 0,
2 => 1,
3 => '2016-05-02 08:59:10',
),
Can you guide me about how did you learn to decode the correct data? I've been looking at the functions, specially zkgetattendance function, and I would like to know how did you know where the uid and the other data were located. Did you read that in any official SDK?
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.