You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Card reading depends on the medium of a reader and is supplied by distributor. If this is inconvenient, you can simply get the log from any device that you use to get attendance logs from. DLLs have demos named as "Card Management" inside them that can get the last read RFID from any connected device, be it TCP, RS232, or COM.
Once RFID is acquired, following function is used:
def enroll_user():
# Create a connection to the device
global device, user1
zk = ZK(device.ip, device.port, force_udp=device.force_udp, ommit_ping=device.ommit_ping)
conn = None
try:
# Connect to the device
conn = zk.connect()
conn.disable_device()
# Enroll the user
conn.set_user(uid=user1.uid, name=user1.name, privilege=user1.privilege, password=user1.password, user_id=user1.user_id, card=user1.card)
print(f"User {user1.name} enrolled with user_id : {user1.uid}.")
except Exception as e:
print(f"Failed to enroll user: {e}")
finally:
if conn:
conn.enable_device()
conn.disconnect()
I would like read cards for enroll it when create a user.
Anyone have some python code for this?
The text was updated successfully, but these errors were encountered: