-->
Page 1 of 2

esp8266 open txt from server

PostPosted: Sat Feb 14, 2015 8:02 am
by lukas252
Hello,

I have the esp8266 connected to my computer. I have connected it to my network and it works. The problem is that I dont know how to request this document http://arduino.cc/asciilogo.txt .
Command looks like so:

AT+CIPSTART="TCP","arduino.cc",80
OK
Linked

But I dont know what to do next, maybe a GET, but how?
I tried this but it doesnt work:

AT+CIPSTART="TCP","arduino.cc",80
OK
Linked
AT+CIPSEND=42
> GET /asciilogo.txt HTTP/1.1\r\nHost: arduino.cc\r\n
wrong syntax
ERROR
SEND OK
OK
Unlink

I want that document to be shown in my serial monitor (using the one with arduino software) over which i speak to the esp from the computer.

EDIT: Basicly I just want to do this with esp8266 http://arduino.cc/en/Tutorial/HttpClient

Thank you

Re: esp8266 open txt from server

PostPosted: Sat Feb 14, 2015 8:55 am
by villTech
you can simply use:
GET http://arduino.cc/asciilogo.txt
+ 2 (cr lf) and correct request lenght.

Re: esp8266 open txt from server

PostPosted: Sat Feb 14, 2015 9:26 am
by lukas252
villTech wrote:you can simply use:
GET http://arduino.cc/asciilogo.txt
+ 2 (cr lf) and correct request lenght.

Tried this now and get the same response. I think my request lenght is the right size (\r\n counts as 1?).
Image

Re: esp8266 open txt from server

PostPosted: Sat Feb 14, 2015 9:34 am
by villTech
i did not completely check your first post, just noticed the 2nd one.

you shoudnt be adding \r\n on your request. \r\n is meant to be cr lf or enter key.

if you are using arduino serial terminal, set it to send both cr lf, and press it twice.

also, cr lf or \r\n or enter key is 2 char. that is 0x0D 0x0A