#!/usr/bin/env python from rfid import RfidKeypad from time import sleep import helpers import pdb if __name__ == "__main__": rfid = RfidKeypad() authList = helpers.loadAuthList() loop = True while loop: try: rfidKey = rfid.getRfid() if rfidKey: # pdb.set_trace() helpers.logAccess(rfidKey) print rfidKey pin = helpers.getPin(rfid) if (rfidKey and pin): isAuth = helpers.isAuthed(authList,rfidKey,pin) if (isAuth): rfid.openDoorLock() rfidKey = '' else: rfid.flashRed() rfidKey = ''
#!/usr/bin/env python from rfid import RfidKeypad from time import sleep import helpers import pdb if __name__ == "__main__": rfid = RfidKeypad() authList = helpers.loadAuthList() loop = True while loop: try: rfidKey = rfid.getRfid() if rfidKey: # pdb.set_trace() helpers.logAccess(rfidKey) print rfidKey pin = helpers.getPin(rfid) if (rfidKey and pin): isAuth = helpers.isAuthed(authList, rfidKey, pin) if (isAuth): rfid.openDoorLock() rfidKey = '' else: rfid.flashRed() rfidKey = ''
#!/usr/bin/env python from rfid import RfidKeypad from time import sleep import helpers if __name__ == "__main__": rfid = RfidKeypad() print "Enter the user name: " username = raw_input() print "Username = %s\n" % username rfidKey = '' pin1 = '' pin2 = '' pinsMatch = False try: print "Scan RFID" while (rfidKey == ''): rfidKey = rfid.getRfid() sleep(0.2) print "RFID read as: %s\n" % rfidKey while (pinsMatch == False): print "Enter Pin: " pin1 = helpers.getPin(rfid,True) print "Enter Pin Again: " pin2 = helpers.getPin(rfid,True) if pin1 == pin2 and pin1 != '':