simple_ota_example

Zeni241
Posts: 85
Joined: Tue Nov 20, 2018 4:28 am

simple_ota_example

Postby Zeni241 » Thu Feb 14, 2019 12:27 pm

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,

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: simple_ota_example

Postby ESP_igrr » 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. You may check server logs or use Wireshark to check what is being received (and if it is indeed the binary, or something else).

k.ifantidis
Posts: 33
Joined: Wed Mar 28, 2018 6:58 am

Re: simple_ota_example

Postby k.ifantidis » Thu Feb 14, 2019 2:26 pm

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.

Zeni241
Posts: 85
Joined: Tue Nov 20, 2018 4:28 am

Re: simple_ota_example

Postby Zeni241 » Thu Feb 14, 2019 2:43 pm

Thanks a lot friends for response. I will check and post results here.

Zeni241
Posts: 85
Joined: Tue Nov 20, 2018 4:28 am

Re: simple_ota_example

Postby Zeni241 » Sat Feb 16, 2019 11:09 am

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?

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: simple_ota_example

Postby ESP_igrr » Sat Feb 16, 2019 2:19 pm

No, file name is not used for anything, in the simple_ota example at least.

Zeni241
Posts: 85
Joined: Tue Nov 20, 2018 4:28 am

Re: simple_ota_example

Postby Zeni241 » Sat Feb 16, 2019 3:11 pm

Thank you.

Who is online

Users browsing this forum: Baidu [Spider], pmoneta and 142 guests