ESP8266 Developer Zone The Official ESP8266 Forum 2017-03-22T11:31:14+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=423 2017-03-22T11:31:14+08:00 2017-03-22T11:31:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=11537#p11537 <![CDATA[Re: 自己的 ota upgrade server]]>

Current userbin is user2.bin
This is user1.bin run @ 0x01000

请问,这两句打印信息是调用什么 API 后打印出来的,能否提供相关代码?

你提供的打印信息是不是不完整?

add if0
compile time:Mar 19 2017 14:33:10
SDK Version 2.0.0(656edbf)

在这几句打印信息之前,应该会有我们 SDK 的内部打印信息,打印是运行 user1 还是 user2。
根据你的问题描述,有可能是你的 user2.bin 无法正常运行,boot.bin 在尝试运行 user2 失败后会自动跳回可运行的 user1 执行。
请确认你编译user2时,先执行了 make clean,再选择了和 user1 相同的编译选项。
我们的常见问题列表中“应用”分类下,有关于云端升级的解答,可以作为参考。

Statistics: Posted by ESP_Faye — Wed Mar 22, 2017 11:31 am


]]>
2017-03-19T16:48:45+08:00 2017-03-19T16:48:45+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=11523#p11523 <![CDATA[Re: 自己的 ota upgrade server]]>
MQTT_APP: button press!!!
user_ota_start...
user_ota_updata_check...
[OTA]Server 192.168.0.2:80
update->url GET /bin/gateway/user2.4096.new.6.bin HTTP/1.1
Host: 192.168.0.2:80
Connection: keep-alive
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8


system_upgrade_start
upgrade_connect 37240
[OTA]Upgrading...
upgrade_connect_cb
pusrdata = HTTP/1.1 200 OK
Date: Sun, 19 Mar 2017 06:38:01 GMT
Server: Apache/2.4.23 (Win32) PHP/5.6.25
Last-Modified: Sun, 19 Mar 2017 06:33:17 GMT
ETag: "4c204-54b0f960d8fa6"
Accept-Ranges: bytes
Content-Length: 311812
Connection: close
Content-Type: application/octet-stream


sumlength = 311812
sec_block 77
.............................................................................upgrade_get_sum_disconcb 34472
erase sector=129 ok
......
erase sector=205 ok

ALL=77 sectors erase ok!
upgrade_connect_cb
sumlength = 311812
upgrade file download start.
totallen = 2605
......
totallen = 311812
upgrade file download finished.
flash_crc = 858897310
img_crc = 858897310
upgrade_check
[OTA]success; rebooting!
reboot to use2
state: 5 -> 0 (0)
rm 0
pm close 7
del if0
usl

add if0
compile time:Mar 19 2017 14:33:10
SDK Version 2.0.0(656edbf)
Current userbin is user2.bin
This is user1.bin run @ 0x01000
NETWORK: Init network timer
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt

connected with cxd, channel 1
dhcp client start...
ip:192.168.0.101,mask:255.255.255.0,gw:192.168.0.1
NETWORK: change to network_state_sta_ok

Statistics: Posted by Xuedong — Sun Mar 19, 2017 4:48 pm


]]>
2015-09-15T21:31:12+08:00 2015-09-15T21:31:12+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=3699#p3699 <![CDATA[Re: 自己的 ota upgrade server]]>
Do you can sharing the full example? (zip, GitHub)

Thank you.

Statistics: Posted by Guest — Tue Sep 15, 2015 9:31 pm


]]>
2015-09-01T19:39:49+08:00 2015-09-01T19:39:49+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=3520#p3520 <![CDATA[Re: 自己的 ota upgrade server]]>

Code:

#include "ota_upgrade.h"
#include "upgrade.h"
#include "osapi.h"
#include "mem.h"

struct espconn upgrade_connection;
struct _esp_tcp upgrade_tcp;
struct upgrade_server_info upgrade_server;

static void ICACHE_FLASH_ATTR
check_upgrade_result(void *arg)
{
    struct upgrade_server_info *server = arg;

    if (server->upgrade_flag == true)
    {
        os_printf("Upgraded successfully.\r\n");
        system_upgrade_reboot();
    }
    else
        os_printf("Upgrade failed.\r\n");
}

