How to send several data packets using AT+CIPSEND or AT+CIPSENDBUF?
Posted: Fri Jul 22, 2016 7:45 am
I can send a single data packet using AT+CIPSEND. But I have to send a series of binary data packets. How to use AT+CIPSEND or AT+CIPSENDBUF to send several packets of data, what is a correct algorithm?
So far I tried the following with no success:
It is a huge delay after first data packet. How to avoid that?
So far I tried the following with no success:
- 0,CONNECT - external client opens TCP connection 0
- +IPD,0,87 <...> - external client sends a command, eg a data packet of 87 bytes long
- AT+CIPSENDBUF=0,34 - my device starts to send first reply, it is a data packet of 34 bytes long
- My device it waits for "OK" from ESP8266, time-out is 1 sec
- 3,2 OK > - ESP8266 replies "OK >", it happens almost instantly
- My device sends 34 bytes of data, then it waits until all data bytes are sent by UART
- AT+CIPSENDBUF=0,38 - my device starts to send second reply, it is a data packet of 38 bytes long
- My device it waits for "OK >" from ESP8266, time-out is 1 sec
- My device exits by time-out
- busy s... Recv 34 bytes 0,9,SEND OK - after a delay of about 2 sec ESP8266 replies "OK",
It is a huge delay after first data packet. How to avoid that?