This commit is contained in:
EggMan20339 2024-05-09 21:47:06 -04:00
parent 88e02f1fee
commit 386cbc2c0a
3 changed files with 12 additions and 11 deletions

View File

@ -7,7 +7,7 @@ sudo apt-get install python3-psycopg2 -y
sudo apt-get install python3-fido2 -y
sudo apt-get install python3-nfcpy -y
sudo apt-get install screen -y
#test
sudo apt-get update
sudo apt-get upgrade -y

16
main.py
View File

@ -105,26 +105,28 @@ class CliInteraction(UserInteraction):
print("User Verification required.")
return True
def read_nfc_tag():
try:
clf = nfc.ContactlessFrontend('usb') # Ensure this matches your connection
print("NFC reader initialized.")
clf = nfc.ContactlessFrontend('usb')
tag = clf.connect(rdwr={'on-connect': lambda tag: False})
clf.close()
return tag.identifier if tag else None
except Exception as e:
print("Failed to initialize NFC reader:", e)
print("NFC read error:", e)
return None
while True:
if gpie:
GPIO.output(door, GPIO.LOW)
# GPIO.output(14, GPIO.LOW)
print("Waiting for device...")
badCredentials = False
if gpie:
GPIO.output(redLed, GPIO.HIGH)
while True:
try:
# GPIO.output(14, GPIO.LOW)
nfc_tag = read_nfc_tag()
dev = next(CtapHidDevice.list_devices(), None)
if dev:

View File

@ -2,7 +2,6 @@
sudo cp /user/CNSA/CNSA-276-FP/config.ini /config.bak
sudo rm -R /user/CNSA/CNSA-276-FP
#test2
# Function to check internet connectivity
check_internet_connection() {