void ICACHE_FLASH_ATTR
ota_upgrade(remot_info *phost_info)
{
    char user_bin[10] = {0};

    upgrade_connection.proto.tcp = &upgrade_tcp;
    upgrade_connection.type = ESPCONN_TCP;
    upgrade_connection.state = ESPCONN_NONE;

    /* Upgrade server is the TCP client that sent "upgrade\n" to esp8266 */
    os_memcpy(upgrade_tcp.remote_ip, phost_info->remote_ip, 4);
    upgrade_tcp.remote_port = 80;
   
    os_memcpy(upgrade_server.ip, phost_info->remote_ip, 4);
    upgrade_server.port = 80;

    upgrade_server.check_cb = check_upgrade_result;
    upgrade_server.check_times = 120000;

    upgrade_server.url = (uint8_t *)os_zalloc(512);

    if (system_upgrade_userbin_check() == UPGRADE_FW_BIN1)
        os_memcpy(user_bin, "user2.bin", 10);
    else if (system_upgrade_userbin_check() == UPGRADE_FW_BIN2)
        os_memcpy(user_bin, "user1.bin", 10);

    os_sprintf(upgrade_server.url, "GET /ota/%s HTTP/1.0\r\nHost: "IPSTR":%d\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\n\r\n",
            user_bin,
            IP2STR(upgrade_server.ip),
            upgrade_server.port);

    os_printf("OTA upgrade request:\r\n%s\r\n", upgrade_server.url);

    if (!system_upgrade_start(&upgrade_server))
        os_printf("Upgrade already started.\r\n");
}


The command I used to write initial firmware through serial port:

Code:

esptool.py -b 512000 write_flash -ff 80m -fm qio -fs 8m 0x00000 ../bin/boot_v1.2.bin 0x01000 ../bin/upgrade/user1.1024.new.2.bin 0xfc000 ../bin/esp_init_data_default.bin 0xfe000 ../bin/blank.bin

Statistics: Posted by thuwrx10 — Tue Sep 01, 2015 7:39 pm


]]>
2015-06-23T15:45:31+08:00 2015-06-23T15:45:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=2361#p2361 <![CDATA[Re: 自己的 ota upgrade server]]>
How to set up compiling environment http://bbs.espressif.com/viewtopic.php?f=21&t=86

How to compile and download bin files please refer to documentation "2A-ESP8266__IOT_SDK_User_Manual" http://bbs.espressif.com/viewtopic.php?f=7&t=641

Documentation about upgrade is "99C-ESP8266_OTA_Upgrade" http://bbs.espressif.com/viewtopic.php?f=21&t=413

Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Tue Jun 23, 2015 3:45 pm


]]>
2015-06-23T01:44:02+08:00 2015-06-23T01:44:02+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=2345#p2345 <![CDATA[Re: 自己的 ota upgrade server]]> Statistics: Posted by mojhggn — Tue Jun 23, 2015 1:44 am


]]>
2015-06-15T11:05:55+08:00 2015-06-15T11:05:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=2224#p2224 <![CDATA[Re: 自己的 ota upgrade server]]>
Here is a documentation "99C-ESP8266_OTA_Upgrade" introduces upgrade http://bbs.espressif.com/viewtopic.php?f=21&t=413

Sorry that we won't check version info now, we are running user1.bin and downloading user2.bin, because user1.bin is running, if flashing it , the program will crash.
master-device-key.bin is an ID got from Espressif Cloud, so if you needn't Espressif Cloud, you are using your own server, master-device-key.bin is not needed.

Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Mon Jun 15, 2015 11:05 am


]]>
2015-06-11T19:30:58+08:00 2015-06-11T19:30:58+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=2187#p2187 <![CDATA[Re: 自己的 ota upgrade server]]>
can you help me,

When doing OTA upgrade:
How to get feedback/progress indicator for the user how many bytes are transfered? I noticed serial output on debug output only.
Will OTA upgrade fail if version is the same or older then current version? Who has to check? Why not to allow flashing older bin?
Do i need master-device-key.bin when using OTA upgrade on own server?
Where is the difference between master-device-key.bin and getchipID from SDK.

Is esp_init_data_default.bin in your definition a user parameter or a system parameter?
Is it possible to flash the last block in the flash memory 3FF000 on (32mbit) with blank.bin? (i got errors, can not flash this block, same on 4mbit) is it protected?)


Have you tested the whole OTA upgrade thing? I get 5-10% soft-bricked modules after OTA upgrade.
OTA upgrade needs a lot of memory. Should i check available memory before starting OTA upgrade?

Statistics: Posted by SpenZerX — Thu Jun 11, 2015 7:30 pm


]]>
2015-05-11T16:29:35+08:00 2015-05-11T16:29:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1676#p1676 <![CDATA[Re: 自己的 ota upgrade server]]>
目前都使用 normal boot 已經不會當機了,謝謝!

Statistics: Posted by alexchang — Mon May 11, 2015 4:29 pm


]]>
2015-05-11T13:58:23+08:00 2015-05-11T13:58:23+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1672#p1672 <![CDATA[Re: 自己的 ota upgrade server]]>
麻烦提供您的 user1.bin、user2.bin 和 bin upgrade 的下载链接。

“重新開機,會當機” 一般是由于您编译 user2.bin 的方式不正确,应该如下:
编译时,先在 STEP 2 选择 1 ,编译 user1;
make clean 清掉上次编译生成的临时文件;
再次编译,在 STEP 2 选择 2,编译 user2。
compile_user2.jpg

