Open edwin1028 opened 4 years ago
Hello, did you solve the problem?. That happens to me too
any update facing same problem here,
Tengo el mismo problema.
same problem when try zkInstance.getTime()
same problem when try zkInstance.getTime() new ZKLib(address, port, timeout , inport); I resolve error timeout = 10000;
any update facing same problem here,
I fixed it you just need to remove await in the timeout method and it works perfectly fine for me
The code is in zklibtcp.js file:
writeMessage(msg, connect) {
return new Promise((resolve, reject) => {
let timer = null
this.socket.once('data', (data) => {
timer && clearTimeout(timer)
resolve(data)
})
this.socket.write(msg, null, async (err) => {
if (err) {
reject(err)
} else if (this.timeout) {
timer = setTimeout(() => {
clearTimeout(timer);
reject(new Error('TIMEOUT_ON_WRITING_MESSAGE'));
}, connect ? 2000 : this.timeout)
}
})
})
}
I updated some functionalities and resolved most of the issues in my module based on this package Feel free to check it out: https://github.com/merouanezouaid/zklib-js
had anyone solve it yet? I have the same issue with some devices and not all of them
My case is my ZKteco G2 was offline so i can't make a TCP connect to it, even though i can ping to the device 's IP. So make sure your device is online and be abled to connect. And If other computer is connecting to the attendence device, you still can connect to it by TCP, i dont use UDP so i don't know if it worked.
Good day! I'm attempting to connect multiple devices and use socket.io to emit data to client side. At first load of the server everything works fine, It say's "ok tcp" and "ok udp" but after/upon reloading the client app im having a problem with the udp type device. Here is the error:
Here is my code below:
Thank you in advance for the help!