Giter Club home page Giter Club logo

Comments (64)

maodahua avatar maodahua commented on July 27, 2024 1

@kamshory hello!
Do you finish below function ?
setUserTemplate($data)
If you do, please tell me what is $data means? and how can I encode fingerprint data to it.

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

You can use setUser function
On example bellow, there are 3 users.

  1. Kamshory
    Role = Super Manager
    Serial ID = 1
    User ID = 100001
    Password = password1 (optional)

  2. Mas Roy
    Role = User
    Serial ID = 2
    User ID = 100002
    Password = password2 (optional)

  3. Linda
    Role = User
    Serial ID = 3
    User ID = 100003
    Password = password3 (optional)

If the data is from database, you can repeat $zk->setUser for each data but only in once connection.

<?php
include "zklibrary.php";
$zk = new ZKLibrary('192.168.1.102', 4370);
$zk->connect();
$zk->disableDevice();

$zk->setUser(1, '100001', 'Kamshory', 'password1', 14); // as super manager
$zk->setUser(2, '100002', 'Mas Roy', 'password2', 0); // as user
$zk->setUser(3, '100003', 'Linda', 'password1', 0); // as user

$zk->enableDevice();
?>

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

Before you write data to the device, you must find out the last Serial ID. The new user must have Serial ID larger than the biggest existing Serial ID.

from zklibrary.

test8git avatar test8git commented on July 27, 2024

Thank you very much sir.
But i want to read data from the device (for new user) & store into database.
So that next time when the same user login, i can match with stored data.

Thakns!

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

If you want to get user data from the device and save it to the database, you can use getUser function. The password is plain text. You can use hash function before you save it into the database for security reason.

from zklibrary.

test8git avatar test8git commented on July 27, 2024

And how i will send finger print data ?
$received_data = ?
$zk = new ZKLibrary('192.168.137.105', 4370,null,0,???);

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

To get data from fingerprint and save it to the database, see code bellow:

<?php
include "zklibrary.php";
$zk = new ZKLibrary('192.168.1.102', 4370);
$zk->connect();
$zk->disableDevice();
$users = $zk->getUser();
foreach($users as $key=>$user)
{
   $sql = "insert into `person` (`uid`, `id`, `name`, `level`, `password`) values
   ('$key', '$user[0]', '".addslashes($user[1])."',  '$user[2]', '".addslashes($user[3])."');";
   mysql_query($sql); 
}
$zk->enableDevice();
?>

from zklibrary.

test8git avatar test8git commented on July 27, 2024

Thank you very much, I will check and let you know.
👍

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

Good luck. If you have a problem, tell me please.

from zklibrary.

harisklana avatar harisklana commented on July 27, 2024

Brother can you help me how can get data attendance insert to database thanks so much brother

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

First, you must define your own database to save the data. Then, you create a PHP script to load data from device and insert it into database.

<?php
include "zklibrary.php";
$zk = new ZKLibrary('192.168.1.102', 4370);
$zk->connect();
$zk->disableDevice();


$data = $zk->getAttendance();
foreach($data as $key=>$value)
{
	$uid = $value[0];
	$id = $value[1];
	$state = $value[2];
	$time = $value[3];
	$sql = "insert into attendace(uid, id, state, time) values
	('$uid', '$id', '$state', '$time')
	";
	mysql_query($sql);
}

?>

from zklibrary.

harisklana avatar harisklana commented on July 27, 2024

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

you are welcome

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

I have successfully read fingerprint template from the device but failed when write it. I have read all reference on hundreds website but still not working. I use Solution X100-C

for reading getUserTemplate($uid, $finger)
for writing setUserTemplate($data)

I invite all of you to contribute to this library.

from zklibrary.

elattari avatar elattari commented on July 27, 2024

Hello,
Thank you for your nice library it's very helpful 👍
I have a question please about attendance
How can i know in or out record ?

Thanks in advance

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

You can do it on your application. The first check on the day is check in and the last check on the day is check out. So you need at least two records on one day.

from zklibrary.

waldopanozo avatar waldopanozo commented on July 27, 2024

Hello, Thanks for your work!, but I have a problem, when I try tu put a comm_key, where can I put this info, because when I develop some tool in c sharp, works obviously, but I don't know where or how I can add this info in your library, please help me.

from zklibrary.

sumon01914 avatar sumon01914 commented on July 27, 2024

Hello,
It is working nice. But i am facing some problem for loading time. When i wan to connect at least 20 device by ip address , it is working slow. How can i connect multiple device and get attendance data with very much fast. I am saving data into a file.

Thanks for your help

from zklibrary.

himahshu20 avatar himahshu20 commented on July 27, 2024

How machine automatically push data to the server

from zklibrary.

santosh-1993 avatar santosh-1993 commented on July 27, 2024

Hello Sir, am using secureye biometric machine (S-B7CB).
I have different kinds of bio-metric machine and am finding common data downloader for all machines.
When am trying to connect biometric machine through your zk php code, its not work.
after checking its can not connect to machine. It gives failed to connect. Please help me

from zklibrary.

shofiuddin avatar shofiuddin commented on July 27, 2024

Hello,
How to active or inactive register user without delete enroll user from the device?
Also how to enroll user with RFID card number.
thanks in advance

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

You can not do it to the device but you can do it from your application.

from zklibrary.

santosh-1993 avatar santosh-1993 commented on July 27, 2024

from zklibrary.

fajarpratamaputra avatar fajarpratamaputra commented on July 27, 2024

how the step if i want to send data to fingerprint device from other fingerprint device ?

from zklibrary.

kallolo avatar kallolo commented on July 27, 2024

insert into presensi berdasarkan range tanggal presensi gmna pak?https://github.com/kamshory/ZKLibrary/issues/6#issuecomment-348514795

from zklibrary.

einsthony avatar einsthony commented on July 27, 2024

@kamshory hello sir... is it possible to get data from specific user?

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

No. You must read all data because library not support filter data

from zklibrary.

einsthony avatar einsthony commented on July 27, 2024

how about getting the last data entered sir??

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

first, you must read your data from your device then save it into you database. second, you can read data from your database as you want.

from zklibrary.

biencuong avatar biencuong commented on July 27, 2024

First, you must define your own database to save the data. Then, you create a PHP script to load data from device and insert it into database.

<?php
include "zklibrary.php";
$zk = new ZKLibrary('192.168.1.102', 4370);
$zk->connect();
$zk->disableDevice();


$data = $zk->getAttendance();
foreach($data as $key=>$value)
{
	$uid = $value[0];
	$id = $value[1];
	$state = $value[2];
	$time = $value[3];
	$sql = "insert into attendace(uid, id, state, time) values
	('$uid', '$id', '$state', '$time')
	";
	mysql_query($sql);
}

?>

I can not read the data from this code, although reading the user list is still possible. Please help me!

from zklibrary.

malikatiq786 avatar malikatiq786 commented on July 27, 2024

Not fetching data at remote server working at local server can you guide how we can access device data at remote server.

from zklibrary.

mutaqinzae avatar mutaqinzae commented on July 27, 2024

@kamshory Hello sir, I am using ZK F22
Excuse me, I still have problem in code:
$zk->connect();
I had configured my device IP & Port, then I input into source code. but the result always false, can you help me, how to resolve this?

Thanks you before sir

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

can you use "telnet" to test the connection?

from zklibrary.

mutaqinzae avatar mutaqinzae commented on July 27, 2024

@kamshory I have not tried using it. But I just ask to Seller to give me latest firmware with SOAP support.
I had upgraded my device firmware last night. Has already done.
Notes:

  • We have to confirm to seller about our Serial Number device to get latest firmware.

Thanks you so much Sir.

Zaenal Mutaqin
(PHP Developer)

from zklibrary.

malikatiq786 avatar malikatiq786 commented on July 27, 2024

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

No. I hope somebody can help me to write program code for this function.

from zklibrary.

hmisahaq avatar hmisahaq commented on July 27, 2024

How can get getUserTemplate() data

from zklibrary.

hmisahaq avatar hmisahaq commented on July 27, 2024

How can get $finger in my php project

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

I have test getUserTemplate on my local machine but it useless because fail when I try to write the user template. I hope somebody can help to write setUserTemplate code.

from zklibrary.

hmisahaq avatar hmisahaq commented on July 27, 2024

how can update user data from php script

from zklibrary.

hmisahaq avatar hmisahaq commented on July 27, 2024

how can display date between(two date) attendance report

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

you must store the attendance to your database and fiter it using SQL command.

from zklibrary.

hmisahaq avatar hmisahaq commented on July 27, 2024

When I connect by Real ip from server ,I can not, Plz,suggest me

from zklibrary.

malikatiq786 avatar malikatiq786 commented on July 27, 2024

from zklibrary.

tehceen avatar tehceen commented on July 27, 2024

Sir i need your help how to read RFID Card Number And store it on other devices.

from zklibrary.

leoangelovb avatar leoangelovb commented on July 27, 2024

How do you set time

from zklibrary.

specialfunn avatar specialfunn commented on July 27, 2024

i have a WL 10 zktecho device that device is wifi how i get data from this device and insert into database i use this code but does not get data please help me.thanks.

