求助,tcp长连接,发送数据卡在ESPCONN_WRITE状态

hjy7229
Posts: 1
Joined: Wed Aug 19, 2020 11:33 pm

求助,tcp长连接,发送数据卡在ESPCONN_WRITE状态

Postby hjy7229 » Sat Sep 26, 2020 10:43 am

使用ESP8266和TCP服务器通信,每隔一分钟会向服务器上报信息。但会遇到发送失败,连接状态卡在ESPCONN_WRITE。求大佬们帮忙分析一下。
日志1:
23:47:59 [2650550][DEBUG][NET]server_conn.state:ESPCONN_CONNECT(3)
23:47:59 [2651050][DEBUG][NET]tcp send:
23:48:04 [2655570][DEBUG][NET]server_conn.state:ESPCONN_WRITE(4)
23:48:09 [2660590][DEBUG][NET]server_conn.state:ESPCONN_WRITE(4)
23:48:14 [2665610][DEBUG][NET]server_conn.state:ESPCONN_WRITE(4)
23:48:19 [2670630][DEBUG][NET]server_conn.state:ESPCONN_WRITE(4)
23:48:24 [2675650][DEBUG][NET]server_conn.state:ESPCONN_WRITE(4)
23:48:25 [2677220][ERR][NET]connect err:-9! /* Connection reset. */
23:48:29 [2680670][DEBUG][NET]server_conn.state:ESPCONN_WAIT(1)
23:48:31 [2683360][ERR][NET]connect err:-11! /* Not connected. */
23:48:34 [2685690][DEBUG][NET]server_conn.state:ESPCONN_WAIT(1)
23:48:38 [2689760][ERR][NET]connect err:-11!
23:48:39 [2690710][DEBUG][NET]server_conn.state:ESPCONN_WAIT(1)
[2695240][INFO][NET]tcp connect success!
23:48:44 [2695730][DEBUG][NET]server_conn.state:ESPCONN_WRITE(4)
23:48:44 [2695950][DEBUG][NET][link79]tcp send success!
[2695950][DEBUG][NET]tcp recv(15)
[2695950][DEBUG][NET]data conn recv:
[2695950][INFO][PROTOCOL]get msg
23:48:49 [2700750][DEBUG][NET]server_conn.state:ESPCONN_CONNECT(3)

在一次发送中,持续了25秒,最终失败。最后触发重连回调
用的是NONOS SDK。但我翻过OSSDK的release note,没看到有关于修复这类网络问题的更新,所以应该是SDK版本关系不大。
请大佬帮忙看看。谢谢。

Her Mary
Posts: 476
Joined: Mon Oct 27, 2014 11:09 am

Re: 求助,tcp长连接,发送数据卡在ESPCONN_WRITE状态

Postby Her Mary » Sun Sep 27, 2020 2:24 pm

用新版的 RTOS 试试呢?https://github.com/espressif/ESP8266_RTOS_SDK/tree/master/examples/protocols

Who is online

Users browsing this forum: No registered users and 7 guests