Page 1 of 1

E (10062) esp_ota_ops: OTA image has invalid magic byte (expected 0xE9, saw 0x45)

Posted: Sun Mar 22, 2020 10:43 pm
by sreedhar
HI Guys.

I am getting below error while executing simple OTA. Please help.

I (5772) simple_ota_example: Starting OTA example
I (7482) esp_https_ota: Starting OTA...
I (7482) esp_https_ota: Writing to partition subtype 16 at offset 0x110000
E (10062) esp_ota_ops: OTA image has invalid magic byte (expected 0xE9, saw 0x45)
E (10062) esp_https_ota: Error: esp_ota_write failed! err=0x5379
E (10072) simple_ota_example: Firmware upgrade failed

I am using IDF V4. on ESP32 WROOM 32 .

Regards,
Sreedhar

Re: E (10062) esp_ota_ops: OTA image has invalid magic byte (expected 0xE9, saw 0x45)

Posted: Mon Mar 23, 2020 5:41 pm
by ESP_Sprite
0x45 is an ascii character ('E'). Are you sure that whatever you set as the firmware update endpoint actually serves a valid OTA image?

Re: E (10062) esp_ota_ops: OTA image has invalid magic byte (expected 0xE9, saw 0x45)

Posted: Mon Mar 23, 2020 6:26 pm
by sreedhar
Hi ESP_Sprite,

I copied over the bin file from build folder to endpoint folder. I am using the same example file as new firmware with just an additional printf statement.

Regards,
Sreedhar

Re: E (10062) esp_ota_ops: OTA image has invalid magic byte (expected 0xE9, saw 0x45)

Posted: Mon Mar 23, 2020 9:20 pm
by chegewara
The point its it can be redirecting link with http code 30x, it can be any text returned etc.
Usually issue was when downloaded content was some html with "<" (0x3C). In your case its very unusual, because its "E" (0x45).

Re: E (10062) esp_ota_ops: OTA image has invalid magic byte (expected 0xE9, saw 0x45)

Posted: Sat Mar 28, 2020 11:02 pm
by sreedhar
Hi,
Could anyone guide me how to implement " simple_ota_example" properly.

Regards,
Sreedhar