From 8fc5341336490283493843592cc99897ca07cb97 Mon Sep 17 00:00:00 2001 From: gordon-zhao Date: Wed, 20 Jan 2021 02:44:07 +0800 Subject: [PATCH] BugFix: Upload speed fallback logic (#44) - Fix the problem that the error from detect_flash_size() doesn't get caught (because detect_flash_size() also tries to catch esptool.FatalError, and it will raise the error again as EsphomeflasherError) - Fix typo --- esphomeflasher/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphomeflasher/__main__.py b/esphomeflasher/__main__.py index 571c6c9..cc7c09d 100644 --- a/esphomeflasher/__main__.py +++ b/esphomeflasher/__main__.py @@ -123,9 +123,9 @@ def run_esphomeflasher(argv): # Check if the higher baud rate works try: flash_size = detect_flash_size(stub_chip) - except esptool.FatalError as err: + except EsphomeflasherError as err: # Go back to old baud rate by recreating chip instance - print("Chip does not support baud rate {}, changing to 115200".format(args.upload_baud_Rate)) + print("Chip does not support baud rate {}, changing to 115200".format(args.upload_baud_rate)) stub_chip._port.close() chip = detect_chip(port, args.esp8266, args.esp32) stub_chip = chip_run_stub(chip)