diff --git a/relay.py b/relay.py index dfa48b9..fbc976a 100644 --- a/relay.py +++ b/relay.py @@ -35,18 +35,19 @@ def main(): # print(the_reading) # For testing. if the_reading > 48: # Print for testing. - # print(f"[INFO] Light is on -- {the_reading}.") + print(f"[INFO] Light is on -- {the_reading}.") GPIO.output(relay_pin, GPIO.HIGH) else: # Print for testing. # print(f"[INFO] Light is off -- {the_reading}.") GPIO.output(relay_pin, GPIO.LOW) except KeyboardInterrupt: - print("Keyboard Interrupt: quitting program.") - except: - print("Error updating light reading...") + print("[INFO] KEYBOARD INTERRUPT: quitting program.") + except Exception as e: + print(f"[ERROR] GENERAL EXCEPTION: {e}") finally: - print("Cleaning up GPIO before closing...") + print("[INFO] Terminating relay.py...") + print("[INFO] Cleaning up GPIO before closing...") GPIO.cleanup() if __name__ == "__main__" : diff --git a/startup.sh b/startup.sh index e53751d..b53993b 100755 --- a/startup.sh +++ b/startup.sh @@ -19,7 +19,7 @@ # reliable/consistent behaviour is my preference over "fast start-up # times". -sleep 60 +#sleep 60 logDate=$(date '+%Y-%m-%dT%TZ') logFile="/home/rtrp/logs/startup-logs.txt"