Great work. Thanks again for your effort to resolve that issue.elie_daan wrote: ↑Wed Jul 10, 2019 9:25 amHello,
Thanks you Ritesh for your help. Finally I resolved the problem. It was always writing at the beginning of the partition. I had to implement a offset because my buffer was 1Kb.
Code: Select all
int offset=0; /*deal with all receive packet*/ while (1) { int data_read = esp_http_client_read(client, ota_write_data, BUFFSIZE); if (data_read < 0) { ESP_LOGE(TAG, "Error: SSL data read error"); http_cleanup(client); task_fatal_error(); } else if (data_read > 0) { /* 3 : WRITE SPIFFS PARTITION */ err= esp_partition_write(spiffs_partition,offset,(const void *)ota_write_data, data_read); if (err != ESP_OK) { http_cleanup(client); task_fatal_error(); } offset=offset+1024;
[SOLVED]Load spiffs_image.img after OTA
Re: Load spiffs_image.img after OTA
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: [SOLVED]Load spiffs_image.img after OTA
Code: Select all
esp_partition_write(spiffs_partition,offset,(const void *)ota_write_data, data_read);
So
Code: Select all
offset += data_read
Re: [SOLVED]Load spiffs_image.img after OTA
Thank you for this post. I needed to update SPIFFS from OTA and I managed to do it thanks to you.
You may find the code for Arduino IDE below. I took most of code form this post to make it.
https://github.com/pedros89/ESP32-OTA-u ... th-Arduino
For me it works great. Bye!
You may find the code for Arduino IDE below. I took most of code form this post to make it.
https://github.com/pedros89/ESP32-OTA-u ... th-Arduino
For me it works great. Bye!
Re: [SOLVED]Load spiffs_image.img after OTA
Great. Thanks for putting details with link which can be helpful for others as wellpedros89 wrote: ↑Tue Aug 03, 2021 9:37 amThank you for this post. I needed to update SPIFFS from OTA and I managed to do it thanks to you.
You may find the code for Arduino IDE below. I took most of code form this post to make it.
https://github.com/pedros89/ESP32-OTA-u ... th-Arduino
For me it works great. Bye!
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: sirOwlBeak and 69 guests