User avatar
By hxy513696765
#65132 使用espconn_send函数发送自己定义的JSON数据(大约317 byte的字符串),发送大约65次左右espconn_send后返回ESPCONN_MEM(Out of memory)的错误导致芯片复位,附件上传的是我整个的源码和编译完成后的文件。

**********************************************************************
* “eagle.dump”文件请见本压缩文件解压后的路径TCP_Server_Demo\outbin\eagle.dump *
**********************************************************************

重复步骤:
1、上电ESP8266(程序设置为静态IP:192,168,1,77)小板连接无线路由器(SSID:Test WiFi PASSWORD:12345678),无线路由器Gateway IP(192,168,1,60)

IP4_ADDR(&info.ip,192,168,1,77);
IP4_ADDR(&info.gw,192,168,1,60);
IP4_ADDR(&info.netmask,255,255,255,0);

wifi_station_dhcpc_stop();
wifi_set_ip_info(STATION_IF,&info); //设置sta模式的IP

2、使用TCP调试助手通过80端口Client小板(ESP8266)
1、TCP调试助手必须和ESP8266在同一个局域网下,
2、设置TCP调试助手的通讯模式为TCP Client
3、设置TCP调试助手的远程主机地址为192.168.1.77(ESP8266的IP地址)端口为80
4、TCP助手Client连接ESP8266串口会打印消息,根据我加入的串口调试信息大约发送大约65次左右espconn_send返回ESPCONN_MEM错误返回值导致芯片复位。

代码(在附件里)请见user_main.c 的169行:
printf("----------------------\n TCP Send Count:%d\n espconn_send return %d\n",pa->temp,espconn_send(pTask_TCP->TCP_SERVER_STRUCT,TCP_SEND_STRING,strlen(TCP_SEND_STRING)));

串口打印的数据如下:
(TCP Send Count:后面的值是espconn_send发送的次数;espconn_send return后面的值是espconn_send函数的返回值)
----------------------
TCP Send Count:62
espconn_send return 0
----------------------
TCP Send Count:63
espconn_send return 0
----------------------
TCP Send Count:64
espconn_send return -1
----------------------
TCP Send Count:65
espconn_send return -1
----------------------
TCP Send Count:66
espconn_send return -1
Fatal exception (28):
epc1=0x4000bf80
epc2=0x00000000
epc3=0x40105b0b
epcvaddr=0x00000000
depc=0x00000000
rtn_add=0x40002ad0
?
ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 26044, room 16
tail 12
chksum 0x3e
ho 0 tail 12 room 4
load 0x3ffe8000, len 2152, room 12
tail 12
chksum 0x22
ho 0 tail 12 room 4
load 0x3ffe8870, len 2696, room 12
tail 12
chksum 0xd2
csum 0xd2
You do not have the required permissions to view the files attached to this post.