cobisja / tad-php

PHP Library for ZK Time & Attendance Devices
MIT License
213 stars 159 forks source link

Not working with new device - guidance needed #14

Open soylomass opened 8 years ago

soylomass commented 8 years ago

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.

kimsreng commented 8 years ago

@soylomass have you found anyway to figure out the api spec of the those functions?

oraya093 commented 8 years ago

@soylomass can you help me please? I´m a noob and I need to make it work with a X628, I can´t connect the TAD with my Device, only with the PHPZKLib, but I need to get the information from only one employee.

cobisja commented 8 years ago

Hi,

TAD-PHP needs that your device has support for a web server. If it does, just follow the samples showed in the TAD-PHP github page.

Also it would be nice you send me the code you used to make your test.

Best regards,

El 12/09/2016 16:11, "Oraya1" notifications@github.com escribió:

@soylomass https://github.com/soylomass can you help me please? I´m a noob and I need to make it work with a X628, I can´t connect the TAD with my Device, only with the PHPZKLib, but I need to get the information from only one employee.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cobisja/tad-php/issues/14#issuecomment-246475800, or mute the thread https://github.com/notifications/unsubscribe-auth/AJzLMiQv_zskAWRIGH4fRca_AfIGOxuNks5qpbHXgaJpZM4IVwZC .

oraya093 commented 8 years ago

This is the code tha I´m using, it´s just to check if I can connect with the device. It have a web server support with UDP. my email is oscar.raya93@gmail.com Thanks for the help

`<?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';

$tad_factory = new TADPHP\TADFactory();

use TADPHP\TADFactory; use TADPHP\TAD;

$b1 = (new TADFactory(['ip'=>'192.168.2.6']))->get_instance();

$dt = $b1->get_date(); // method executed via TAD class. //$r = $b1->set_date(['date'=>'2014-12-31', 'time'=>'23:59:59']); // method executed via PHP_ZKLib.

//$logs = $b1->get_att_log(['pin'=>'99999999'])->to_array();

$logs = $b1->get_att_log(['pin'=>'99999999']); $logs = $logs->filter_by_date(['start_date'=>'2014-11-27', 'end_date'=>'2014-12-02']);

$options = [ 'ip' => '192.168.2.6', // '169.254.0.1' by default (totally useless!!!). 'internal_id' => 1, // 1 by default. 'com_key' => 0, // 0 by default. 'description' => 'N/A', // 'N/A' by default. 'soap_port' => 80, // 80 by default, 'udp_port' => 4370, // 4370 by default. 'encoding' => 'iso8859-1' // iso8859-1 by default. ];

$comands = TAD::commands_available(); $tad = (new TADFactory(['ip'=>'192.168.2.6', 'com_key'=>100]))->get_instance();

// Getting info from all users.

// Now, you want filter the resulset to get att logs between '2014-01-10' and '2014-03-20'. $filtered_att_logs = $att_logs->filter_by_date( ['start' => '2014-01-10','end' => '2014-03-20'] );

print_r($all_user_info);

`

cobisja commented 8 years ago

My friend, you did not send me the errors you are getting when running your code.

I'm the meantime, can you run the following command in your O.S. terminal:

telnet your device's IP address

Take an screenshot an send me too

El 13/09/2016 09:09, "Oraya1" notifications@github.com escribió:

This is the code tha I´m using, it´s just to check if I can connect with the device. It have a web server support with UDP. my email is oscar.raya93@gmail.com Thanks for the help

