raihanafroz / zkteco

ZKTeco Laravel Library
151 stars 57 forks source link

unpack(): Type H: not enough input, need 1, have 0 #29

Open kvachakhia opened 1 year ago

kvachakhia commented 1 year ago

Hello, I'm getting error unpack(): Type H: not enough input, need 1, have 0 I'm checking My Device from ZKTeco app

Code: ` $zk = new ZKTeco(178.134.35.35, 4370);

    $zk->connect();

    $zk->getUser();

`

amit1dhakal commented 1 year ago

Hello, I'm getting error unpack(): Type H: not enough input, need 1, have 0 using php version 7.4

Code: $zk = new ZKTeco('device ip', 'device port'); $zk->connect(); $zk->enableDevice() $zk->getUser()

kvachakhia commented 1 year ago

$zk = new ZKTeco('device ip', 'device port'); $zk->connect(); $zk->enableDevice() $zk->getUser()

I get to the same error

joseph-2015 commented 1 year ago

i get the same error

aqibjavaidabbasi commented 1 year ago

I am also getting the same error.

aqibjavaidabbasi commented 1 year ago

@raihanafroz any guideline or suggestions?

YumiAlmero03 commented 1 year ago

when i have these codes

$zk = new ZKTeco('port'); $zk->connect();

i got this in vardump

Rats\Zkteco\Lib\ZKTeco {#11207 ▼ +_ip: "port" +_port: 4370 +_zkclient: Socket resource @701 +_data_recv: "" +_session_id: 0 +_section: "Rats\Zkteco\Lib\Helper\Connect::connect" }

but when i add $zk->getUser(); or $zk->enableDevice(); i am also receiving that error i think its because of this _data_recv variable but i dont know what is this

i hope for follow up

YumiAlmero03 commented 1 year ago

im back and solve my problem i used the connection zkt -> ethernet -> wifi device -> wifi connection -> pc like this diagram image

then set the ip of zkt ip address use ping [zkt ip address] in cmd to check if you are already can connect to device

this video helps https://www.youtube.com/watch?v=zJeJQFYo-2Q

i hope this helps