Asynchronous messages are wedged into any place of synchronous messages

I noticed that when receiving messages from the module, asynchronous messages (messages, for example, “+IPD…,” “…, SEND OK”, “CLOSED”) can be inserted into any place of synchronous messages (AT command returns). For this reason, it is difficult or even impossible to reliably process the received messages!!!

Hi @AndreyS

In the WizFi360 AT command, each response to the corresponding AT command exists and is returned.

When processing messages, consider each response to the AT command.

Hi @austin

Here is an example of a possible problem (see the response to the last AT command)

< AT+CIPSENDBUF=1024<CR><LF>
> 101,100<CR><LF>
> <CR><LF>
> OK<CR><LF>
> >
< {send data}
> <CR><LF>
> Recv 1024 bytes<CR><LF>

< AT+CIPSENDBUF=1024<CR><LF>
> 102,100<CR><LF>
> <CR><LF>
> OK<CR><LF>
> >
< {send data}
> <CR><LF>
> Recv 1024 bytes<CR><LF>

< AT+CWJAP_CUR?<CR><LF>
> +CWJAP_CUR:"TestNet","48:8f:5a:f3:a9:98",11,-54<CR><LF>
> <CR><LF>
> OK<CR><LF>

< AT+CWJAP_CUR?<CR><LF>
> +CWJAP_CUR:"Tes<CR><LF>
> 101,SEND OK<CR><LF>
> tNet","48:8f:5a:f3:a9:98",11,-5<CR><LF>
> 102,SEND OK<CR><LF>
> 4<CR><LF>
> <CR><LF>
> OK<CR><LF>

Hi @AndreyS

When data is transmitted using ‘AT+CIPSENDBUF’, if the data is successfully transmitted, it responds with ‘,SEND OK’ or ‘,,SEND OK’.

In other words, please check the ‘SEND OK’ response and enter the next AT command.

Hi @austin

  1. After sending the data for the "AT+CIPSENDBUF" command, the message "<CR><LF>Recv <len> bytes<CR><LF>" arrives. Why doesn’t the document “AT Instruction Set” say anything about this message?

  2. The message "SEND OK" means that the receiving side of the TCP socket has confirmed the receipt of data?

Do I understand correctly that after sending the command "AT+CIPSENDBUF" and receiving the response "<CR><LF>Recv <len> bytes<CR><LF>", you still need to receive the message "<CR><LF><segment ID>,SEND OK<CR><LF>" or the message "<CR><LF>SEND FAIL<CR><LF>" before sending a new AT command (including "AT+CIPSENDBUF")?

  1. If the answers are Yes, then how is the data buffered?

Hi @AndreyS

  1. That information seems to be missing.
    I’ll revise and reflect this issue in a later document.

  2. ‘SEND OK’ is returned when data has been successfully sent.

  3. Yes, you understand correctly.

  4. The received data contained the ‘AT+CIPSENDBUF’ response and return value, which told me this was the problem.
    Is my understanding correct?
    So, to avoid this problem, I replied to check the ‘SEND OK’ or ‘SEND FAIL’ response and enter the next AT command.
    If you want to do data buffering, you need to implement the application considering that the response and return value of ‘AT+CIPSENDBUF’ is included in the received data.