Post topics, source code that relate to the Arduino Platform

User avatar
By Dragorwyin
#32975 This problem solved :D
What I did?

In SerialMonitor in Arduino IDE after AT+CIPSEND=xx every \r\n is just ENTER (if it is NL+CR setup).
So every line where it is \r\n\ need to be ENTER as shown:

Code: Select allGET /requestdatabase.php?apples=200&oranges=230 [ENTER]
HTTP/1.1 {ENTER]
Host: http://wersjarobocza.hol.es [ENTER]


So full code looks like:

Code: Select allAT+CIPSEND=95

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

SEND OK


But... There is another problem, which maybe someone got before...


+IPD,166:<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

OK
CLOSED

OK


If I will find any solution for Bad Gateway... I will write it here. If someone have a solution, please share with me :)
User avatar
By Dragorwyin
#33063 Problem solved! :)
I found solution. So for everyone who has problem with "bad gateway" I changed my get request to this one:

Code: Select allAT+CIPSTART="TCP","www.wersjarobocza.hol.es",80
AT+CIPSEND=248  ( HERE IS 239 symbols counted by http://www.lettercount.com + 9)

GET /link.php?apples=200&oranges=230 HTTP/1.1
Host: www.wersjarobocza.hol.es
Accept: image/gif, image/jpeg, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)



Every line is just pressed Enter in SerialMonitor with enabled NL+CR.

I changed port from 8080 to 80 and added longer request (what was neccessary) + added "www." at beginning of website address.

I hope that it will help someone in future ;)