system_upgrade return false,why?

huafan
Posts: 32
Joined: Sun Mar 15, 2015 2:30 pm

system_upgrade return false,why?

Postby huafan » Wed Apr 08, 2015 12:04 pm

system_upgrade function,return false,why?

log:
POST /upgrade?command=start& HTTP/1.1
Host: 192.168.4.1:80
Connection: Keep-Alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 SE 2.X MetaSr 1.0
Accept-Encoding: gzip, deflate

We have a POST request.
local upgrade start
webserver's 192.168.4.2:65417 disconnect
upgrade file download start.
system_upgrade false
system_upgrade false
system_upgrade false
system_upgrade false
.......
upgrade file download finished.
local upgrade success
webserver's 192.168.4.2:65430 disconnect
system upgrade deinit


code:
bres = system_upgrade(pusrdata, length);
if(bres == false){
os_printf("system_upgrade false\r\n");
}

use HTTP update code failed.
how to fix this error? thank you.

ESP_Faye
Posts: 1642
Joined: Mon Oct 27, 2014 11:08 am

Re: system_upgrade return false,why?

Postby ESP_Faye » Thu Apr 09, 2015 8:44 pm

Hi,

Sorry that we can't replicate your problem, could you please offer the full test code ?

huafan
Posts: 32
Joined: Sun Mar 15, 2015 2:30 pm

Re: system_upgrade return false,why?

Postby huafan » Fri Apr 10, 2015 11:36 am

Espressif_Faye wrote:Hi,

Sorry that we can't replicate your problem, could you please offer the full test code ?



I am sorry,Maybe my problem.
升级的时候使用更新的文件是合成后的文件500多KB, ESP8266程序是在外部的FLASH执行的, 不能自己擦除自己. 升级的文件应该是user1.bin 或者 user2.bin.
失败可能是文件太大了,超出擦写的范围引起的.

但是 我想问如何使用 SDK V1.0.0 IOT demo中的 WEB接口实现程序升级咧?
使用 curl命令开启下载
curl -X POST http://192.168.4.1/upgrade?command=start
使用 curl命令传输文件 user2.bin
curl -F file=@Share/user2.bin http://192.168.4.1

结果:
升级没有成功,0x41000 地方出现乱码

LOG:
POST /upgrade?command=start HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.4.1
Accept: */*

We have a POST request.
local upgrade start
spi_flash_read 0x41000 0D0D0D0D0D0D0D0D
webserver's 192.168.4.2:54375 disconnect
LED LINK
upgrade file download start.
upgrade file download finished.
spi_flash_read 0x41000 0D0D0D0D0D0D0D0D
local upgrade success
webserver's 192.168.4.2:54382 disconnect
system upgrade deinit
rm match
reconnect
scandone
add 0
aid 9
cnt
station: 58:91:cf:28:3e:e9 join, AID = 1

connected with HFQL, channel 1
dhcp client start...
LED LINK
ip:192.168.1.125,mask:255.255.255.0,gw:192.168.1.1
station: 58:91:cf:28:3e:e9 leave, AID = 1
rm match


麻烦看下,谢谢了.

Who is online

Users browsing this forum: No registered users and 5 guests