-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting Attendance Data #23
Comments
can you show your code, when I use getAttendances() , it will return attendances object with data and error (if it has ) |
Hi :) Thanks for this great package! Trying out and also have an issue with that method (all other is fine, some small things about string data, will do PRs :) However with that method (getAttendances), using the sample code (smallest repro :)
all I can get back:
using: It is called 'THAI01' here, but it is surely the same model everywhere only with localization, Best, |
Ah and this comes too (only when calling getAttendances) `` (node:11608) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'subarray' of null
(node:11608) TypeError: Cannot read property 'subarray' of null (node:11608) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections
`` |
Also (was trying it before) https://github.com/vodvud/php_zklib/blob/master/zklib/src/Attendance.php works. So I suppose some part about the size of the data is not correct ending up with waiting for too much data. |
I confirm it is the parsing of the incoming data being wrong. I am not that quick with JS as I am with C or other, but I will try to debug. Also most recent devices provide a status field, which defines what kind of clock in/out was done. The full data from the attendance log looks like (json for the example): I will try this week to provide a standalone script using executecommand with a new parser (at least for the data stream) |
ok. Case 1:
|
The 2nd error, will update once figured out what causes it (it appears whether the attendance is empty or not) |
For the empty log error: WIthout the TCP Header, the data is: { in zklibtcp.js:132 if(header.commandId === COMMANDS.CMD_DATA){ fails, heading to the false clause on line 136:
as the packetLength == 8, timeout is not renew, catching the timeout catch and error out. the header.commandId is: 4989 |
I need help, getAttendances() only get a few data, but i need all history data, ¿how can i do it? |
When I get data using getAttendance() function and console log it:
showing result:
[Object Object], [Object Object]
how to read it
The text was updated successfully, but these errors were encountered: