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

sreedhar
Posts: 6
Joined: Fri Mar 20, 2020 8:50 pm

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

Postby sreedhar » Sun Mar 22, 2020 10:43 pm

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

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Mon Mar 23, 2020 5:41 pm

0x45 is an ascii character ('E'). Are you sure that whatever you set as the firmware update endpoint actually serves a valid OTA image?

sreedhar
Posts: 6
Joined: Fri Mar 20, 2020 8:50 pm

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

Postby sreedhar » Mon Mar 23, 2020 6:26 pm

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

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

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

Postby chegewara » Mon Mar 23, 2020 9:20 pm

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).

sreedhar
Posts: 6
Joined: Fri Mar 20, 2020 8:50 pm

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

Postby sreedhar » Sat Mar 28, 2020 11:02 pm

Hi,
Could anyone guide me how to implement " simple_ota_example" properly.

Regards,
Sreedhar

Who is online

Users browsing this forum: No registered users and 67 guests