diff --git a/nut/Usb.py b/nut/Usb.py index f522b8ec..11c76a45 100644 --- a/nut/Usb.py +++ b/nut/Usb.py @@ -169,6 +169,7 @@ def getDevice(): time.sleep(1) def daemon(): + dev = None global status Watcher.start() while True: @@ -195,4 +196,9 @@ def is_in_ep(ep): return usb.util.endpoint_direction(ep.bEndpointAddress) == usb poll_commands(in_ep, out_ep) except BaseException as e: Print.error('usb exception: ' + str(e)) + + try: + dev.reset() + except: + pass time.sleep(1)