|
|
|
@ -51,6 +51,7 @@ if __name__ == '__main__':
|
|
|
|
|
event["time"] = time.time()
|
|
|
|
|
event["cardID"] = cardID
|
|
|
|
|
event["name"] = ''
|
|
|
|
|
event["action"] = ''
|
|
|
|
|
try:
|
|
|
|
|
with open('cards/' + cardID + '.json') as card_data:
|
|
|
|
|
data = json.load(card_data)
|
|
|
|
@ -71,6 +72,7 @@ if __name__ == '__main__':
|
|
|
|
|
GPIO.output(pin_config['tools_grn_LED'], GPIO.LOW)
|
|
|
|
|
GPIO.output(pin_config['fridge_red_LED'], GPIO.LOW)
|
|
|
|
|
GPIO.output(pin_config['tools_red_LED'], GPIO.LOW)
|
|
|
|
|
event['action'] = 'tools'
|
|
|
|
|
wait = False
|
|
|
|
|
# Open tools
|
|
|
|
|
subprocess.call("/home/pi/ELAB-RFID-I2C/RPi/i2c_challenge 0x30", shell=True)
|
|
|
|
@ -79,6 +81,7 @@ if __name__ == '__main__':
|
|
|
|
|
GPIO.output(pin_config['tools_grn_LED'], GPIO.LOW)
|
|
|
|
|
GPIO.output(pin_config['fridge_red_LED'], GPIO.LOW)
|
|
|
|
|
GPIO.output(pin_config['tools_red_LED'], GPIO.LOW)
|
|
|
|
|
event['action'] = 'fridge'
|
|
|
|
|
wait = False
|
|
|
|
|
# Open fridge
|
|
|
|
|
subprocess.call("/home/pi/ELAB-RFID-I2C/RPi/i2c_challenge 0x20", shell=True)
|
|
|
|
|