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