`<?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';

$tad_factory = new TADPHP\TADFactory();

use TADPHP\TADFactory; use TADPHP\TAD;

$b1 = (new TADFactory(['ip'=>'192.168.2.6']))->get_instance();

$dt = $b1->get_date(); // method executed via TAD class. //$r = $b1->set_date(['date'=>'2014-12-31', 'time'=>'23:59:59']); // method executed via PHP_ZKLib.

//$logs = $b1->get_att_log(['pin'=>'99999999'])->to_array();

$logs = $b1->get_att_log(['pin'=>'99999999']); $logs = $logs->filter_by_date(['start_date'=>'2014-11-27', 'end_date'=>'2014-12-02']);

$options = [ 'ip' => '192.168.2.6', // '169.254.0.1' by default (totally useless!!!). 'internal_id' => 1, // 1 by default. 'com_key' => 0, // 0 by default. 'description' => 'N/A', // 'N/A' by default. 'soap_port' => 80, // 80 by default, 'udp_port' => 4370, // 4370 by default. 'encoding' => 'iso8859-1' // iso8859-1 by default. ];

$comands = TAD::commands_available(); $tad = (new TADFactory(['ip'=>'192.168.2.6', 'comkey'=>100]))->get instance();

// Getting info from all users.

// Now, you want filter the resulset to get att logs between '2014-01-10' and '2014-03-20'. $filtered_att_logs = $att_logs->filter_by_date( ['start' => '2014-01-10','end' => '2014-03-20'] );

print_r($all_user_info);

`

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cobisja/tad-php/issues/14#issuecomment-246675579, or mute the thread https://github.com/notifications/unsubscribe-auth/AJzLMm7NJLgG8Z0b0cvi7TCMjBfmfRVXks5qpqCigaJpZM4IVwZC .

oraya093 commented 8 years ago

Sorry, this is the error message Fatal error: Uncaught exception 'TADPHP\Exceptions\ConnectionError' with message 'Imposible iniciar conexión con dispositivo 192.168.2.6' in C:\Program Files (x86)\Ampps\www\tadtst\tad\lib\TAD.php:408 Stack trace: #0 C:\Program Files (x86)\Ampps\www\tadtst\tad\lib\TAD.php(271): TADPHP\TAD->check_for_connection() #1 C:\Program Files (x86)\Ampps\www\tadtst\index.php(29): TADPHP\TAD->__call('get_date', Array) #2 C:\Program Files (x86)\Ampps\www\tadtst\index.php(29): TADPHP\TAD->get_date() #3 {main} thrown in C:\Program Files (x86)\Ampps\www\tadtst\tad\lib\TAD.php on line 408

cobisja commented 8 years ago

Two things:

best regards,

El 13/09/2016 12:49, "Oraya1" notifications@github.com escribió:

Sorry, this is the error message Fatal error: Uncaught exception 'TADPHP\Exceptions\ConnectionError' with message 'Imposible iniciar conexión con dispositivo 192.168.2.6' in C:\Program Files (x86)\Ampps\www\tadtst\tad\lib\TAD.php:408 Stack trace:

0 C:\Program Files (x86)\Ampps\www\tadtst\tad\lib\TAD.php(271):

TADPHP\TAD->check_for_connection() #1 C:\Program Files (x86)\Ampps\www\tadtst\index.php(29): TADPHP\TAD->__call('get_date', Array) #2 C:\Program Files (x86)\Ampps\www\tadtst\index.php(29): TADPHP\TAD->get_date() #3 {main} thrown in C:\Program Files (x86)\Ampps\www\tadtst\tad\lib\TAD.php on line 408

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cobisja/tad-php/issues/14#issuecomment-246746901, or mute the thread https://github.com/notifications/unsubscribe-auth/AJzLMp62WppilgesCmBHrl1AhfMakIt1ks5qptQfgaJpZM4IVwZC .

oraya093 commented 8 years ago

screenshot 15 screenshot 16 I already have it installed, sorry my english is not the best. My device got the ZEM510 Best regards.

zkenstein commented 5 years ago

did you solve this?

aice09 commented 5 years ago

Anyone solve this?

azizcreativitykw commented 2 years ago

zkteko Uface 900 Welcome to Linux (ZMM220) for MIPS Kernel 3.0.8 on an MIPS

i am using Uface 900 and it is not connecting at all, https://github.com/dnaextrim/php_zklib is working fine but there is no method to delete an enrolled user

please help