am just trying to familiarize myself with using the basic AT commands, but cannot get any response from a website;
i tried the example from this post but failed;
OK
AT+CIPMUX=1
OK
AT+CIPSTATUS
STATUS:2
OK
AT+CIPSTART=0,"TCP","api.weathermap.org",80
0,CONNECT
OK
AT+CIPSEND=3,76 // my ID error
link is not valid
ERROR
AT+CIPSEND=0,76
// entered text exactly as per post above (plus \r\n\r\n at the end)
OK
> n\r\n
busy s...
Recv 76 bytes
SEND OK
but nothing came through (like in the example).
i tried the same on a very simple website just to see what results come through, but i get a ‘bad request’ response.
AT+CIPCLOSE=0
0,CLOSED
OK
AT+CIPSTART=0,"TCP","www.blinkenlichten.info",80
0,CONNECT
OK
AT+CIPSEND=0,79
OK
> // i parsed the above URL this way;
-->> GET /print/origin.html HTTP/1.0\r\nHost: http://www.blinkenlichten.info\r\n\r\n
busy s...
Recv 79 bytes
SEND OK
+IPD,0,311:HTTP/1.1 400 Bad Request
Server: nginx
Date: Sat, 25 May 2019 03:33:20 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>
0,CLOSED
AT
OK
i think i must be missing a command or parameter somewhere ?
could someone point me in the right direction ?
Thanks !
BabyGeezer:
ok - i'm really n00b at this.
so it has to be exactly 79 bytes or it won't work ?
i count (in spreadsheet) that what i typed after the '>';
GET /print/origin.html HTTP/1.0\r\nHost: http://www.blinkenlichten.info\r\n\r\n
FWIW:
i tried that example again to weathermap.org
no Bad Request - but nothing was returned either.
0,CLOSED
AT
OK
AT+CIPSTART=0,"TCP","api.weathermap.org",80
0,CONNECT
OK
AT+CIPSTATUS
STATUS:3
+CIPSTATUS:0,"TCP","185.53.178.8",80,47217,0
OK
AT+CIPSEND=0,76
OK
> n
busy s...
Recv 76 bytes
SEND OK
AT
OK
Juraj:
400 is http response code. it is send from the server if the request is not a valid http request
okay, and then the ESP prints out that message based on the 400 code ?
Juraj:
you can’t send \r\n over Serial Monitor. it is not converted
send 3 lines from Serial Monitor
i see - thank you for your patience;
still no success though;
OK
AT+CIPSTART=0,"TCP","api.weathermap.org",80
Link type ERROR
ERROR
AT+CIPMUX=1
IPMODE must be 0
ERROR
AT+CIPMODE=0
OK
AT+CIPMUX?
+CIPMUX:0
OK
AT+CIPMUX=1
OK
AT+CIPSTART=0,"TCP","api.weathermap.org",80
0,CONNECT
OK
AT+CIPSTATUS
STATUS:3
+CIPSTATUS:0,"TCP","185.53.178.8",80,6447,0
OK
AT+CIPSEND=0,73
OK
> // i sent the 3 lines separately as you had typed
Recv 73 bytes
SEND OK
+IPD,0,311:HTTP/1.1 400 Bad Request
Server: nginx
Date: Sat, 25 May 2019 09:26:42 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>
0,CLOSED
AT
OK
AT+CIPSTART=0,"TCP","api.weathermap.org",80
0,CONNECT
OK
AT+CIPSEND=0,74
OK
> // this time i sent the 2 lines and two empty lines
busy s...
Recv 74 bytes
SEND OK