Statistics: Posted by ESP_Faye — Mon May 11, 2015 1:58 pm


]]>
2015-05-10T14:59:13+08:00 2015-05-10T14:59:13+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1667#p1667 <![CDATA[Re: 自己的 ota upgrade server]]>
-------------------------
測試情境換成:
完全重寫 rom ,使用
boot_v1.2.bin
blank.bin
esp_init_data_default.bin
user1.bin
這幾個檔案,接著 ota 升級 user2,升級完(成功)用
system_upgrade_flag_set(2);
system_upgrade_reboot();
重新開機,會當機。
upgrade file download finished.
upgrade_check
reboot to use2
rm match
del if0
bcn 0
del if1
usl
sul 0 0

Statistics: Posted by alexchang — Sun May 10, 2015 2:59 pm


]]>
2015-05-10T15:12:25+08:00 2015-05-10T14:03:00+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1666#p1666 <![CDATA[Re: 自己的 ota upgrade server]]>
測試情境是這樣的:
完全重寫 rom ,使用
boot_v1.3(b3).bin
blank.bin
esp_init_data_default.bin
user1.bin
這幾個檔案。
接著 ota 升級 user2,升級完用 增強模式開機進入 user2,隨後不重啟,馬上繼續 ota 升級 user1,然後就會看到當機的狀況(一開始下載就當了)。

Statistics: Posted by alexchang — Sun May 10, 2015 2:03 pm


]]>
2015-05-10T13:33:35+08:00 2015-05-10T13:33:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1665#p1665 <![CDATA[Re: 自己的 ota upgrade server]]> Statistics: Posted by alexchang — Sun May 10, 2015 1:33 pm


]]>
2015-05-07T15:48:11+08:00 2015-05-07T15:48:11+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1647#p1647 <![CDATA[Re: 自己的 ota upgrade server]]>
please have a look on document "99C-ESP8266-OTA_UPGRADE" here http://bbs.espressif.com/viewtopic.php?f=21&t=413

it seems that you compiled user2.bin in a wrong way.

Statistics: Posted by ESP_Faye — Thu May 07, 2015 3:48 pm


]]>
2015-05-06T10:29:47+08:00 2015-05-06T10:29:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1637#p1637 <![CDATA[Re: 自己的 ota upgrade server]]> 实现一个http下载将bin2放对位置(4KB + (FlashSize) / 2),后执行
system_upgrade_flag_set(2);
system_upgrade_reboot();
完成升级

Statistics: Posted by xyuz — Wed May 06, 2015 10:29 am


]]>
2015-05-05T16:59:37+08:00 2015-05-05T16:59:37+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1631#p1631 <![CDATA[Re: 自己的 ota upgrade server]]> Statistics: Posted by alexchang — Tue May 05, 2015 4:59 pm


]]>
2015-05-05T16:42:16+08:00 2015-05-05T16:42:16+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1630#p1630 <![CDATA[Re: 自己的 ota upgrade server]]>
when running user1.bin , please download user2.bin.

Could you offer your test code and your bin files? I'll download and have a try.

what's your SDK version ?

Statistics: Posted by ESP_Faye — Tue May 05, 2015 4:42 pm


]]>
2015-05-05T16:37:35+08:00 2015-05-05T16:37:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1629#p1629 <![CDATA[Re: 自己的 ota upgrade server]]>
2015-05-05_16-36-30.jpg

Statistics: Posted by alexchang — Tue May 05, 2015 4:37 pm


]]>
2015-05-05T16:28:14+08:00 2015-05-05T16:28:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1628#p1628 <![CDATA[Re: 自己的 ota upgrade server]]>
Please using Espressif Official flash download tool http://bbs.espressif.com/viewtopic.php?f=7&t=25

Select Flash size 8 Mbit on flash download tool according to http://bbs.espressif.com/viewtopic.php?f=10&t=305

Statistics: Posted by ESP_Faye — Tue May 05, 2015 4:28 pm


]]>
2015-05-05T16:18:22+08:00 2015-05-05T16:18:22+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1627#p1627 <![CDATA[Re: 自己的 ota upgrade server]]>
2015-05-05_16-15-48.jpg

Statistics: Posted by alexchang — Tue May 05, 2015 4:18 pm


]]>
2015-05-05T15:11:40+08:00 2015-05-05T15:11:40+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1625#p1625 <![CDATA[Re: 自己的 ota upgrade server]]>
master-device-key.bin is only needed when you need to use Espressif Cloud.

If you are using your own server, master-device-key.bin need not to be written into flash.

You can just download
0x00000 boot_v1.3(b3)
0x01000 user1.1024.new.bin
0xFC000 esp_init_data_default.bin
0xFE000 blank.bin

