当我使用多个套接字时,我遇到了问题。
这是我的 AT-Parser 的调试(这不是 uart 上的 RAW
通信,但如果你不信任它,我稍后会记录下来:
我宣布向套接字 0 发送 1336 字节
10:44:58 [ESP8266 ] AT CMD[AT+CIPSEND=0,1336] STATEOK[0x81] STATEERR[0x83]
tiMEOUT[15000ms]
10:44:58 [ESP8266 ] [TX] LEN[19]
ESP 接受我的请求
10:44:58 [ESP8266 ] [RX] Response received LEN[2]
10:44:58 [ESP8266 ] OK
ESP要求提供数据
10:44:58 [ESP8266 ] Data-Request received
10:44:58 [ESP8266 ] New State OLD[0x50] NEW[0x81]
我传输 1336 字节
10:44:58 [ESP8266 ] [TX] LEN[1336]
Esp 确认,它收到了 1136 个字节
10:44:58 [ESP8266 ] [RX] Response received LEN[15]
10:44:58 [ESP8266 ] Recv 1336 bytes
Esp 给我发送 3872 字节,它来自
10:44:58 [ESP8266 ] Data received SOCKET[4], LENGTH[1452]
10:44:58 [ESP8266 ] Data received SOCKET[4], LENGTH[1452]
10:44:59 [ESP8266 ] Data received SOCKET[4], LENGTH[968]
10:44:59 [ESP8266 ] [RX] Response received LEN[8]
客户端 Socket 4 关闭了连接
10:44:59 [ESP8266 ] 4,CLOSED
10:44:59 [ESP8266 ] Client disconnected! SOCKET[4]
10:44:59 [ESP8266 ] New socket state SOCKET[4] OLD[1] NEW[0]
Esp 告诉我,它无法将我的最后 1336 个字节发送到套接字 0 ?!
10:44:59 [ESP8266 ] [RX] Response received LEN[9]
10:44:59 [ESP8266 ] SEND FAIL
10:44:59 [ESP8266 ] Failed! RESPONSE[SEND FAIL] STATE[0x81] OK[0x82] ERR[0x83]
10:44:59 [ESP8266 ] New State OLD[0x81] NEW[0x83]
10:44:59 [ESP8266 ] New State OLD[0x83] NEW[0x84]
// For recovering purpose, i send an "AT" command, to ensure, that i'm in sync with the AT-Interpreter of the Esp
10:44:59 [ESP8266 ] AT CMD[AT] STATEOK[0x50] STATEERR[0x84] TIMEOUT[50ms]
10:44:59 [ESP8266 ] [TX] LEN[4]
// Now, i receive an answer, that the data were sent successfully! - But i already give it up, due to the privously "SEND FAIL", in fact: the data reached the receiver.
10:44:59 [ESP8266 ] [RX] Response received LEN[7]
10:44:59 [ESP8266 ] SEND OK
10:44:59 [ESP8266 ] Ignored[SEND OK]!
Esp 对我的最后一个 AT 请求回答了“确定”。
10:44:59 [ESP8266 ] [RX] Response received LEN[2]
10:44:59 [ESP8266 ] OK
这是 AT 固件中的错误吗?- 我能做些什么来解决这个问题?
在我当前的实现中,我第二次传输失败的包。结果,该包裹两次到达收货人处。
0