diff --git a/main.py b/main.py index 92213b3..1e3ea91 100644 --- a/main.py +++ b/main.py @@ -33,7 +33,7 @@ On Windows, the native WebAuthn API will be used. """ import time import configparser -gpie = True +gpie = False if gpie: import RPi.GPIO as GPIO import pickle diff --git a/test.py b/test.py new file mode 100644 index 0000000..e07f922 --- /dev/null +++ b/test.py @@ -0,0 +1,26 @@ +import nfc +import time + +def connected(tag): + print("Tag detected:", tag) + return True + +def read_nfc(): + try: + clf = nfc.ContactlessFrontend('usb') # Ensure this matches your connection + print("NFC reader initialized.") + except Exception as e: + print("Failed to initialize NFC reader:", e) + return + + try: + while True: + print("Waiting for NFC tag...") + clf.connect(rdwr={'on-connect': connected}) + time.sleep(1) + except Exception as e: + print("Error reading NFC tag:", e) + finally: + clf.close() + +read_nfc()