ESP8266 replies with "SEND FAIL" and a few ms later with "SEND OK"

Fabian
Posts: 2
Joined: Wed Oct 11, 2017 5:09 pm

ESP8266 replies with "SEND FAIL" and a few ms later with "SEND OK"

Postby Fabian » Wed Oct 11, 2017 5:23 pm

Hello,
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: Select all


// 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!

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

Re: ESP8266 replies with "SEND FAIL" and a few ms later with "SEND OK"

Postby Her Mary » Thu Oct 12, 2017 3:24 pm

Which version are you using? Maybe you can try it with the latest AT firmware.

Fabian
Posts: 2
Joined: Wed Oct 11, 2017 5:09 pm

Re: ESP8266 replies with "SEND FAIL" and a few ms later with "SEND OK"

Postby Fabian » Mon Oct 23, 2017 5:10 pm

Thank you, but i already use the latest AT-Firmware. (V2.1)

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.

Who is online

Users browsing this forum: No registered users and 4 guests