Sometimes AT+CIPSEND command cannot wait for SEND OK

twcczhang
Posts: 1
Joined: Tue Aug 07, 2018 1:37 pm

Sometimes AT+CIPSEND command cannot wait for SEND OK

Postby twcczhang » Wed Aug 15, 2018 5:34 pm

Hi,

I try to use NUMAKER-PFM-M487 + ESP8266 to run mbed client application, but sometimes the application works well, sometimes it works fail. I find in fail cases, the root cause is the CIPSEND AT command can only receive "Recv xx bytes" message, but never wait for "SEND OK" message.

In below log, the "AT? XXX" means the program is waiting for XXX, and "AT= XXX" means the program already get XXX message. You can see the first 643 bytes is send ok, but the second 75 bytes is send fail. In mbed, the default timeout of ESP8266 is 2 second. After increase the timeout to 5 second and 10 second, the program still cannot wait for "SEND OK" message from ESP8266.

......
[2018-08-15 11:42:36.504] AT> AT+CIPSEND=0,643
[2018-08-15 11:42:36.505] &1, > (0x3e)
[2018-08-15 11:42:36.505] AT? >%n
[2018-08-15 11:42:36.505] AT< AT+CIPSEND=0,643
[2018-08-15 11:42:36.506] AT< OK
[2018-08-15 11:42:36.514] AT= >
[2018-08-15 11:42:36.514] &2
[2018-08-15 11:42:36.540] &1, S (0x53)
[2018-08-15 11:42:36.541] AT? SEND OK
[2018-08-15 11:42:36.542] %n
[2018-08-15 11:42:36.562] AT<
[2018-08-15 11:42:36.564] AT< Recv 643 bytes
[2018-08-15 11:42:36.832] AT= SEND OK
[2018-08-15 11:42:36.835]
[2018-08-15 11:42:36.835] &2
[2018-08-15 11:42:38.978] Simulated button clicked 1 times
[2018-08-15 11:42:39.090] AT> AT+CIPSEND=0,75
[2018-08-15 11:42:39.091] &1, > (0x3e)
[2018-08-15 11:42:39.091] AT? >%n
[2018-08-15 11:42:39.091] AT< AT+CIPSEND=0,75
[2018-08-15 11:42:39.091] AT< OK
[2018-08-15 11:42:39.092] AT= >
[2018-08-15 11:42:39.099] &2
[2018-08-15 11:42:39.104] &1, S (0x53)
[2018-08-15 11:42:39.104] AT? SEND OK
[2018-08-15 11:42:39.104] %n
[2018-08-15 11:42:39.104] AT<
[2018-08-15 11:42:39.104] AT< Recv 75 bytes
[2018-08-15 11:42:41.109] AT(Timeout)
[2018-08-15 11:42:41.111] SEND command is still not finished !!
......

Please help to clarify and fix this issue. Thanks.

BR,
twcczhang

Her Majesty
Posts: 345
Joined: Mon Oct 27, 2014 11:09 am

Re: Sometimes AT+CIPSEND command cannot wait for SEND OK

Postby Her Majesty » Sat Aug 25, 2018 12:05 pm

Maybe due to the bad network, you can capture WiFi packets by wireshark to find out it.

Who is online

Users browsing this forum: No registered users and 2 guests