Skip to content

Commit 0357be1

Browse files
committed
Error=ALARM
1 parent a2509f1 commit 0357be1

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

GPIOClientSide.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def arm(self):
3737

3838
def alarm(self):
3939
GPIO.output(self.ledRood, True)
40-
print("Rood True")
40+
#print("Rood True") #DEBUG
4141
time.sleep(1)
4242
GPIO.output(self.ledRood, False)
43-
print("Rood False")
43+
#print("Rood False") #DEBUG
4444
time.sleep(1)
4545

4646
def DoButtonCheck(self):

csn_cli_client.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,31 @@ def ButtonController():
9999
while True:
100100
if gpio_controller.breached and gpio_controller.armed:
101101
#print("AlarmLoop")
102+
gpio_controller.alarm()
102103
if status != 1:
103-
TriggerAlarm(1)
104104
status = 1
105-
gpio_controller.alarm()
105+
try:
106+
TriggerAlarm(1)
107+
except:
108+
continue
106109
elif gpio_controller.armed:
107110
#print("ArmLoop")
111+
gpio_controller.arm()
108112
if status != 0:
109-
Arm()
110113
status = 0
111-
gpio_controller.arm()
114+
try:
115+
Arm()
116+
except:
117+
continue
112118
elif gpio_controller.armed == False:
113119
#print("DisarmedLoop")
120+
gpio_controller.disarm()
114121
if status != 2:
115-
Disarm()
116122
status = 2
117-
gpio_controller.disarm()
123+
try:
124+
Disarm()
125+
except:
126+
continue
118127

119128
_thread.start_new_thread(ButtonController, ())
120129
_thread.start_new_thread(gpio_controller.DoButtonCheck, ())
@@ -168,5 +177,7 @@ def ButtonController():
168177
else:
169178
connected = False
170179
except:
171-
print("Error receiving data")
172-
print(sys.exc_traceback())
180+
gpio_controller.armed = True
181+
gpio_controller.breached = True
182+
print("A LOT of possible errors here.")
183+
#print(sys.exc_traceback())

0 commit comments

Comments
 (0)