right procedure to send data ?

phil31
Posts: 43
Joined: Thu Nov 13, 2014 3:40 pm

right procedure to send data ?

Postby phil31 » Tue Dec 30, 2014 12:01 am

Dear,

again, my application is a web server embedded in my host CPU.
I manage to configure the ESP8266 as expected.
my AT firmware is 0020000903 and I use the hardware handshake feature.

when I send data, after the AT+CIPSEND=..,.. command, sometime I receive "SEND OK" as expected,
but others time, some strange message as "busy s...", "busy p....", "ERROR", "Fail" and some others !!

Anybody know what are the required action to do for each messages ?...
by example,
- if "busy .." message then wait ?? what !..?
- if "ERROR" message then retry AT+CIPSEND then send again same data ?

what are the differences between "busy s" and "busy p" message ..?

thanks for any help, have nice holidays, regards
Phil

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: right procedure to send data ?

Postby ESP_Faye » Wed Dec 31, 2014 9:29 am

Hi, there are some documents about how to test AT commands might help you http://bbs.espressif.com/viewtopic.php?f=21&t=93

"busy" means the previous AT command is not finished yet, so we cannot accept the next AT command ..
"busy p" means command is doing; "busy s" means sending data is doing ..
"ERROR" means you may input an incorrect AT command..

Notice that in normal mode every time you want to send some data ,you need a "AT+SEND" command ..

Example in single connection:
AT+CIPSEND=3 // we want to send 3 bytes

>QWE // the 3 bytes data

SEND OK
AT+CIPSEND=6 // then we want to send 6 bytes

>DGFYRW // the 6 bytes data

SEND OK

phil31
Posts: 43
Joined: Thu Nov 13, 2014 3:40 pm

Re: right procedure to send data ?

Postby phil31 » Wed Dec 31, 2014 7:33 pm

Hello Faye,


thanks for your details, but it's ever not clear in my mind !.. please :
my application use multiple connections only, so help me with such example please.


if "busy s..." : what we need to do ? pooling with "AT" then wait until "OK" by example ?
when "OK", then we can continue to send next packet ?

if "busy p..." ... what to do ?

"ERROR" appear sometime only .. i can't imagine that my host send not the right format of the command !

to send by example 6KB of data :

Code: Select all

loop 3 times
   send "AT+SIPSEND=0, 2048"
   wait for ">" which is not \r\n ended 
   what to do in case of others messages ?
   send 2048 bytes
   wait for "SEND OK"
   what to do in case of others messages ?
end loop


i check the WIKI, explanation are not clear :
https://github.com/espressif/esp8266_at/wiki/CIPSEND

Wrap return “>” after execute command. Enters unvarnished transmission, 20ms interval between each packet, maximum 2048 bytes per packet. When single packet containing “+++” is received, it returns to command mode.

we need to wait 20ms between each packets .. then what is the purpose of the "busy .." message if it is too simple !?
it is not specified any chronogram or procedure..

thanks for your help

regards

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: right procedure to send data ?

Postby ESP_Faye » Sun Jan 04, 2015 9:57 am

Hi, when it shows "busy" , you can do nothing but wait till "OK"..
We need to finish the previous AT command, then accept the next one.
Thanks for your interest in ESP8266 !

phil31
Posts: 43
Joined: Thu Nov 13, 2014 3:40 pm

Re: right procedure to send data ?

Postby phil31 » Sun Jan 04, 2015 9:31 pm

Faye,

please,

when "busy" ==> wait until "OK\r\n"
when "busy s..." ==> what to do ?
when "busy p..." ==> what to do ?

thanks

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: right procedure to send data ?

Postby ESP_Faye » Mon Jan 05, 2015 9:54 am

Hi,

when "busy s..." ==> wait until "OK\r\n"
when "busy p..." ==> wait until "OK\r\n"

Thanks for your interest in ESP8266 !

Who is online

Users browsing this forum: No registered users and 3 guests