Changing to 'sidedoor'

This commit is contained in:
Workantile 2015-04-09 13:33:27 +00:00
parent f86911a4d2
commit 5feac037c5
2 changed files with 12 additions and 4 deletions

3
doorrc
View File

@ -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

View File

@ -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)