From 23d5f9f0298c7e57acadfe5ca93b5c2ec3b99b87 Mon Sep 17 00:00:00 2001 From: Chris Davis Date: Fri, 6 Apr 2018 01:39:58 -0500 Subject: [PATCH 1/3] Reverted timeout and added debugging statements --- RebootServer.py | 4 ++++ flask_gpio.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RebootServer.py b/RebootServer.py index e00be32..217866c 100644 --- a/RebootServer.py +++ b/RebootServer.py @@ -74,14 +74,18 @@ def reboot (self): def status (self, q=None): power = not GPIO.input(self.io_in_num) + print "%s, %s" % (self.name, "0") if power: program = self.healthCheck() + print "%s, %s" % (self.name, "1") if program: if q: q.put((self.name, 1)) + print "%s, %s" % (self.name, "2") return(1) else: if q: q.put((self.name, 2)) + print "%s, %s" % (self.name, "3") return(2) # End if/else block diff --git a/flask_gpio.py b/flask_gpio.py index b99f0af..74879c1 100644 --- a/flask_gpio.py +++ b/flask_gpio.py @@ -190,7 +190,7 @@ def statusAll(): # End for for _p in processes: - _p.join(timeout=2) + _p.join() # End for results = {} From 19c057655649a312075ecd5496b671be20ced3d4 Mon Sep 17 00:00:00 2001 From: Chris Davis Date: Fri, 6 Apr 2018 01:42:14 -0500 Subject: [PATCH 2/3] Print bugfix --- RebootServer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RebootServer.py b/RebootServer.py index 217866c..4700629 100644 --- a/RebootServer.py +++ b/RebootServer.py @@ -74,18 +74,18 @@ def reboot (self): def status (self, q=None): power = not GPIO.input(self.io_in_num) - print "%s, %s" % (self.name, "0") + print ("%s, %s" % (self.name, "0")) if power: program = self.healthCheck() - print "%s, %s" % (self.name, "1") + print ("%s, %s" % (self.name, "1")) if program: if q: q.put((self.name, 1)) - print "%s, %s" % (self.name, "2") + print ("%s, %s" % (self.name, "2")) return(1) else: if q: q.put((self.name, 2)) - print "%s, %s" % (self.name, "3") + print ("%s, %s" % (self.name, "3")) return(2) # End if/else block From 3896b62905e12b39a4ce01f5a257b0dc981aeedf Mon Sep 17 00:00:00 2001 From: Chris Davis Date: Fri, 6 Apr 2018 01:46:34 -0500 Subject: [PATCH 3/3] No Idea how, but that fixed it --- RebootServer.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/RebootServer.py b/RebootServer.py index 4700629..b45cf2c 100644 --- a/RebootServer.py +++ b/RebootServer.py @@ -74,23 +74,22 @@ def reboot (self): def status (self, q=None): power = not GPIO.input(self.io_in_num) - print ("%s, %s" % (self.name, "0")) if power: program = self.healthCheck() - print ("%s, %s" % (self.name, "1")) if program: if q: q.put((self.name, 1)) - print ("%s, %s" % (self.name, "2")) + print ("%s, %s" % (self.name, "1")) return(1) else: if q: q.put((self.name, 2)) - print ("%s, %s" % (self.name, "3")) + print ("%s, %s" % (self.name, "2")) return(2) # End if/else block else: if q: q.put((self.name, 0)) + print ("%s, %s" % (self.name, "0")) return(0) # End if/else block # End def