Skip to content
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

getRealtimeLogs not working #26

Open
dev-iot-jogja opened this issue Jul 25, 2020 · 22 comments
Open

getRealtimeLogs not working #26

dev-iot-jogja opened this issue Jul 25, 2020 · 22 comments

Comments

@dev-iot-jogja
Copy link

Here my code

const ZKLib = require('./zklib')

let machine_ip = '192.168.192.168';

const test = async () => {
    let zkInstance = new ZKLib(machine_ip, 4370, 10000, 4000);
    try {
        await zkInstance.createSocket()
        console.log(await zkInstance.getInfo())
    } catch (e) {
        console.log("init", e);
    }

    try{
        zkInstance.getRealTimeLogs((data)=>{
            // do something when some checkin 
            console.log('real time', data)
        })
    } catch (e) {
        console.log("realtime error", e)
    }
}

test()

when I try to log, I found that checkNotEventTCP on getRealTimeLogs return CMD_ACK_OK not EF_ATTLOG or CMD_REG_EVENT

what should I do to make getRealTimeLogs working?

@mahrous78
Copy link

getRealTimeLogs is not working with me too

@caobo171
Copy link
Owner

caobo171 commented Sep 1, 2020

Sorry for responding lately, but did you guys make sure that there'is no another machine connect to that device. Because even if it connected successfully but realtime event is not allowed for multiple devices

@herormo
Copy link

herormo commented Mar 27, 2021

Not working for me too, there is only one machine connected to the device. @dev-iot-jogja did you manage to fix this?

@danishthetechie
Copy link

No it is not connected. Could you please have a look, I tried several times.. I really need to do this pal. We can even skype, or call

@danishthetechie
Copy link

No other machine is connected. but still not working

@MoradAbdelgaber
Copy link

@caobo171 any news here for this bug . still getting nothing with getRealTimeLogs

@AlifElahi
Copy link

Hey, I am also facing the same issue. Has anyone found any workaround? (@danishthetechie, @MoradAbdelgaber )
@caobo171 brother have you happened to have some time to look at this?

@ebgutierrez
Copy link

ebgutierrez commented Sep 22, 2021

Hi, I'm having the same issue here. Is there any update on this or any work around? I'm afraid to touch the core codes, also not that good with buffers and packets.

@danishthetechie
Copy link

No, haven't found any resolution regarding this. still my work is pending on getRealTimeLogs issue

@mahrous78
Copy link

the python lib works fine

@JorgeSolisC
Copy link

@danishthetechie encontraste alguna solución?

@JorgeSolisC
Copy link

@dev-iot-jogja did you find a solution?

@danishthetechie
Copy link

@dev-iot-jogja did you find a solution?

No,
no solution found for real time logs

@aadrsh
Copy link

aadrsh commented May 15, 2022

when I try to log, I found that checkNotEventTCP on getRealTimeLogs return CMD_ACK_OK not EF_ATTLOG or CMD_REG_EVENT

@caobo171 @dev-iot-jogja
Yeah same here, Found that getRealTimeLogs function is exiting after checkNotEventTCP check
so I tried commenting out the check
I found out that the packet returned by machine is Regular Packet instead of a Realtime Packet,

Machine Reply after requesting Realtime data is still a Regular Packet
<Buffer 50 50 82 7d 08 00 00 00 d0 07 45 e5 e7 12 03 00>

Referring to https://github.com/adrobinoga/zk-protocol/blob/master/protocol.md
First 2 bytes of Regular Packet is Command ID, next 2 Bytes are Checksum, next 2 are sessionId and rest are reply number and data

But in case of realtime packet CommandID should be 500 But it is ACK_OK i.e. 2000 and instead of realtime event id it sends session ID thats why checkEventNotTCP is true

So.. what I think is the machine isn't sending realtime packets or if its sending then we are not receiving it
I am not good with sockets or js but this is what i came up with

@shahria7k
Copy link

the python lib works fine
which lib?

@daoues1
Copy link

daoues1 commented Dec 8, 2022

the python lib works fine
@mahrous78 it is'nt working for me with the python lib could you explain how did u make it work ?

@catajoynick
Copy link

No fix for this one?

@daoues1
Copy link

daoues1 commented Jun 7, 2023 via email

@catajoynick
Copy link

Oh, then I cant use this library then. Thanks for reply.

@Muddasir1
Copy link

the python lib works fine

can you share with us code ?

@chermakani
Copy link

HI, I am also facing the same issue.Anyone found solution?@caobo171 can you please look at this issue?Let us know if you found solution

@zhandos38
Copy link

I am also facing the same issue and so tired please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests