Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp ota other status_code error (404, 500, ...) (IDFGH-3593) #5537

Closed
flachvr opened this issue Jul 2, 2020 · 0 comments
Closed

esp ota other status_code error (404, 500, ...) (IDFGH-3593) #5537

flachvr opened this issue Jul 2, 2020 · 0 comments

Comments

@flachvr
Copy link

flachvr commented 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):

else if(status_code == HttpStatus_NotFound) {
        ESP_LOGE(TAG, "File not found");
        return ESP_FAIL;
    }

This way the error is returned when casting esp_https_ota_begin and not when casting esp_https_ota_perform.

@github-actions github-actions bot changed the title esp ota other status_code error (404, 500, ...) esp ota other status_code error (404, 500, ...) (IDFGH-3593) Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant