js_zklib
js_zklib copied to clipboard
c3-200 not working here
Hi, im having troubles connecting, any help would be appreciated
this is the test
var ZKLib = require("zklib");
ZK = new ZKLib({
ip: '192.168.86.21',
port: 4370,
inport: 5200,
timeout: 5000,
connectionType: 'tcp',
});
// connect to access control device
ZK.connect( function() {
// read the time info from th device
ZK.getTime( function(err, t) {
console.log("Device clock's time is " + t.toString());
// disconnect from the device
ZK.disconnect();
});
});
this is the failure
events.js:160
throw er; // Unhandled 'error' event
^
Error: write after end
at writeAfterEnd (_stream_writable.js:195:12)
at Socket.Writable.write (_stream_writable.js:242:5)
at Socket.write (net.js:669:40)
at ZKLib.writeTcpSocket (/Users/johann/node_modules/zklib/zklib/zklib.js:235:12)
at ZKLib.send (/Users/johann/node_modules/zklib/zklib/zklib.js:181:12)
at ZKLib.executeCmd (/Users/johann/node_modules/zklib/zklib/zklib.js:101:10)
at ZKLib.getTime (/Users/johann/node_modules/zklib/zklib/zktime.js:13:10)
at /Users/johann/Temp/zkteco/js_zklib/mytest.js:15:10
at createSocket.err (/Users/johann/node_modules/zklib/zklib/zkconnect.js:13:9)
at Socket.socket.once.err (/Users/johann/node_modules/zklib/zklib/zklib.js:151:7)
Are C3's known to work with this library? The protocol on the wire looks entirely different but perhaps that's a firmware change...
I don't think so, this error indicate that tcp connection is not the right connectiontype ( may be is udp is true ) or some device also connect to this device then you can't connect to it