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

Get status code from Esp OTA HTTP (IDFGH-13394) #14302

Closed
LouisMaiaDev opened this issue Aug 5, 2024 · 6 comments
Closed

Get status code from Esp OTA HTTP (IDFGH-13394) #14302

LouisMaiaDev opened this issue Aug 5, 2024 · 6 comments
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@LouisMaiaDev
Copy link

LouisMaiaDev commented Aug 5, 2024

Is your feature request related to a problem?

Running HTTP OTA for Esp, the "esp_https_ota_perform()" function does not return the status code. If you make a firmware image available on a host server and remove it, the function will show the log "File not found" but will continue to try to download the image. In fact, it is possible to notice that even when faced with this error, if you call the "esp_https_ota_get_image_len_read()" function after the "esp_https_ota_perform()" function you will notice that it will continue to return a value greater than 0; this doesn't make any sense, since there is no more image available on the server.

Describe the solution you'd like.

The solution is simple: create the public funtion esp_https_ota_get_status_code(esp_https_ota_handle_t * http_ota_handle) to allow get the last status code logged. This will allow the developer to make precise interventions in their code.

Describe alternatives you've considered.

No response

Additional context.

No response

@LouisMaiaDev LouisMaiaDev added the Type: Feature Request Feature request for IDF label Aug 5, 2024
@LouisMaiaDev LouisMaiaDev changed the title Get status code to Esp OTA HTTP Get status code from Esp OTA HTTP Aug 5, 2024
@github-actions github-actions bot changed the title Get status code from Esp OTA HTTP Get status code from Esp OTA HTTP (IDFGH-13394) Aug 5, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Aug 5, 2024
@JasonYan324
Copy link

focus on this issue, wating for the reslut

@nileshkale123
Copy link
Collaborator

@LouisMaiaDev

Thank you for reporting this issue.

I attempted to reproduce the behavior on my setup by hosting a local Python-based server using python based server but I was unable to replicate the problem.

Could you please share more details about your setup or any specific steps you followed that might help in reproducing the issue? This information will be crucial for us to investigate further.

@LouisMaiaDev
Copy link
Author

LouisMaiaDev commented Aug 25, 2024

Yes, I can!
It's quite simple. Host the Esp firmware image on Google Drive or AWS (which is the way I'm using it) and launch Esp FOTA. If you still cannot reproduce the error, post here and I will publish the image that proves the existence of this error. As a solution, I had to implement the solution mentioned above in Espressif's HAL and this way I was able to intervene and handle this error appropriately.

My version of esp-idf is V5.1.2

I'm using this FOTA model for Esp:
https://github.com/espressif/esp-idf/blob/v5.3/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c

@nileshkale123
Copy link
Collaborator

Hello @LouisMaiaDev ,

Could you please share the respective OTA image? I could not reproduce the issue using the image uploaded to Google Drive, which is approximately 960KB in size.

Additionally, it would be greatly appreciated if you could share the patch detailing the changes you made to the file, as mentioned above.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Sep 5, 2024
@nileshkale123
Copy link
Collaborator

Hi @LouisMaiaDev

I have created a patch to address the issue. Please review it and let me know if this meets your requirements or if any additional changes are needed.

api_to_get_last_status_logged.txt

Thanks.

@LouisMaiaDev
Copy link
Author

Show, good! Very good @nileshkale123 !

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: In Progress Work is in progress labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

4 participants