diff --git a/esp32/main.py b/esp32/main.py index 8936eec..87b2838 100644 --- a/esp32/main.py +++ b/esp32/main.py @@ -36,16 +36,19 @@ while rf is not None: if c == 4: break hash=hashlib.sha256(str("{0:#0{1}x}".format(int(buf),10)+":"+card[6:8]+card[4:6]+card[2:4]+card[0:2])[2:].encode()).digest().hex() + print('Card hash: {0}'.format(hash)) f = open("hashes") for user in f: if(user.strip() == hash): success = True if(success): + print('Known hash, opening door') uart.write("FH") door.value(1) utime.sleep(2) door.value(0) else: + print('Unknown hash, ignoring') uart.write("FS") utime.sleep(2) buf=''