From fd1dc24ac6eaddad42fd5d9e9221542d82413db0 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 1 Sep 2019 11:42:37 +0200 Subject: [PATCH] Also accept invalid spelling from Updater Fixes https://github.com/esphome/issues/issues/564 partly. At least the error message will now be a better one. --- esphome/components/ota/ota_component.cpp | 4 ++-- esphome/espota2.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/components/ota/ota_component.cpp b/esphome/components/ota/ota_component.cpp index 7a00c5bb41..6d2a0dd7c3 100644 --- a/esphome/components/ota/ota_component.cpp +++ b/esphome/components/ota/ota_component.cpp @@ -182,11 +182,11 @@ void OTAComponent::handle_() { error_code = OTA_RESPONSE_ERROR_INVALID_BOOTSTRAPPING; goto error; } - if (ss.indexOf("new Flash config wrong") != -1) { + if (ss.indexOf("new Flash config wrong") != -1 || ss.indexOf("new Flash config wsong") != -1) { error_code = OTA_RESPONSE_ERROR_WRONG_NEW_FLASH_CONFIG; goto error; } - if (ss.indexOf("Flash config wrong real") != -1) { + if (ss.indexOf("Flash config wrong real") != -1 || ss.indexOf("Flash config wsong real") != -1) { error_code = OTA_RESPONSE_ERROR_WRONG_CURRENT_FLASH_CONFIG; goto error; } diff --git a/esphome/espota2.py b/esphome/espota2.py index e50f3a4eb7..40417b9ab2 100644 --- a/esphome/espota2.py +++ b/esphome/espota2.py @@ -127,7 +127,8 @@ def check_error(data, expect): "correct 'board' option (esp01_1m always works) and then flash over USB.") if dat == RESPONSE_ERROR_WRONG_NEW_FLASH_CONFIG: raise OTAError("Error: ESP does not have the requested flash size (wrong board). Please " - "choose the correct 'board' option (esp01_1m always works) and try again.") + "choose the correct 'board' option (esp01_1m always works) and try " + "uploading again.") if dat == RESPONSE_ERROR_ESP8266_NOT_ENOUGH_SPACE: raise OTAError("Error: ESP does not have enough space to store OTA file. Please try " "flashing a minimal firmware (remove everything except ota)")