From 970fda18bc5fb1f9f7a14b6bb6abc04d82c0babe Mon Sep 17 00:00:00 2001 From: Elco Jacobs Date: Sat, 12 Dec 2015 13:42:00 +0100 Subject: [PATCH] Set back baud rate quickly after triggering reboot into DFU. If this is done later, for some reason when the serial port is opened later, the old baud rate is still active shortly and triggers a second reboot --- utils/flashDfu.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/flashDfu.py b/utils/flashDfu.py index b2e5e3b..7df353f 100644 --- a/utils/flashDfu.py +++ b/utils/flashDfu.py @@ -104,8 +104,6 @@ if not os.path.exists(system2): print('ERROR: System binary 2 "%s" was not found!' % binFile) exit(1) - - # send quit instruction to all running instances of BrewPi if o in ('-m', '--multi'): multi = True print "Started in multi flash mode" @@ -292,7 +290,7 @@ ser = serial.Serial(port) try: ser.setBaudrate(14400) # this triggers a reboot in DFU mode - time.sleep(1) + ser.setBaudrate(57600) # don't leave serial port at 14400, or a second reboot into DFU will be triggered later ser.close() except ValueError: pass # because device reboots while reconfiguring an exception is thrown, ignore