使用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! /* Connec
tion 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版本关系不大。
请大佬帮忙看看。谢谢。