From 92119ef5d231ffa26b9498fd63b441dfa9229fc5 Mon Sep 17 00:00:00 2001 From: Jared Date: Mon, 14 Nov 2016 16:09:33 +0000 Subject: [PATCH] More fixes --- cardlistener.py | 6 +++--- pin_config.json | 4 ++-- start.sh | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) mode change 100644 => 100755 start.sh diff --git a/cardlistener.py b/cardlistener.py index c91839d..614bcdc 100644 --- a/cardlistener.py +++ b/cardlistener.py @@ -3,14 +3,14 @@ import RPi.GPIO as GPIO import keyboard if __name__ == '__main__': - pin_config = {} + pin_config = [] with open('pin_config.json') as pin_config_stream: pin_config = json.load(pin_config_stream) if pin_config['mode'] == 'BOARD': GPIO.setmode(GPIO.BOARD) else: GPIO.setmode(GPIO.BCM) - GPIO.setup(pin_config['frigde_btn'], GPIO.IN, pull_up_down=GPIO.PUD_UP) + GPIO.setup(pin_config['fridge_btn'], GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(pin_config['tools_btn'], GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(pin_config['fridge_red_LED'], GPIO.OUT) GPIO.setup(pin_config['fridge_grn_LED'], GPIO.OUT) @@ -70,4 +70,4 @@ if __name__ == '__main__': history.append(event) with open('history.json', 'w') as outfile: json.dump(history, outfile) - \ No newline at end of file + diff --git a/pin_config.json b/pin_config.json index ee43f26..d35e79e 100644 --- a/pin_config.json +++ b/pin_config.json @@ -5,5 +5,5 @@ "fridge_red_LED" : 31, "fridge_grn_LED" : 33, "tools_red_LED" : 35, - "tools_grn_LED" : 37, -} \ No newline at end of file + "tools_grn_LED" : 37 +} diff --git a/start.sh b/start.sh old mode 100644 new mode 100755 index d259d34..1ec5ffd --- a/start.sh +++ b/start.sh @@ -1,3 +1,5 @@ #!/bin/sh +cd /home/pi/ELAB-RFID-locks export FLASK_APP=server.py +sudo python cardlistener.py& flask run