Does anyone have any idea how to add/send custom headers when making an OTA firmware request?
My custom firmware update server requires some custom information from the ESP32 before it pushes a firmware/SPIFFS bin...but I cant figure out how to adapt/slip in custom headers simultaneously with the OTA process.
My project originally used the Arduino httpUpdate/OTA library, and it was really easy to add/send additional custom http headers before a firmware update request.
However I have since migrated to using ESP-IDF (v3.3), and cant figure out how to adapt/modify the IDF OTA example code to have the ESP32 send custom headers right before the OTA firmware request...
Add custom headers to OTA update
Add custom headers to OTA update
Last edited by dmaxben on Thu May 21, 2020 10:40 pm, edited 1 time in total.
-
- Posts: 28
- Joined: Thu May 30, 2019 12:05 pm
Re: Add custom headers to OTA update
If I understand well, the method/function
esp_http_client_set_header(...)
base on esp_http_client and used a param whis is type esp_http_client_handle_t
but functions esp_https_ota_get_img_desc(...) or
esp_https_ota_perform(...)
used a param https_ota_handle_t
and this a diffrent object/type
Am I right?
If I uderstand well, in <esp_http_client> module we have one of the first step like:
client esp_http_client_handle_t esp_http_client_init(const esp_http_client_config_t *config);
and function esp_http_client_set_header(...) modify header before we sent anything,
esp_http_client_set_header(...)
base on esp_http_client and used a param whis is type esp_http_client_handle_t
but functions esp_https_ota_get_img_desc(...) or
esp_https_ota_perform(...)
used a param https_ota_handle_t
and this a diffrent object/type
Am I right?
If I uderstand well, in <esp_http_client> module we have one of the first step like:
client esp_http_client_handle_t esp_http_client_init(const esp_http_client_config_t *config);
and function esp_http_client_set_header(...) modify header before we sent anything,
-
- Posts: 28
- Joined: Thu May 30, 2019 12:05 pm
Re: Add custom headers to OTA update
Thank you, indeed Callback solve this aspect.
Who is online
Users browsing this forum: Google [Bot] and 120 guests