mercredi 21 décembre 2016

ESP8266 AT COMMAND TEST TO PUT DATA ON A WEBSERVER

I have been testing esp8266-12 putting the data on a server I have some doubts as I am not getting the results I expect so please help me out in this I am not much into networking. --------------INITIALIZING AND CREATING SERVER------------------------------

AT
OK
AT+CIPMUX=1
OK
AT+CIPSERVER=1,80
OK
AT+CIFSR
192.168.4.1
192.168.1.147
OK

""I LATER COPIED THE THE STAIP (i.e 192.168.1.147:80) and serial monitor displayed as below"":

OK
Link
+IPD,0,310:GET / HTTP/1.1
Host: 192.168.1.147
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101    Firefox/50.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
OK

--------AS SERVER IS CREATED FROM ABOVE MESSAGE I HAVE TO SEND SOME 30 BYTES OD DATA BUT I HAVE SENT MORE THAN 30 BYTES OF DATA THAT IS WHY busy message at end -------------------------------------------------------------------

AT+CIPSEND=0,30
> ASHGDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
busy...
SEND OK
AT+CIPCLOSE=0,80
OK
Unlink
Link
+IPD,0,291:GET /favicon.ico HTTP/1.1
Host: 192.168.1.147
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101 Firefox/50.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
OK
Link
+IPD,1,231:GET /favicon.ico HTTP/1.1
Host: 192.168.1.147
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101 Firefox/50.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
OK

-----SO 30 BYTES OF DATA GOT PRINTED SUCCESFULLY AND UNLINKED----------------

Now my doubt is if I try to send less than 30 bytes of data (or value whatever mentioned in CIPSEND) the data never gets displayed on webserver. the below command test executes that: ----------REQUESTING SERVER TO ACCEPT DATA------------------------

OK
Link
+IPD,0,310:GET / HTTP/1.1
Host: 192.168.1.147
  User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101 Firefox/50.0
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 Accept-Language: en-US,en;q=0.5
 Accept-Encoding: gzip, deflate
 Connection: keep-alive
 Upgrade-Insecure-Requests: 1
 OK

---------------SENDING THE DATA-----------------------------------

AT+CIPSEND=0,30
 > TTTHHH

AFTER THIS LINE THE transmission just stops and never ends and port always is busy to come out of this I have to reset the esp8266 and try-a-fresh again...

In nutshell my doubt is :when AT+CIPSEND=0,30 is executed we must send 30 or more than 30 bytes of data then only data is getting displayed on the webserver else its not.. Cant I execute a command such that as soon as i finish sending the data i should be able to terminate the session though the number of bytes are lesser than mentioned in "CIPSEND" command.




Aucun commentaire:

Enregistrer un commentaire