I am trying to update ESP32 OTA using SIM800C module. I am using below API's:
Code: Untitled.c Select all
[Update.begin(total_file_size);
if (Update.write((uint8_t*)json_buff, data_size) != data_size) {
Update.printError(Serial);
}]
If writing completed then call:
[Codebox=c file=Untitled.c][if (total_file_size == total_data_size) {
if (Update.end(true)) { //true to set the size to the current progress
Serial.printf("Update Success: %u\nRebooting...\n", total_data_size);
if (Update.isFinished()) {
Serial.println("Update successfully completed. Rebooting.");
ESP.restart();
} else {
Serial.println("Update not finished? Something went wrong!");
}
} else {
Update.printError(Serial);
}]
But after 4096 writing complete getting wrong magic bytes ERROR.
Please suggest me what should i do now?