Go Down

Topic: Got Trouble with ESP8266 and Arduino Yun using REST control (Read 1 time) previous topic - next topic

liemvt2008

Sorry about my English.

I'm a new bie in program Arduino and interested in ESP8266. I'm trying to use ESP8266 control Arduino Yun using REST API.

 Like you know, we using web browser as

http://<Arduino_Yún_Address>/arduino /<status>/<pin>/value> (optional)>

Example: http://<Arduino_Yún_Address>/arduino/digital/13/1

you bring pin 13 to high, by closing the relay and giving light to the LED,

while with: http://<Arduino_Yún_Address>/arduino/digital/13/0

the relay is opened and the LED is turned off

and I want to use ESP8266 to send command like using web browser and it didn't work.

After connect to Wifi access point and Server of Yun done, I've tried to send command like

GET /http://<Arduino_Yún_Address>/arduino/digital/13/1

Please give me some idea or move advices about this situation. Thanks for reading my topic.  :D

Chagrin

GET /http://<Arduino_Yún_Address>/arduino/digital/13/1
This should be:

Code: [Select]
GET /arduino/digital/13/1 HTTP/1.0

Send an additional blank line after the above message to signify that the message is complete.

liemvt2008

"Blank line" you mean like a space after the command or "\r\n"??? Sr but I'm new bie

Chagrin

Just "\n". With network protocols (SMTP, HTTP, FTP, etc.) it's always just "\n".

liemvt2008

Thanks for your help. I will try it, hope it work.  :smiley-lol:

liemvt2008

Sorry Chagrin but it doesn't work. By the way, I'm using IDE serial monitor to send command to esp8266. Please give me more advices or idea to solve it.

liemvt2008

AT+CIPSTART="TCP","192.168.0.150",80


OK
Linked
AT+CIPSEND=58

> GET /http://192.168.0.150/arduino/digital/13/1 HTTP/1.0\n

wrong syntax

ERROR

here is my problem

Chagrin

You still have the "http://192.168.0.150" part in there.

I'm no good with the ESP8266 AT commands, but the host part definitely should not be in there.

liemvt2008

Sorry but It doesn't work too. Do you know anything or any document about GET METHOD. I mean about it function. What does the command include. I didn't get it althought read example. Please help me.

Go Up