raihanafroz / zkteco

ZKTeco Laravel Library
151 stars 57 forks source link

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

Open luaugii opened 1 year ago

luaugii commented 1 year ago

I want to greet you and congratulate you for this libery and for the great contribution to the community, I hope that you and your whole family are doing well and that success follows you. I politely request your help, when starting the tests it worked very well, but over time the following error is displayed:

[2022-10-29 11:51:01] production.ERROR: array ( 'Archivo: ' => 'C:\xampp\htdocs\project\vendor\rats\zkteco\src\Lib\ZKTeco.php', 'Linea: ' => 63, 'Codigo: ' => 0, 'Mensaje: ' => 'unpack(): Type H: not enough input, need 1, have 0',

Your help, with this particular and I am ready to give you all my help or possibly I am wrong about something.

As a background, I can tell you that I have it deployed in XAMPP and that I am using PHP 7.4 as the Windows 10 operating system and previously I had it in Linux Ubuntu 20 where it kept the same error.

Stay tuned.

God bless us and prosper the fruit of our work, always.

luaugii commented 1 year ago

Dear Raihan,

Dios te bendiga, grandemente..!

I did what you told me, but without result, for this in my business model I have 2 zkteco devices, one for input and one for output so you can check that both responded to the ping, but when I tried to do $zk->connect() the output only responded true and the input false, I also eliminated the scheduled task that updates the markings every 1 min and I also did not realize that it did not do $zk->disconnect(); So I turned off the computers and there it answered $zk->connect() true, there are three possibilities:

1.- The device is frozen by receiving every 60 seconds a udp request to port 4370 making it always busy. 2.- The device has too many attendance that it is impossible to download it and resolve another request. 3.- That within my code I was not closing the connection after downloading attendance. 4.- I found a computer on the machine that was a server that uses port 4370, so I eliminated this service. 5.- All the previous alternatives.

So I did all these things, and it finally worked. I am very happy and thank you very much for quicky response.

Thanks You.!