From 49cf68ab63b6e7cde17451ad80823df6f19da485 Mon Sep 17 00:00:00 2001 From: petrucci4prez Date: Tue, 30 May 2017 01:01:30 -0400 Subject: [PATCH] add usb hard reset --- main.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index d73d5f6..8d262a4 100755 --- a/main.py +++ b/main.py @@ -3,13 +3,12 @@ import os, time, signal, traceback, logging import RPi.GPIO as GPIO -from sharedLogging import unmountGluster +from sharedLogging import unmountGluster # this should be first program module +from stateMachine import StateMachine +from auxilary import resetUSBDevice logger = logging.getLogger(__name__) -def printTrace(t): - logger.critical('\n' + t) - def clean(): GPIO.cleanup() @@ -34,10 +33,10 @@ if __name__ == '__main__': GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) + resetUSBDevice('1-1') from notifier import criticalError - from stateMachine import StateMachine stateMachine = StateMachine() # TODO: segfaults are annoying :( @@ -55,10 +54,7 @@ if __name__ == '__main__': except NameError: pass - try: - logger.critical(t) - except NameError: - logger.critical(t) + logger.critical(t) finally: clean()