If your problem is still unsolved, please offer the capture picture of your flash download tool while you burning images into flash.

Statistics: Posted by ESP_Faye — Tue May 05, 2015 3:11 pm


]]>
2015-05-05T15:05:24+08:00 2015-05-05T15:05:24+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1624#p1624 <![CDATA[Re: 自己的 ota upgrade server]]>
Espressif_Faye wrote:
Hi,

If you are using 1024KB or larger flash, please refer to http://bbs.espressif.com/viewtopic.php?f=10&t=305

Please burn blank.bin into flash as initialization.

For example, 1024KB flash, please burn blank.bin into flash 0xFE000 as initialization.


I use 1024KB flash, I did it before, but I will try it again from start, erase the first 1MB with 0xFF
and then rewrite all those blocks with below files:
0x00000 boot_v1.3(b3)
0x3E000 master-device-key.bin
0x01000 user1.1024.new.bin
0xFC000 esp_init_data_default.bin
0xFE000 blank

Statistics: Posted by alexchang — Tue May 05, 2015 3:05 pm


]]>
2015-05-05T15:03:11+08:00 2015-05-05T15:03:11+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1623#p1623 <![CDATA[Re: 自己的 ota upgrade server]]> 我兩種情況都試過,都無法正常使用。

// from suer_esp_platform.c
if (system_upgrade_userbin_check() == UPGRADE_FW_BIN1) {
os_memcpy(user_bin, "user2.bin", 10);
} else if (system_upgrade_userbin_check() == UPGRADE_FW_BIN2) {
os_memcpy(user_bin, "user1.bin", 10);
}

Statistics: Posted by alexchang — Tue May 05, 2015 3:03 pm


]]>
2015-05-05T14:59:09+08:00 2015-05-05T14:59:09+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1622#p1622 <![CDATA[Re: 自己的 ota upgrade server]]>
If you are using 1024KB or larger flash, please refer to http://bbs.espressif.com/viewtopic.php?f=10&t=305

Please burn blank.bin into flash as initialization.

For example, 1024KB flash, please burn blank.bin into flash 0xFE000 as initialization.

If your problem is still unsolved, please offer the capture picture of your flash download tool while you burning images into flash.

Statistics: Posted by ESP_Faye — Tue May 05, 2015 2:59 pm


]]>
2015-05-05T14:39:47+08:00 2015-05-05T14:39:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1620#p1620 <![CDATA[Re: 自己的 ota upgrade server]]> 當機後就開不進去了,我下載的是 user2.bin,不過看起來好像寫到 user1 這個區塊。

