Page 1 of 1

simple_ota_example

Posted: Thu Feb 14, 2019 12:27 pm
by Zeni241
I am trying my hands at "simple_ota_example" (with my ssid and pw). I uploaded simple_ota.bin file on my server.
But I am getting this error:
esp_ota_ops: OTA image has invalid magic byte (expected 0xE9, saw 0x3c
Erasing the flash didn't solve the problem.

Here is partition table as I see it in mingw32:
I (37) boot: SPI Speed : 40MHz
I (41) boot: SPI Mode : DIO
I (45) boot: SPI Flash Size : 4MB
I (49) boot: Partition Table:
I (52) boot: ## Label Usage Type ST Offset Length
I (60) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (67) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (75) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (82) boot: 3 factory factory app 00 00 00010000 00100000
I (90) boot: 4 ota_0 OTA app 00 10 00110000 00100000
I (97) boot: 5 ota_1 OTA app 00 11 00210000 00100000
I (105) boot: End of partition table
# Espressif ESP32 Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 16K,
otadata, data, ota, 0xd000, 8K,
phy_init, data, phy, 0xf000, 4K,
factory, app, factory, 0x10000, 1M,
ota_0, app, ota_0, 0x110000, 1M,
ota_1, app, ota_1, 0x210000, 1M,

Re: simple_ota_example

Posted: Thu Feb 14, 2019 2:17 pm
by ESP_igrr
0x3c is the less-than sign (<). This may indicate that the server is sending some HTML page as the response. You may check server logs or use Wireshark to check what is being received (and if it is indeed the binary, or something else).

Re: simple_ota_example

Posted: Thu Feb 14, 2019 2:26 pm
by k.ifantidis
That's probably the reason. I had also same problem at the beginning and when the tech fixed the server that I was using everything was working. You can also use wget program to test downloading the file.


Regards, Kostas.

Re: simple_ota_example

Posted: Thu Feb 14, 2019 2:43 pm
by Zeni241
Thanks a lot friends for response. I will check and post results here.

Re: simple_ota_example

Posted: Sat Feb 16, 2019 11:09 am
by Zeni241
ESP_igrr wrote:
Thu Feb 14, 2019 2:17 pm
0x3c is the less-than sign (<). This may indicate that the server is sending some HTML page as the response.
Bullseye Exactly this was the problem. I changed code at server and problem resolved. Thanks.

One more query related to OTA, does changing the name of the .bin file (to be downloaded) has any affect? I mean if, for example, I change the name of hello-world.bin to myexample.bin , will it affect the downloaded program?

Re: simple_ota_example

Posted: Sat Feb 16, 2019 2:19 pm
by ESP_igrr
No, file name is not used for anything, in the simple_ota example at least.

Re: simple_ota_example

Posted: Sat Feb 16, 2019 3:11 pm
by Zeni241
Thank you.