ESP8266 Developer Zone The Official ESP8266 Forum 2017-10-23T17:10:48+08:00 https://bbs.espressif.com:443/feed.php?f=16&t=6883 2017-10-23T17:10:48+08:00 2017-10-23T17:10:48+08:00 https://bbs.espressif.com:443/viewtopic.php?t=6883&p=16638#p16638 <![CDATA[Re: ESP8266 replies with "SEND FAIL" and a few ms later with "SEND OK"]]>
At moment, i use a work-a-round. If i receive a "send fail", i'm waiting additional 2 seconds for an OK. If this OK is not coming, i declare the last transmission as failed.

Statistics: Posted by Fabian — Mon Oct 23, 2017 5:10 pm


]]>
2017-10-12T15:24:22+08:00 2017-10-12T15:24:22+08:00 https://bbs.espressif.com:443/viewtopic.php?t=6883&p=16391#p16391 <![CDATA[Re: ESP8266 replies with "SEND FAIL" and a few ms later with "SEND OK"]]> the latest AT firmware.

Statistics: Posted by Her Mary — Thu Oct 12, 2017 3:24 pm


]]>
2017-10-11T17:23:47+08:00 2017-10-11T17:23:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=6883&p=16371#p16371 <![CDATA[ESP8266 replies with "SEND FAIL" and a few ms later with "SEND OK"]]> i have the problem, when i work with several sockets.

This is the debug of my AT-Parser (This is not the RAW communication on the uart, but if you don't trust it, i will record it later:

Code:


// I announce to send 1336 Bytes to socket 0
10:44:58 [ESP8266 ] AT CMD[AT+CIPSEND=0,1336] STATEOK[0x81] STATEERR[0x83] TIMEOUT[15000ms]
10:44:58 [ESP8266 ] [TX] LEN[19]

// Esp accept my request
10:44:58 [ESP8266 ] [RX] Response received LEN[2]
10:44:58 [ESP8266 ] OK

// Esp asked for the data
10:44:58 [ESP8266 ] Data-Request received
10:44:58 [ESP8266 ] New State OLD[0x50] NEW[0x81]

// I transmit 1336 Bytes
10:44:58 [ESP8266 ] [TX] LEN[1336]

// Esp confirms, that it received 1136 Bytes
10:44:58 [ESP8266 ] [RX] Response received LEN[15]
10:44:58 [ESP8266 ] Recv 1336 bytes

// Esp send me 3872 Bytes, which cames from
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]

// The client an Socket 4 closed the connection
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 tells me, that it could not send my last 1336 bytes to socket 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 answered with an OK to my last AT-Request.
10:44:59 [ESP8266 ] [RX] Response received LEN[2]
10:44:59 [ESP8266 ] OK


The problem is reproducable. When i receive TCP Data on one socket, during a Send, i got the message "SEND FAIL" first, and a few ms. later the message "SEND OK".

Is this a bug in the AT-Firmware? - What can i do to fix the problem?
With my current implementation, i transfer the failed package a second time. As a result, this package arrives twice times at the receiver.

Thank you for your support!

Statistics: Posted by Fabian — Wed Oct 11, 2017 5:23 pm


]]>