server->url 我們設定的 header
GET /download/file/user2.bin HTTP/1.1
Host: 52.68.48.85
Connection: keep-alive
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT.6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36
Accept: */*
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4,et;q=0.2,ja;q=0.2,zh-CN;q=0.2


system_upgrade_start
upgrade_connect
upgrade_connect_cb
GET /download/file/user2.bin HTTP/1.1
Host: 52.68.48.85
Connection: keep-alive
Cache-Control: no-cache
l8upgrade file download start.
totallen = 1452
Fatal exception (9):
epc1=0x40214468, epc2=0x00000000, epc3=0x00000000, excvaddr=0x9b34feb2, depc=0x00000000
Fatal exception (0):
epc1=0x4020194c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x9b34feb2, depc=0x00000000
Fatal exception (0):
epc1=0x4020194c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x9b34feb2, depc=0x00000000
Fatal exception (0):
epc1=0x4020194c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x9b34feb2, depc=0x00000000
Fatal exception (0):
epc1=0x4020194c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x9b34feb2, depc=0x00000000
Fatal exception (0):


server 的封包:
00:00:00.485533 IP (tos 0x0, ttl 64, id 17696, offset 0, flags [DF], proto TCP (6), length 391)
10.0.0.220.80 > 122.116.70.14.49073: tcp 351
0x0000: 4500 0187 4520 4000 4006 28f3 0a00 00dc E...E.@.@.(.....
0x0010: 7a74 460e 0050 bfb1 9f47 556a 0000 1b59 ztF..P...GUj...Y
0x0020: 5018 7540 ccd7 0000 4854 5450 2f31 2e31 P.u@....HTTP/1.1
0x0030: 2032 3030 204f 4b0d 0a58 2d50 6f77 6572 .200.OK..X-Power
0x0040: 6564 2d42 793a 2045 7870 7265 7373 0d0a ed-By:.Express..
0x0050: 436f 6e74 656e 742d 4469 7370 6f73 6974 Content-Disposit
0x0060: 696f 6e3a 2061 7474 6163 686d 656e 743b ion:.attachment;
0x0070: 2066 696c 656e 616d 653d 2275 7365 7232 .filename="user2
0x0080: 2e62 696e 220d 0a41 6363 6570 742d 5261 .bin"..Accept-Ra
0x0090: 6e67 6573 3a20 6279 7465 730d 0a44 6174 nges:.bytes..Dat
0x00a0: 653a 2054 7565 2c20 3035 204d 6179 2032 e:.Tue,.05.May.2
0x00b0: 3031 3520 3036 3a32 353a 3431 2047 4d54 015.06:25:41.GMT
0x00c0: 0d0a 4361 6368 652d 436f 6e74 726f 6c3a ..Cache-Control:
0x00d0: 2070 7562 6c69 632c 206d 6178 2d61 6765 .public,.max-age
0x00e0: 3d30 0d0a 4c61 7374 2d4d 6f64 6966 6965 =0..Last-Modifie
0x00f0: 643a 204d 6f6e 2c20 3034 204d 6179 2032 d:.Mon,.04.May.2
0x0100: 3031 3520 3133 3a34 383a 3534 2047 4d54 015.13:48:54.GMT
0x0110: 0d0a 4554 6167 3a20 572f 2233 3437 3130 ..ETag:.W/"34710
0x0120: 2d37 3338 3930 3436 3731 220d 0a43 6f6e -738904671"..Con
0x0130: 7465 6e74 2d54 7970 653a 2061 7070 6c69 tent-Type:.appli
0x0140: 6361 7469 6f6e 2f6f 6374 6574 2d73 7472 cation/octet-str
0x0150: 6561 6d0d 0a43 6f6e 7465 6e74 2d4c 656e eam..Content-Len
0x0160: 6774 683a 2032 3134 3830 300d 0a43 6f6e gth:.214800..Con
0x0170: 6e65 6374 696f 6e3a 206b 6565 702d 616c nection:.keep-al
0x0180: 6976 650d 0a0d 0a ive....
00:00:05.059336 IP (tos 0x0, ttl 64, id 45064, offset 0, flags [DF], proto TCP (6), length 52)
10.0.0.220.80 > 122.116.70.14.50465: tcp 0
0x0000: 4500 0034 b008 4000 4006 bf5d 0a00 00dc E..4..@.@..]....
0x0010: 7a74 460e 0050 c521 bb1e b520 47bc a030 ztF..P.!....G..0
0x0020: 8010 0077 cb84 0000 0101 050a 47bc a02f ...w........G../
0x0030: 47bc a030 G..0
00:00:02.840933 IP (tos 0x0, ttl 64, id 52819, offset 0, flags [DF], proto TCP (6), length 43)
10.0.0.220.80 > 122.116.70.14.6179: tcp 3
0x0000: 4500 002b ce53 4000 4006 a11b 0a00 00dc E..+.S@.@.......
0x0010: 7a74 460e 0050 1823 85a5 fc92 3175 6831 ztF..P.#....1uh1
0x0020: 5018 7540 cb7b 0000 8101 33 P.u@.{....3
00:00:02.840933 IP (tos 0x0, ttl 64, id 52819, offset 0, flags [DF], proto TCP (6), length 43)
10.0.0.220.80 > 122.116.70.14.6179: tcp 3
0x0000: 4500 002b ce53 4000 4006 a11b 0a00 00dc E..+.S@.@.......
0x0010: 7a74 460e 0050 1823 85a5 fc92 3175 6831 ztF..P.#....1uh1
0x0020: 5018 7540 cb7b 0000 8101 33 P.u@.{....3
00:00:00.108306 IP (tos 0x0, ttl 64, id 26955, offset 0, flags [DF], proto TCP (6), length 43)
10.0.0.220.80 > 122.116.70.14.46613: tcp 3
0x0000: 4500 002b 694b 4000 4006 0624 0a00 00dc E..+iK@.@..$....
0x0010: 7a74 460e 0050 b615 052a 5f7f 0220 9b0f ztF..P...*_.....
0x0020: 5018 7540 cb7b 0000 8101 33 P.u@.{....3
00:00:05.651611 IP (tos 0x0, ttl 64, id 57416, offset 0, flags [DF], proto TCP (6), length 40)
10.0.0.220.80 > 122.116.70.14.50773: tcp 0
0x0000: 4500 0028 e048 4000 4006 8f29 0a00 00dc E..(.H@.@..)....
0x0010: 7a74 460e 0050 c655 193b 321b 8945 4255 ztF..P.U.;2..EBU
0x0020: 5010 007f cb78 0000 P....x..
00:00:00.002390 IP (tos 0x0, ttl 64, id 57417, offset 0, flags [DF], proto TCP (6), length 441)
10.0.0.220.80 > 122.116.70.14.50773: tcp 401
0x0000: 4500 01b9 e049 4000 4006 8d97 0a00 00dc E....I@.@.......
0x0010: 7a74 460e 0050 c655 193b 321b 8945 4255 ztF..P.U.;2..EBU
0x0020: 5018 007f cd09 0000 4854 5450 2f31 2e31 P.......HTTP/1.1
0x0030: 2032 3036 2050 6172 7469 616c 2043 6f6e .206.Partial.Con
0x0040: 7465 6e74 0d0a 582d 506f 7765 7265 642d tent..X-Powered-
0x0050: 4279 3a20 4578 7072 6573 730d 0a43 6f6e By:.Express..Con
0x0060: 7465 6e74 2d44 6973 706f 7369 7469 6f6e tent-Disposition
0x0070: 3a20 6174 7461 6368 6d65 6e74 3b20 6669 :.attachment;.fi
0x0080: 6c65 6e61 6d65 3d22 7573 6572 312e 6269 lename="user1.bi
0x0090: 6e22 0d0a 4163 6365 7074 2d52 616e 6765 n"..Accept-Range
0x00a0: 733a 2062 7974 6573 0d0a 4461 7465 3a20 s:.bytes..Date:.
0x00b0: 5475 652c 2030 3520 4d61 7920 3230 3135 Tue,.05.May.2015
0x00c0: 2030 363a 3237 3a34 3820 474d 540d 0a43 .06:27:48.GMT..C
0x00d0: 6163 6865 2d43 6f6e 7472 6f6c 3a20 7075 ache-Control:.pu
0x00e0: 626c 6963 2c20 6d61 782d 6167 653d 300d blic,.max-age=0.
0x00f0: 0a4c 6173 742d 4d6f 6469 6669 6564 3a20 .Last-Modified:.
0x0100: 4d6f 6e2c 2030 3420 4d61 7920 3230 3135 Mon,.04.May.2015
0x0110: 2031 333a 3530 3a33 3520 474d 540d 0a45 .13:50:35.GMT..E
0x0120: 5461 673a 2057 2f22 3334 3731 302d 3334 Tag:.W/"34710-34
0x0130: 3939 3934 3333 3938 220d 0a43 6f6e 7465 99943398"..Conte
0x0140: 6e74 2d54 7970 653a 2061 7070 6c69 6361 nt-Type:.applica
0x0150: 7469 6f6e 2f6f 6374 6574 2d73 7472 6561 tion/octet-strea
0x0160: 6d0d 0a43 6f6e 7465 6e74 2d52 616e 6765 m..Content-Range
0x0170: 3a20 6279 7465 7320 3131 3631 362d 3131 :.bytes.11616-11
0x0180: 3631 362f 3231 3438 3030 0d0a 436f 6e74 616/214800..Cont
0x0190: 656e 742d 4c65 6e67 7468 3a20 310d 0a43 ent-Length:.1..C
0x01a0: 6f6e 6e65 6374 696f 6e3a 206b 6565 702d onnection:.keep-
0x01b0: 616c 6976 650d 0a0d 0a alive....
00:00:00.066180 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
10.0.0.220.80 > 122.116.70.14.50799: tcp 0
0x0000: 4500 0034 0000 4000 4006 6f66 0a00 00dc E..4..@.@.of....
0x0010: 7a74 460e 0050 c66f bd4a 25d7 3fcc 1e40 ztF..P.o.J%.?..@
0x0020: 8012 7210 cb84 0000 0204 05b4 0101 0402 ..r.............
0x0030: 0103 0308 ....
00:00:00.062536 IP (tos 0x0, ttl 64, id 43375, offset 0, flags [DF], proto TCP (6), length 40)
10.0.0.220.80 > 122.116.70.14.50799: tcp 0
0x0000: 4500 0028 a96f 4000 4006 c602 0a00 00dc E..(.o@.@.......
0x0010: 7a74 460e 0050 c66f bd4a 25d8 3fcc 1ffa ztF..P.o.J%.?...
0x0020: 5010 0077 cb78 0000 P..w.x..
00:00:00.001631 IP (tos 0x0, ttl 64, id 43376, offset 0, flags [DF], proto TCP (6), length 447)
10.0.0.220.80 > 122.116.70.14.50799: tcp 407
0x0000: 4500 01bf a970 4000 4006 c46a 0a00 00dc E....p@.@..j....
0x0010: 7a74 460e 0050 c66f bd4a 25d8 3fcc 1ffa ztF..P.o.J%.?...
0x0020: 5018 0077 cd0f 0000 4854 5450 2f31 2e31 P..w....HTTP/1.1
0x0030: 2032 3036 2050 6172 7469 616c 2043 6f6e .206.Partial.Con
0x0040: 7465 6e74 0d0a 582d 506f 7765 7265 642d tent..X-Powered-
0x0050: 4279 3a20 4578 7072 6573 730d 0a43 6f6e By:.Express..Con
0x0060: 7465 6e74 2d44 6973 706f 7369 7469 6f6e tent-Disposition
0x0070: 3a20 6174 7461 6368 6d65 6e74 3b20 6669 :.attachment;.fi
0x0080: 6c65 6e61 6d65 3d22 7573 6572 312e 6269 lename="user1.bi
0x0090: 6e22 0d0a 4163 6365 7074 2d52 616e 6765 n"..Accept-Range
0x00a0: 733a 2062 7974 6573 0d0a 4461 7465 3a20 s:.bytes..Date:.
0x00b0: 5475 652c 2030 3520 4d61 7920 3230 3135 Tue,.05.May.2015
0x00c0: 2030 363a 3237 3a34 3820 474d 540d 0a43 .06:27:48.GMT..C
0x00d0: 6163 6865 2d43 6f6e 7472 6f6c 3a20 7075 ache-Control:.pu
0x00e0: 626c 6963 2c20 6d61 782d 6167 653d 300d blic,.max-age=0.
0x00f0: 0a4c 6173 742d 4d6f 6469 6669 6564 3a20 .Last-Modified:.
0x0100: 4d6f 6e2c 2030 3420 4d61 7920 3230 3135 Mon,.04.May.2015
0x0110: 2031 333a 3530 3a33 3520 474d 540d 0a45 .13:50:35.GMT..E
0x0120: 5461 673a 2057 2f22 3334 3731 302d 3334 Tag:.W/"34710-34
0x0130: 3939 3934 3333 3938 220d 0a43 6f6e 7465 99943398"..Conte
0x0140: 6e74 2d54 7970 653a 2061 7070 6c69 6361 nt-Type:.applica
0x0150: 7469 6f6e 2f6f 6374 6574 2d73 7472 6561 tion/octet-strea
0x0160: 6d0d 0a43 6f6e 7465 6e74 2d52 616e 6765 m..Content-Range
0x0170: 3a20 6279 7465 7320 3131 3631 362d 3231 :.bytes.11616-21
0x0180: 3437 3939 2f32 3134 3830 300d 0a43 6f6e 4799/214800..Con
0x0190: 7465 6e74 2d4c 656e 6774 683a 2032 3033 tent-Length:.203
0x01a0: 3138 340d 0a43 6f6e 6e65 6374 696f 6e3a 184..Connection:
0x01b0: 206b 6565 702d 616c 6976 650d 0a0d 0a .keep-alive....
00:00:00.000049 IP (tos 0x0, ttl 64, id 43377, offset 0, flags [DF], proto TCP (6), length 2944)
10.0.0.220.80 > 122.116.70.14.50799: tcp 2904
0x0000: 4500 0b80 a971 4000 4006 baa8 0a00 00dc E....q@.@.......
0x0010: 7a74 460e 0050 c66f bd4a 276f 3fcc 1ffa ztF..P.o.J'o?...
0x0020: 5010 0077 d6d0 0000 7cff 42a0 6847 1672 P..w....|.B.hG.r
0x0030: 82a0 6c87 166c 0c04 3096 c016 890f 5c82 ..l..l..0.....\.
0x0040: 2716 7652 c69d 1695 0f82 a064 8716 5d92 '.vR.......d..].
0x0050: a069 9716 5722 c691 16b2 1552 c690 1695 .i..W".....R....
0x0060: 1782 c68d 16f8 1b92 a075 9716 4722 a078 .........u..G".x
0x0070: 2716 4e1b 0cc7 3e05 324c 0062 0d00 cd00 '.N...>.2L.b....
0x0080: 16b6 221b c007 3e02 6240 0046 c0ff 024e .."...>.b@.F...N
0x0090: 0008 51d8 71e8 8120 2cc0 f891 c861 12c1 ..Q.q...,....a..
0x00a0: 300d f04d 061b dd62 0d00 86e2 ff0c 2220 0..M...b......".
0x00b0: 0020 0000 740c a546 0200 4c02 2000 2000 ....t..F..L.....
0x00c0: 0074 1c05 62a0 6c67 940d 1c88 4d0a 4baa .t..b.lg....M.K.
0x00d0: a728 3848 3106 0f00 92a0 6897 9413 0091 .(8H1.....h.....
0x00e0: 041c 824d 0a4b aaa7 a202 8633 0048 3186 ...M.K.....3.H1.
0x00f0: 3400 1c86 4d0a 4baa a726 0448 3106 0500 4...M.K..&.H1...
0x0100: 1c88 4728 012c 4a48 4106 0200 1c89 4729 ..G(.,JHA.....G)
0x0110: 012c 4a48 41a9 014a 4a42 d4ff 4224 3f6d .,JHA..JJB..B$?m
0x0120: 0f2d 0c3d 0e7d 0085 cdff cd02 a801 2c53 .-.=.}........,S
0x0130: 2cdb 2cb7 0696 ffc7 be02 0694 ff32 4c00 ,.,..........2L.
0x0140: 8692 ff47 e011 0bff a61f 0cc7 3e04 2c05 ...G........>.,.
0x0150: 524c 001b cc46 fbff 1c86 4d0a 4baa a726 RL...F....M.K..&
0x0160: 0408 3106 0200 1c88 4728 012c 4a08 41c7 ..1.....G(.,J.A.
0x0170: 3e0a 0a9a 92d9 ff92 293f 924c 001b cc0b >.......)?.L....
0x0180: ffe6 1f02 0682 ffc7 3ef2 2c00 024c 0086 ........>.,..L..
0x0190: faff 1c82 4722 012c 4a48 414a faf2 dfff ....G".,JHAJ....
0x01a0: f22f 3f62 0d00 d6af 00f0 f060 1c02 2000 ./?b.......`....
0x01b0: 2000 0074 869c ff0c 85c6 c1ff 1c86 4726 ...t..........G&
0x01c0: 012c 4a48 414a 4a42 d4ff 4214 7ea9 0100 .,JHAJJB..B.~...
0x01d0: 8411 8080 3190 4893 c6d0 ff4d 0a1c 854b ....1.H....M...K
0x01e0: aa66 0f09 0c8f 0c12 2000 2000 0074 a725 .f...........t.%
0x01f0: 0648 31a9 0186 0200 1c86 4726 012c 4a48 .H1.......G&.,JH
檔案內容就略過了

Statistics: Posted by alexchang — Tue May 05, 2015 2:39 pm


]]>
2015-05-05T13:45:11+08:00 2015-05-05T13:45:11+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1619#p1619 <![CDATA[Re: 自己的 ota upgrade server]]>
Please have a try with this demo.

Notice that when running user1.bin, you need to download user2.bin; when running user2.bin, we download user1.bin.
upgrade_demo.zip

Statistics: Posted by ESP_Faye — Tue May 05, 2015 1:45 pm


]]>
2015-05-05T11:31:25+08:00 2015-05-05T11:31:25+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1618#p1618 <![CDATA[Re: 自己的 ota upgrade server]]> http://52.68.48.85/download/file/user2.1024.new.bin
才對,因為目前是在 user1,正在執行中。

等了很久直到 cb 被呼叫還是 server->upgrade_flag == false

Statistics: Posted by alexchang — Tue May 05, 2015 11:31 am


]]>
2015-05-04T23:16:39+08:00 2015-05-04T23:16:39+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1617#p1617 <![CDATA[Re: 自己的 ota upgrade server]]> http://52.68.48.85/download/file/user1.1024.new.bin

試了很久很多次都是錯誤:
http://52.68.48.85/download/file/user1.1024.new.bin
system_upgrade_start
upgrade_connect
upgrade_check
user_esp_platform_upgrade_failed
Fatal exception (9):
epc1=0x40100632, epc2=0x00000000, epc3=0x00000000, excvaddr=0x3ffe9d9a, depc=0x00000000
rm match
del if0
bcn 0
del if1
usl
sul 0 0

Statistics: Posted by alexchang — Mon May 04, 2015 11:16 pm


]]>
2015-05-04T18:50:33+08:00 2015-05-04T18:50:33+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1611#p1611 <![CDATA[Re: 自己的 ota upgrade server]]>
這一段我知道,也清楚函數怎麼呼叫與使用 ^^"

我想瞭解的是,如果我要從自己的 apache/php 或是 nodejs 主機下載升級的 rom ,我要提供的是不是直接就是一個檔案的下載點?

Statistics: Posted by alexchang — Mon May 04, 2015 6:50 pm


]]>
2015-05-04T15:23:22+08:00 2015-05-04T15:23:22+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1607#p1607 <![CDATA[Re: 自己的 ota upgrade server]]>
struct upgrade_server_info {
uint8 ip[4]; // server ip
uint16 port; // server port

uint8 upgrade_flag; // need not set

uint8 pre_version[16]; // need not set
uint8 upgrade_version[16]; // need not set

uint32 check_times; // timeout,unit:second
uint8 *url; // url of bin file need to be download

upgrade_states_check_callback check_cb; // download callback
struct espconn *pespconn; // need not set unless using Espressif Cloud
};

Statistics: Posted by ESP_Faye — Mon May 04, 2015 3:23 pm


]]>
2015-04-29T21:20:47+08:00 2015-04-29T21:20:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=423&p=1590#p1590 <![CDATA[自己的 ota upgrade server]]>
struct upgrade_server_info {
uint8 ip[4];
uint16 port;

uint8 upgrade_flag;

uint8 pre_version[16];
uint8 upgrade_version[16];

uint32 check_times;
uint8 *url;

upgrade_states_check_callback check_cb;
struct espconn *pespconn;
};

Statistics: Posted by alexchang — Wed Apr 29, 2015 9:20 pm


]]>