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

Unable to pull event logs #10

Open
gsstek opened this issue Aug 29, 2023 · 1 comment
Open

Unable to pull event logs #10

gsstek opened this issue Aug 29, 2023 · 1 comment

Comments

@gsstek
Copy link

gsstek commented Aug 29, 2023

hello
i have a C3-100 device.

I can connect to the device, get the serial number and even open and close relays. The only think i can't do is get events.
i am getting: pyzkaccess.exceptions.ZKSDKError: GetRTLog failed: SDK error -104: Real-time event data error
Maybe i am doing something wrong

This is the code:
from pyzkaccess import ZKAccess, ZK100

connstr = 'protocol=TCP,ipaddress=192.168.0.201,port=14370,timeout=4000,passwd='
with ZKAccess(connstr=connstr, device_model=ZK100) as zk:

print('Device SN:', zk.parameters.serial_number, 'IP:', zk.parameters.ip_address)


zk.relays.lock.switch_on(5)



card = None
while not card:
    for door1_event in zk.doors[0].events.poll(timeout=60):
        print(door1_event)
        if door1_event.card and door1_event.card != '0':
            print('Got card #', door1_event.card)
            card = door1_event.card


zk.doors[0].relays.switch_on(5)



zk.disconnect()

This is the console output:

PS C:\Users\GS> & C:/Users/GS/AppData/Local/Programs/Python/Python311-32/python.exe c:/Users/GS/Desktop/ZKAccess.py
Device SN: AJMJ223260159 IP: 192.168.0.201
Traceback (most recent call last):
File "c:\Users\GS\Desktop\ZKAccess.py", line 15, in
for door1_event in zk.doors[0].events.poll(timeout=60):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GS\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\pyzkaccess\event.py", line 189, in poll
count = self.refresh() # Can run up to several seconds depending on network
^^^^^^^^^^^^^^
File "C:\Users\GS\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\pyzkaccess\event.py", line 129, in refresh
new_events = [e for e in self._pull_events() if e.event_type != 255]
^^^^^^^^^^^^^^^^^^^
File "C:\Users\GS\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\pyzkaccess\event.py", line 294, in _pull_events
events = self._sdk.get_rt_log(self.buffer_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GS\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\pyzkaccess\sdk.py", line 122, in get_rt_log
raise ZKSDKError('GetRTLog failed', err)
pyzkaccess.exceptions.ZKSDKError: GetRTLog failed: SDK error -104: Real-time event data error

@gsstek
Copy link
Author

gsstek commented Aug 30, 2023

I solved the problem.
It seems the is a C3-100 and i c3-100pro. i had the C3-100pro and it only works with the push sdk.
I got the c3-100 now and everything is working

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

1 participant