esp_tls_conn_read bad data

campestring
Posts: 17
Joined: Mon Dec 21, 2020 10:29 am

esp_tls_conn_read bad data

Postby campestring » Wed Jan 26, 2022 7:15 am

Hello everyone,
I have trouble with https request,
I have bad data sometimes between buffer read.

len = sizeof(buf) - 1;
memset(buf, 0, sizeof(buf));
ret = esp_tls_conn_read(tls, (char *)buf, len);

I am trying to received a binary file for ota. but sometimes ret < len and I have bad data the next read so my binary is corrupted...
Any idea ? it looks like the error appears at the same place each time. If I copy paste my request in a browser the file is downloaded correctly...
Have a good day.
Arnaud
Last edited by campestring on Mon Feb 28, 2022 11:26 am, edited 1 time in total.

ESP_Mahavir
Posts: 188
Joined: Wed Jan 24, 2018 6:51 am

Re: esp_tls_conn_read bad data

Postby ESP_Mahavir » Thu Feb 03, 2022 4:12 pm

Could you please share your application code? Please take a look at https://github.com/espressif/esp-idf/bl ... ple_main.c as starting point here.

campestring
Posts: 17
Joined: Mon Dec 21, 2020 10:29 am

Re: esp_tls_conn_read bad data

Postby campestring » Wed Mar 16, 2022 7:49 am

Thank you I solved the problem, the problem came from the server not the ESP32. Have a good day !

Who is online

Users browsing this forum: No registered users and 89 guests