[Resolved] OTA update in ESP IDF 5

zamek42
Posts: 2
Joined: Sun Jan 28, 2024 7:20 pm

[Resolved] OTA update in ESP IDF 5

Postby zamek42 » Mon Jan 29, 2024 11:40 am

Hi All,

I need OTA refresh in my ESP IDF 5 (master branch) used application. It needs https and I already used a certificate in my application for mqtt communication and there is no problem. I want to used this same server for OTA, but it does not works.

I have a global cert in my code used for mqtt and https like this:

Code: Select all

extern const uint8_t server_cert_pem_start[] asm("_binary_ca_cert_pem_start");
extern const uint8_t server_cert_pem_end[] asm("_binary_ca_cert_pem_end");
and OTA code is coming from example:

Code: Select all

 esp_http_client_config_t config = {
              .url = url,
              .cert_pem = (char *)server_cert_pem_start,
			  .cert_len = server_cert_pem_end-server_cert_pem_start,
              .event_handler = http_event_handler,
			  .transport_type=HTTP_TRANSPORT_OVER_SSL,
              .keep_alive_enable = true
        };

        esp_https_ota_config_t ota_client_config = {
        		.http_config=&config,
        };
It does not works with cert error code.

How can I configure https for OTA in esp 5?
thx
Zamek

zamek42
Posts: 2
Joined: Sun Jan 28, 2024 7:20 pm

Re: OTA update in ESP IDF 5

Postby zamek42 » Wed Feb 14, 2024 7:13 am

finally I found, the problem was that I tried to decrease memory size and I set mbedTLS maximum incoming fragment length to 8192. It needs to be minimum 16384.

Who is online

Users browsing this forum: Bing [Bot] and 103 guests