-->
Page 1 of 2

ESP8266-1 empty GET Request

PostPosted: Tue Nov 03, 2015 4:16 pm
by Dragorwyin
Hi everyone! :)
I have a problem with sending GET request to every websites. I tried to find any infromation what could be wrong, but I did not found for few days.

So... What I do is:
• change ESP8266 to client mode by AT+CWMODE=1,
• Connect to my WIFI by CWJAP,
• Connect to my website by AT+CIPSTART="TCP","31.220.16.138",80 (or ="TCP","wersjarobocza.hol.es",80
• Sending CIPSEND: AT+CIPSEND=168
Code: Select allGET /requestdatabase.php?apples=200&oranges=230 HTTP/1.1\r\n\r\nHost: 31.220.16.138 \r\"Content-Length: 150 \r\nContent-Type:application/x-www-form-urlencoded;charset=utf-8\r\n


What i've got is only:

busy s...

SEND OK
CLOSED

OK


Everything there is only response "SEND OK CLOSED" :(

I tried to change mode of ESP to server mode and there everything was fine.
My baud rate is 115200 and my firmware is updated to:

AT+GMR

0020000903
compiled @ Nov 29 2014 14:08:27


I'm fighting with that few days... Reading, searching, but nothing help :/
If someone had same problem and found solution, please, help me, because I spent a lot of time with that and this is for me very important.

I tried with CIPMUX=1, but response was same :(


@ EDIT
By the way - there will be big help, if someone could try to connect this website and tell me, if it works with another ESP :)

Re: ESP8266-1 empty GET Request

PostPosted: Tue Nov 03, 2015 4:55 pm
by Dragorwyin
Ok I've got it! :D
I had to connect to website with port 8080. Now I have bad request error, but I hope I will find solution to this problem too :)

Solution:
AT+CIPSTART="TCP","wersjarobocza.hol.es",8080 :)

So I had to connect with HTTPS (SSL) request :D

Re: ESP8266-1 empty GET Request

PostPosted: Tue Nov 03, 2015 5:49 pm
by Barnabybear
Hi, check the lenght of your string. \r = 1 & \n = 1, most problems are that people have said the string is longer & shorter than they realy are.
Longer = the host is still waiting for the rest of the string.
Shorter = the whole string isn't sent.

I've seen that string posted a dozen times, the length was wrong every time.

Re: ESP8266-1 empty GET Request

PostPosted: Tue Nov 03, 2015 6:21 pm
by Dragorwyin
Thanks for reply :)
I've got now a lot of tries with GET Request but everytime I'm doing something wrong, because there is always Bad Request...

What I've wrote last time:
Code: Select allAT+CIPSEND=100

> GET /requestdatabase.php?apples=200&oranges=230 \r\n HTTP/1.1\r\n Host: http://wersjarobocza.hol.es \r\n\r\n


And response is:

busy s...

SEND OK

+IPD,311:HTTP/1.1 400 Bad Request
Server: nginx
Date: Tue, 03 Nov 2015 23:18:35 GMT
Content-Type: text/html
Content-Length: 166
Connection: close

<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

OK
CLOSED

OK


I don't have idea what is wrong... I think that I count fine characters in CIPSEND :)
If someone have any idea, please share with it :)


@EDIT
I'm using SerialMonitor in Arduino IDE... Maybe there is problem?