From de23e91533f50602c058160ea0560c851ee3f496 Mon Sep 17 00:00:00 2001 From: Level2 DoorBuzz Date: Fri, 6 May 2016 20:23:01 +0200 Subject: [PATCH] pushing latest changes before doorbuzz dies completely" --- buzzctrl.sh | 9 ++++----- phone_notification_client.sh | 6 +++--- setneocolor.py | 3 ++- shutdownbutton.py | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/buzzctrl.sh b/buzzctrl.sh index 815b7b2..8d19030 100755 --- a/buzzctrl.sh +++ b/buzzctrl.sh @@ -8,7 +8,6 @@ cd $(dirname "$0") showleds() { ./redi.sh <1' do - ledcolor 0 255 0 - sleep 0.9 - ledcolor 0 255 255 - sleep 0.1 + ledcolor 0 255 0 +# sleep 0.2 + ledcolor 0 255 255 +# sleep 0.2 done fi logger $0 "button push action finished" diff --git a/phone_notification_client.sh b/phone_notification_client.sh index a5de22d..8424518 100755 --- a/phone_notification_client.sh +++ b/phone_notification_client.sh @@ -13,7 +13,7 @@ do sleep 1 while true do - read -t 1 status <&"${COPROC[0]}" + read -t 1 status <&"${COPROC[0]}" 2>/dev/null ret=$? if [ $ret -eq 1 ] # no more coprocess then @@ -56,10 +56,10 @@ do fi logger $0 "phone status change detected" if [ "$new_status" -eq 0 ]; then - echo "neoaction=flash" | ./redi.sh + printf "neoaction=flash\nvalid=yes\n" | ./redi.sh echo "flashon" >&"${COPROC[1]}" else - echo "neoaction=pulse" | ./redi.sh + printf "neoaction=pulse\nvalid=yes\n" | ./redi.sh echo "flashoff" >&"${COPROC[1]}" fi # echo $new_status > ${run_file} diff --git a/setneocolor.py b/setneocolor.py index 0564a6b..1451942 100755 --- a/setneocolor.py +++ b/setneocolor.py @@ -66,10 +66,11 @@ if __name__ == '__main__': valid="yes" if ( valid != "yes" ): continue + myredis.set('valid','no') if(action == "set"): print "Color set to: ",r,g,b for i in range(0,LED_COUNT): - strip.setPixelColor(i, Color(r,g,b)) + strip.setPixelColor(i, Color(g,r,b)) showit() if(action == "number"): tmp=myredis.get('neovalue') diff --git a/shutdownbutton.py b/shutdownbutton.py index 6a820cd..d3018ec 100644 --- a/shutdownbutton.py +++ b/shutdownbutton.py @@ -10,7 +10,7 @@ import os GPIO.setmode(GPIO.BCM) GPIO.setup(buttonpin, GPIO.IN, pull_up_down=GPIO.PUD_UP) - +exit while True: print "waiting..." os.system('logger shutdownbutton waiting for press...') @@ -18,7 +18,7 @@ while True: GPIO.wait_for_edge(buttonpin, GPIO.FALLING) print('Button Pressed') os.system('logger shutdownbutton pressen. bye bye') - os.system("shutdown now -h") + # os.system("shutdown now -h") except KeyboardInterrupt: GPIO.cleanup() # clean up GPIO on CTRL+C exit GPIO.cleanup() #