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.
"Non-atomic" +CIPSEND bug
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 ?
Re: "Non-atomic" +CIPSEND bug
Postby Her Mary » 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: No registered users and 149 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.