You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all sorry if this question was already asked, I did not find any other issues asking this simple question.
I was implementing OTA in my project and everything works fine but I have a question of "logic" when it comes to checking potentials errors.
I am using esp idf v4.0 on esp32-wroom-32.
However when I provide a wrong file name the function esp_https_ota_begin does not seem to check the error returned by the server. It checks only errors 301, 302 and 401.
It is only seen as an error during esp_https_ota_perform when we realize the magic byte is incorrect because the file was not found.
So my question is : Why can't we check this errors earlier ?
In my logic it would be better and clearer. To do so I added this part of code in the esp_https_ota.c code at line 68 (_http_handle_response_code):
elseif(status_code==HttpStatus_NotFound) {
ESP_LOGE(TAG, "File not found");
returnESP_FAIL;
}
This way the error is returned when casting esp_https_ota_begin and not when casting esp_https_ota_perform.
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
esp ota other status_code error (404, 500, ...)
esp ota other status_code error (404, 500, ...) (IDFGH-3593)
Jul 2, 2020
Hi,
First of all sorry if this question was already asked, I did not find any other issues asking this simple question.
I was implementing OTA in my project and everything works fine but I have a question of "logic" when it comes to checking potentials errors.
I am using esp idf v4.0 on esp32-wroom-32.
However when I provide a wrong file name the function
esp_https_ota_begin
does not seem to check the error returned by the server. It checks only errors 301, 302 and 401.It is only seen as an error during
esp_https_ota_perform
when we realize the magic byte is incorrect because the file was not found.So my question is : Why can't we check this errors earlier ?
In my logic it would be better and clearer. To do so I added this part of code in the
esp_https_ota.c
code at line 68 (_http_handle_response_code
):This way the error is returned when casting
esp_https_ota_begin
and not when castingesp_https_ota_perform
.The text was updated successfully, but these errors were encountered: