Hofei danke, hab ich jetzt mal versucht mit diesem Code (aus der Readme.md, leicht abgeändert):
Python
from pirc522 import RFID
rdr = RFID()
while True:
rdr.wait_for_tag()
(error, tag_type) = rdr.request()
if not error:
print("Tag detected")
(error, uid) = rdr.anticoll()
if not error:
print("UID: " + str(uid))
# Select Tag is required before Auth
if not rdr.select_tag(uid):
# Auth for block 10 (block 2 of sector 2) using default shipping key A
if not rdr.card_auth(rdr.auth_a, 10, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF], uid):
# This will print something like (False, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
print("Reading block 10: " + str(rdr.read(10)))
# Always stop crypto1 when done working
rdr.stop_crypto()
# Calls GPIO cleanup
rdr.cleanup()
Alles anzeigen
Aber auch hier kommt nichts, wenn ich ein Tag vor den Reader halte, aber wenn ich es mit strg-c abbreche kommt das:
Code
Traceback (most recent call last):
File "test.py", line 5, in <module>
rdr.wait_for_tag()
File "/usr/local/lib/python2.7/dist-packages/pirc522/rfid.py", line 366, in wait_for_tag
waiting = not self.irq.wait(0.1)
File "/usr/lib/python2.7/threading.py", line 614, in wait
self.__cond.wait(timeout)
File "/usr/lib/python2.7/threading.py", line 359, in wait
_sleep(delay)