ZKLibrary icon indicating copy to clipboard operation
ZKLibrary copied to clipboard

can't connect to device

Open trysetyoutomo opened this issue 5 years ago • 4 comments

i'm trying connect to my device solution x105, but always show false

image

image

trysetyoutomo avatar Nov 27 '19 05:11 trysetyoutomo

you cannot call connect() function 2 time in the same page, that will make problem if you want to dump the connection to test it call connect only in var_dump : use the following instrection

<?php 
include_once "zklibrary.php";
$zk = new ZKLibrary('192.168.0.30', 4370, 'TCP');
// $zk->connect();
var_dump( $zk->connect());
exit;
?>

then if it work just uncomment // $zk->connect(); and comment the second :

<?php 
include_once "zklibrary.php";
$zk = new ZKLibrary('192.168.0.30', 4370, 'TCP');
$zk->connect();
//var_dump( $zk->connect());
exit;
?>

I hope that can help you

FairouzGattoufi avatar Mar 04 '20 11:03 FairouzGattoufi

how you identify the IP and port? can anyone give me example

ahmeraq avatar May 16 '21 15:05 ahmeraq

i'm trying connect to my device solution x105, but always show false

image

image

I use the following method to see if I can connect to the fingerprint:

exec("ping " . $ip, $output, $result); if ($result == 0){ if(count(preg_grep('/Destination host unreachable/i', $output)) == 0){ echo "Ping successful!";

    require 'zklibrary.php';  
    $zk = new ZKLibrary($ip, 4370);
    $zk->connect();
    $zk->disableDevice();
    
    $zk->enableDevice();
    $zk->disconnect();
}
  else
        echo "Ping unsuccessful!";

} else echo "Ping unsuccessful!";

gusviantoko avatar Nov 03 '22 18:11 gusviantoko

how you identify the IP and port? can anyone give me example

it's the Ip set in the fingerprint machine, I use Solution X105, I will go to menu >> comm settings >> Ethernet >> check IP Address

as for the port it will always use 4370. cmiiw

gusviantoko avatar Nov 03 '22 18:11 gusviantoko