Skip to content

Commit

Permalink
Set back baud rate quickly after triggering reboot into DFU. If this …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
elcojacobs committed Dec 12, 2015
1 parent 1b92651 commit 970fda1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions utils/flashDfu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 970fda1

Please sign in to comment.