Changing to 'sidedoor'
This commit is contained in:
parent
f86911a4d2
commit
5feac037c5
3
doorrc
3
doorrc
|
@ -1,6 +1,7 @@
|
|||
|
||||
# Name of this Raspberry Pi unit
|
||||
CONTROLLER="deadbeef01"
|
||||
#CONTROLLER="deadbeef01"
|
||||
CONTROLLER="sidedoor"
|
||||
|
||||
# Server to send requests to
|
||||
SERVER = "http://openings.workantile.com/access/" + CONTROLLER
|
||||
|
|
13
doors.py
13
doors.py
|
@ -99,13 +99,20 @@ import serial
|
|||
|
||||
RFID_SERIAL = serial.Serial(RFID_PATH, 2400, timeout=1)
|
||||
|
||||
while True:
|
||||
def read_rfid():
|
||||
string = RFID_SERIAL.read(12)
|
||||
if len(string) == 0:
|
||||
print("No tag read")
|
||||
continue
|
||||
#continue
|
||||
else:
|
||||
key = string[1:11] #exclude start x0A and stop x0D bytes
|
||||
key = string[1:11].decode() #exclude start x0A and stop x0D bytes
|
||||
print(key)
|
||||
verify_key(key)
|
||||
RFID_SERIAL.flushInput() # ignore errors, no data
|
||||
|
||||
|
||||
while True:
|
||||
try:
|
||||
read_rfid()
|
||||
except Exception(e):
|
||||
print(e)
|
||||
|
|
Loading…
Reference in New Issue