-->
Page 1 of 3

AT commands GET and POST to internet website <<< SOLVED >>>

PostPosted: Mon Jan 30, 2017 11:40 am
by mutthunaveen
Dear board
my website is "http://sim900automation.comli.com" (im not sure about post... i assume it is "80").

here is what i do with web browser -> Mozilla Firefox or Chrome doesn't matter
----------------- action 1 ------------------------
when i enter this web address --> "http://sim900automation.comli.com/sw_status.php?status=list_all"
i see in browser window which display --> 010 (for RGB LED)
----------------- action 2 ------------------------
when i enter this web address --> "http://sim900automation.comli.com/log_tempt.php?temp=26"
i see in browser window which display --> Temperature = 25 C (and in parallel my SQL database will update too with 26'C temperature)

i need to do exactly same what i do in browser with my ESP8266 with AT commands

Here is how i started (i dont put \r\n for each line but they are used in code. and for GET request i used thrice \r\n\r\n\r\n as shown in Arduino examples)

Action 1
AT+CIPMUX = 0 --> OK
AT+CWMODE=1 --> OK
AT+CIPSTART="TCP","http://sim900automation.comli.com",80 --> CONNECT OK
AT+CIPSEND=76 --> OK >
GET http://sim900automation.comli.com/sw_st ... s=list_all HTTP/1.0 --> busy s...Recv 76 bytes

SEND OK
---> and ESP waits for 5 sec and after it responds with message--> CLOSED

i see nothing returning from my webpage. i need to get 111 or 010 same as i get in browser
how can i get 111 or 010 from website?? is there something wrong??

and
Action 2
AT+CIPMUX = 0 --> OK
AT+CWMODE=1 --> OK
AT+CIPSTART="TCP","http://sim900automation.comli.com",80 --> CONNECT OK
AT+CIPSEND=68 --> OK >
GET http://sim900automation.comli.com/log_tempt.php?temp=25 HTTP/1.0 --> busy s...Recv 68 bytes

SEND OK
---> and ESP waits for 5 sec and after it responds with message--> CLOSED

for above code there is update in SQL server with value 25'C (nor) i'm receiving message as "Temperature = 25 C" from web browser..
-------------------------------------

i need your support friends... i need to get or post the values from and to public domain. please help to get our of this weird situation.

thank you
naveen

Re: AT commands GET and POST to internet website

PostPosted: Tue Jan 31, 2017 10:05 am
by eduperez
Double-check that you are using the proper sequence of "\r\n" characters in your query, and remember to count those characters also for the CIPSEND. If would help if you put your whole sequence of commands here.

Re: AT commands GET and POST to internet website

PostPosted: Wed Feb 01, 2017 12:21 am
by mutthunaveen
Ok.. give me a day time. i will upload the LOG of what i send to ESP.

thank you.

Re: AT commands GET and POST to internet website

PostPosted: Wed Feb 01, 2017 10:46 pm
by mutthunaveen
Bingo...
thank you eduperez..

thanks for the hint.. Now i understood it is required for me to count also \r\n\r\n\r\n bytes (which means total request length + 6 bytes)... :geek:

:D :D now im getting response from website as expected :) :)