"Non-atomic" +CIPSEND bug

Rst7
Posts: 1
Joined: Thu Oct 27, 2016 8:37 pm

"Non-atomic" +CIPSEND bug

Postby Rst7 » Thu Oct 27, 2016 8:54 pm

I have a problem with reopen socket until data transfer performed.

For example:

Send to ESP: AT+CIPSEND=1,xxx\r\n
Receive from ESP: OK\r\n
Receive from ESP: >
Send to ESP: ...some...data... (first portion of data)
Receive from ESP: 1,CLOSED\r\n (remote client close connection when data transfered to internal buffer of ESP)
Send to ESP: ...some...data... (next portion of data)
Receive from ESP: 1,CONNECTED\r\n (remote client open new connection when data transfered)
Send to ESP ...some...data... (last portion of data, all data sended)
Receive from ESP: OK\r\n
Receive from ESP: SEND OK\r\n
...

In this case all data for the old connection sent in new connection.

What can I do with this?

Thank you.

Her Majesty
Posts: 231
Joined: Mon Oct 27, 2014 11:09 am

Re: "Non-atomic" +CIPSEND bug

Postby Her Majesty » Fri Mar 24, 2017 2:19 pm

Message "CLOSE" means the connection is closed, you should stop sending data.
Detect message "CONNECTED" to start a new transmission.

朝花夕拾
Posts: 11
Joined: Fri Mar 10, 2017 9:26 am

Re: "Non-atomic" +CIPSEND bug

Postby 朝花夕拾 » Fri Dec 22, 2017 4:48 pm

Her Majesty wrote:Message "CLOSE" means the connection is closed, you should stop sending data.
Detect message "CONNECTED" to start a new transmission.

hi,majesty;
you say ,"CLOSE" means the connection is closed,but i want know why the connection closed ?
i know some reasons,such as ;
1 the tcp server could close connection;
2 mcu could send AT cmd to esp8266 ,close connection;
Is there any other reason ?

Her Majesty
Posts: 231
Joined: Mon Oct 27, 2014 11:09 am

Re: "Non-atomic" +CIPSEND bug

Postby Her Majesty » Mon Dec 25, 2017 2:37 pm

Hi, yes, the TCP connection could be ended by the server or the client, you can capture the TCP packets (by omnipeek or wireshark) to check the reason of disconnection.

Who is online

Users browsing this forum: Bing [Bot] and 2 guests