-->
Page 1 of 6

OTA firmware updates

PostPosted: Fri May 13, 2016 12:47 pm
by dbetz
I'd like to try OTA firmware updates but I'm having trouble building an image. When I type this command:

Code: Select allmake OUTPUT_TYPE=ota


I get this error:

Code: Select allAPPGEN build/httpd.user1.bin
Traceback (most recent call last):
  File "/home/dbetz/esp_iot_sdk_v1.5.2/tools/gen_appbin.py", line 276, in <module>
    gen_appbin()
  File "/home/dbetz/esp_iot_sdk_v1.5.2/tools/gen_appbin.py", line 212, in gen_appbin
    byte3=(((int(flash_size_map)<<4)| int(flash_clk_div))&0xff)
ValueError: invalid literal for int() with base 10: '0xf'


Does anyone know of a fix for this? Am I typing the make command wrong?

Re: OTA firmware updates

PostPosted: Fri May 13, 2016 3:01 pm
by dbetz
Okay, I changed the Makefile to use 15 instead of 0xf and now it seems to work. Looks like you can't set ESP_FLASH_FREQ_DIV to 0xf if you want to make an OTA image.

Re: OTA firmware updates

PostPosted: Fri May 13, 2016 3:30 pm
by dbetz
dbetz wrote:Okay, I changed the Makefile to use 15 instead of 0xf and now it seems to work. Looks like you can't set ESP_FLASH_FREQ_DIV to 0xf if you want to make an OTA image.

With this change and another minor change to add 15:80m to this code from Makefile:
Code: Select allESPTOOL_FREQ=$(call maplookup,$(ESP_FLASH_FREQ_DIV),0:40m 1:26m 2:20m 0xf:80m 15:80m)

I can successfully generate a .ota image and I can load it using the "upgrade the firmware" link on the esp-httpd home page but when it reboots the new image is not loading. Is there something else I need to do to switch over to the new image?

Re: OTA firmware updates

PostPosted: Sat May 14, 2016 11:24 pm
by Sprite_tm
dbetz wrote:
dbetz wrote:Okay, I changed the Makefile to use 15 instead of 0xf and now it seems to work. Looks like you can't set ESP_FLASH_FREQ_DIV to 0xf if you want to make an OTA image.

With this change and another minor change to add 15:80m to this code from Makefile:
Code: Select allESPTOOL_FREQ=$(call maplookup,$(ESP_FLASH_FREQ_DIV),0:40m 1:26m 2:20m 0xf:80m 15:80m)

I can successfully generate a .ota image and I can load it using the "upgrade the firmware" link on the esp-httpd home page but when it reboots the new image is not loading. Is there something else I need to do to switch over to the new image?



Fyi I fixed the 15/0xf thing in Git.

Wrt the ota failure: What is your ESP_SPI_FLASH_SIZE? Can you try what happens when you set it to 1024? I've seen some weirdness in the bootloader with any value other than that.