---
title: "Asynchronous messages are wedged into any place of synchronous messages"
url: "https://maker.wiznet.io/forum/14893"
markdown_url: "https://maker.wiznet.io/forum/14893/md"
type: "Forum topic"
category: "Wireless"
author: "AndreyS"
created: "2023-04-28T12:27:15+09:00"
last_activity: "2023-05-31T22:57:15+09:00"
language: "en"
views: 258
replies: 5
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Asynchronous messages are wedged into any place of synchronous messages

## Question

Asked by AndreyS on 2023-04-28 in Wireless.

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!!!

## Replies

### Reply 1 by austin, 2023-05-02

Hi [@AndreyS](https://maker.wiznet.io/u/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.

### Reply 2 by AndreyS, 2023-05-03 (in reply to reply 1)

Hi [@austin](https://maker.wiznet.io/u/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>
```

### Reply 3 by austin, 2023-05-04

Hi [@AndreyS](https://maker.wiznet.io/u/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.

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/804d2bc4bf66e2789f35777f35a754ded54b923e.png) image680×755 57.1 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/804d2bc4bf66e2789f35777f35a754ded54b923e.png)

### Reply 4 by AndreyS, 2023-05-04

Hi @austin After sending the data for the "AT+CIPSENDBUF" command, the message "&lt;CR>&lt;LF>Recv &lt;len> bytes&lt;CR>&lt;LF>" arrives. Why doesn’t the document “AT Instruction Set” say anything about this message? The message "SEND OK" means that the receiving side of the TCP socket has confirmed the receipt of data? austin: In other words, please check the ‘SEND OK’ response and enter the next AT command. Do I understand correctly that after sending the command "AT+CIPSENDBUF" and receiving the response "&lt;CR>&lt;LF>Recv &lt;len> bytes&lt;CR>&lt;LF>", you still need to receive the message "&lt;CR>&lt;LF>&lt;segment ID>,SEND OK&lt;CR>&lt;LF>" or the message "&lt;CR>&lt;LF>SEND FAIL&lt;CR>&lt;LF>" before sending a new AT command (including "AT+CIPSENDBUF")? If the answers are Yes, then how is the data buffered?

### Reply 5 by austin, 2023-05-08

Hi [@AndreyS](https://maker.wiznet.io/u/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.

---

Source: https://maker.wiznet.io/forum/14893