connect(); $zk->disableDevice(); $data = $zk->getAttendance(); foreach($data as $key=>$value) { $uid = $value[0]; $id = $value[1]; $state = $value[2]; $time = $value[3]; $sql = "insert into attendace(uid, s_id, state, time) values ('$uid', '$id', '$state', '$time') "; mysqli_query($con,$sql); } ?>

from zklibrary.

specialfunn avatar specialfunn commented on July 27, 2024

I have a problem when I upload files to the server and run file it shows Request timeout but when I run on local it works fine can you please tell me how I solve the problem I have already increase my server timeout request ?

from zklibrary.

kamshory avatar kamshory commented on July 27, 2024

I have the same problem too. You can separate the data into several part. e.g you upload 100 data for each request and repeat it until all data uploaded to your online server.

from zklibrary.

JoshDavidHerr avatar JoshDavidHerr commented on July 27, 2024

Sorry, anybody gots solutions to function setUserTemplate? I have tried everything, still not working =(

from zklibrary.

rajucs avatar rajucs commented on July 27, 2024

To get data from fingerprint and save it to the database, see code bellow:

<?php
include "zklibrary.php";
$zk = new ZKLibrary('192.168.1.102', 4370);
$zk->connect();
$zk->disableDevice();
$users = $zk->getUser();
foreach($users as $key=>$user)
{
   $sql = "insert into `person` (`uid`, `id`, `name`, `level`, `password`) values
   ('$key', '$user[0]', '".addslashes($user[1])."',  '$user[2]', '".addslashes($user[3])."');";
   mysql_query($sql); 
}
$zk->enableDevice();
?>

I Tried this to insert server data to my localhost database but failed.

from zklibrary.

saifurrahman1193 avatar saifurrahman1193 commented on July 27, 2024

public function setUserTemplate($data)
{
$command = CMD_USERTEMP_WRQ;
$command_string = $data;
//$length = ord(substr($command_string, 0, 1)) + ord(substr($command_string, 1, 1))256;
return $this->execCommand($command, $command_string);
/

$chksum = 0;
$session_id = $this->session_id;
$u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6/H2h7/H2h8', substr( $this->received_data, 0, 8) );
$reply_id = hexdec( $u['h8'].$u['h7'] );
$buf = $this->createHeader($command, $chksum, $session_id, $reply_id, $command_string);
socket_sendto($this->socket, $buf, strlen($buf), 0, $this->ip, $this->port);
try
{
$u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6', substr( $this->received_data, 0, 8 ) );
$this->session_id = hexdec( $u['h6'].$u['h5'] );
return substr( $this->received_data, 8 );
}
catch(ErrorException $e)
{
return FALSE;
}
catch(exception $e)
{
return FALSE;
}
*/
}
please can anyone explain this code ? what exactly i have to pass here? i want to set user fingerprint data. Thanks in advance

from zklibrary.

rizkimuhammadfauzi avatar rizkimuhammadfauzi commented on July 27, 2024

hi , how to push attendance to my machine ?

from zklibrary.

nurRachmanHS avatar nurRachmanHS commented on July 27, 2024

I have a problem when I upload files to the server and run file it shows Request timeout but when I run on local it works fine can you please tell me how I solve the problem I have already increase my server timeout request ?

your localhost max_execution_time is set to default which mean the code stop itself after 30 seconds, you can change it from your localhost setting or add the following line in your php code :
ini_set('max_execution_time', 0);
0 is for indefinite execution time.

from zklibrary.

Sarojb31 avatar Sarojb31 commented on July 27, 2024

Did you complete solving reading getUserTemplate($uid, $finger) and
for writing setUserTemplate($data)
.Can I get the image from the scanner?

Can I get the response value after placing a finger in scanner along with image to keep in my database?

from zklibrary.

rilwansha avatar rilwansha commented on July 27, 2024

anyone know hot getUserTemplate & SetUsertemplate
please help me
thank you

from zklibrary.

nitheeshtr1 avatar nitheeshtr1 commented on July 27, 2024

anyone help me
how can update user group only without loss another datas?

CMD_USERGRP_WRQ
Set user group. Fill the 1-4 byte of data part of the transmission packet with user serial
number (2Bytes), 5-8 byte with the group serial number.

this is the command,any one help me please....

from zklibrary.

erkutcin avatar erkutcin commented on July 27, 2024

Hi, I am trying to retrieve the datas. I made all updates, but it's still not working. Did you find a solution for yours? Could you help me?

from zklibrary.

nitheeshtr avatar nitheeshtr commented on July 27, 2024

any one can help me to edit user group function
cmd_usergrp_wrq-22
this is my code but its not working,any one can help me to create $commad_string

reference url : https://github.com/adrobinoga/zk-protocol/blob/master/sections/access.md
for set user group

public function userGroup($uid,$gid)
{
$command = CMD_USERGRP_WRQ;
$byte1 = chr((int) ($uid % 256));
$byte2 = chr((int) ($uid >> 8));
$byte3 = chr((int) ($gid));
$command_string = $byte1 . $byte2 . $byte3;
return $this->execCommand($command, $command_string);
}

from zklibrary.

erkutcin avatar erkutcin commented on July 27, 2024

herhangi biri kullanıcı grubu işlevini düzenlememe yardımcı olabilir cmd_usergrp_wrq-22 bu benim kodum ama çalışmıyor, herhangi biri $commad_string oluşturmama yardımcı olabilir

referans url'si: set kullanıcı grubu için https://github.com/adrobinoga/zk-protocol/blob/master/sections/access.md

public function userGroup($uid,$gid) { $command = CMD_USERGRP_WRQ; $byte1 = chr((int) ($uid % 256)); $byte2 = chr((int) ($uid >> 8)); $byte3 = chr((int) ($gid)); $command_string = $byte1 . $bayt2 . $bayt3; dönüş $bu->execCommand($komut, $command_string); }

I'm having trouble pulling data. Can you share the working sdk you are using? Names are coming from the zkteco k70 device, but the inputs and outputs are not.

from zklibrary.

nitheeshtr avatar nitheeshtr commented on July 27, 2024

herhangi biri kullanıcı grubu işlevini düzenlememe yardımcı olabilir cmd_usergrp_wrq-22 bu benim kodum ama çalışmıyor, herhangi biri $commad_string oluşturmama yardımcı olabilir
referans url'si: set kullanıcı grubu için https://github.com/adrobinoga/zk-protocol/blob/master/sections/access.md
public function userGroup($uid,$gid) { $command = CMD_USERGRP_WRQ; $byte1 = chr((int) ($uid % 256)); $byte2 = chr((int) ($uid >> 8)); $byte3 = chr((int) ($gid)); $command_string = $byte1 . $bayt2 . $bayt3; dönüş $bu->execCommand($komut, $command_string); }

I'm having trouble pulling data. Can you share the working sdk you are using? Names are coming from the zkteco k70 device, but the inputs and outputs are not.

use this function for change verification method for specified user
$uid=> user id from device (PIN)
$gid=>verification mode (find code bellow)
FP+PW+RF = 128
FP = 129
PIN = 130
PW = 131
RF = 132
FP+PW = 133
FP+RF = 134
PW+RF = 135
PIN&FP = 136
FP&PW = 137
FP&RF = 138
PW&RF = 139
FP&PW&RF = 140

public function userVerify($uid,$gid)
{
$command = CMD_VERIFY_WRQ;
$byte1 = chr((int) ($uid % 256));
$byte2 = chr((int) ($uid >> 8));
$byte3 = chr((int) ($gid));

    $command_string = $byte1 . $byte2 . $byte3 . str_repeat(chr(0),21);
    return $this->execCommand($command, $command_string);
}

from zklibrary.

madaniibrahim avatar madaniibrahim commented on July 27, 2024

i need to write a fingerprint on zkteco k40 machine .... setfingerprint() or setUsertemplate didn't work with me ...
is there any one has solution .. i really need it as soon as possible

from zklibrary.

Amaan-n avatar Amaan-n commented on July 27, 2024

i need to write a fingerprint on zkteco k40 machine .... setfingerprint() or setUsertemplate didn't work with me ... is there any one has solution .. i really need it as soon as possible

Did you get any solution

from zklibrary.

Amaan-n avatar Amaan-n commented on July 27, 2024

public function setUserTemplate($data) { $command = CMD_USERTEMP_WRQ; $command_string = $data; //$length = ord(substr($command_string, 0, 1)) + ord(substr($command_string, 1, 1))256; return $this->execCommand($command, $command_string); / $chksum = 0; $session_id = $this->session_id; $u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6/H2h7/H2h8', substr( $this->received_data, 0, 8) ); $reply_id = hexdec( $u['h8'].$u['h7'] ); $buf = $this->createHeader($command, $chksum, $session_id, $reply_id, $command_string); socket_sendto($this->socket, $buf, strlen($buf), 0, $this->ip, $this->port); try { $u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6', substr( $this->received_data, 0, 8 ) ); $this->session_id = hexdec( $u['h6'].$u['h5'] ); return substr( $this->received_data, 8 ); } catch(ErrorException $e) { return FALSE; } catch(exception $e) { return FALSE; } */ } please can anyone explain this code ? what exactly i have to pass here? i want to set user fingerprint data. Thanks in advance

Did you get the solution on how to set the fingerprint data, I want to transfer the fingerprints from device to another I am able to fetch it from the 1st device but not able to set it to the 2nd device?

from zklibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.