pratik wrote:Actually the SENDBUF command writes data to the buffer and does not transmit it like the CIPSEND command does.
At the moment I do not concern about actual WiFi transmission. I am trying to establish correct communication between my microcontroller and ESP8266 using AT commands.
Document "ESP8266 AT instruction set" describes AT+CIPSENDBUF command as follows:
This command only write data into TCP-send-buffer, so it can be called continually, needn’t wait for “SEND OK”; if a TCP segment is sent successfully, it will return <segment ID>,SEND OK. Before data <length> is met, input “+++” can switch back from data mode to command mode, and discard the data received before, cancel the “AT+CIPSENDBUF” .
As far as I understand this description, I can send a series of
AT+CIPSENDBUF commands to ESP8266, causing ESP8266 to accumulate my messages in its internal buffer. I guess ESP8266 then merely sends accumulated data at its own pace, informing me about transmitting process by
<segment ID>,SEND OK. So far I have no idea what can I do with those
<segment ID>,SEND OK replies, they look like clutter for me. Maybe I can find a good use for them later on.
According to the detailed description, in multiple connection mode I should send:
AT+CIPSENDBUF=<link ID>,<length>After that ESP8266 should reply
<current segment ID>,<segment ID of which sent successfully>
OK
>Obviously after that I can send <length> data bytes. I guess I do not need to wait for any reply after sending data.
It works according to that description, but it works only once. When I send
AT+CIPSENDBUF=<link ID>,<length> second time, ESP8266 does not response for about 2 sec. My messages are short, typically only 30...50 bytes in one message. I wonder why ESP8266 does not accept the second
AT+CIPSENDBUF for so long. I do not expect ESP8266
to send my message instantly to WiFi, but I would expect ESP8266
to accept my message instantly and to store my data in a buffer, more or less this is what the description said.
pratik wrote:If your system does not have enough RAM and that is why you want to continuously send data, just use the CIPSEND command and stream data in.
Then, what is the purpose of AT+CIPSENDBUF command? Does it mean that AT+CIPSENDBUF command is not implemented properly and should not be used at all?