Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Arduino Uno and for Wifi an ESP8266.

My ESP8266 Firmware is

AT+GMR

AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04

baund = 115200,
 Both NL & CR

Server -- www.linysoft.com

The URL I want to send is either: http://www.linysoft.com/arduino/?light=off OR http://www.linysoft.com/arduino/?light=on.

Depending on to the link I send the result should be either ==> on or ==> off on the page http://www.linysoft.com/arduino/light.json.

Now I want to send an HTTP request (Weblink - http://www.linysoft.com/arduino/?light=on) so it can write according to that link "on" in the light.json page.

The AT command I am sending (my wifi module is connected to my wifi automatically):

WIFI CONNECTED
WIFI GOT IP

AT+CWMODE=1

OK

AT+CIPMUX=1

OK

AT+CIPSTART=0,"TCP","www.linysoft.com",80

0,CONNECT

OK

AT+CIPSEND=0,200

OK
>

Here I am getting a problem after this > I can't send **GET /arduino/?light=on**. I also tried GET /arduino/?light=on HTTP/1.0\r\n.

After putting this line in the textbox, I press the Enter button or Send Button, but nothing happens.

It is stuck here > for some time. And then it shows me:

OK
> 0,CLOSED

Pin Connection

ARDUINO UNO        ESP8266
RX  -------------->  TX
TX  --------------> RX
VCC--------------> 3.3
CH_PD ----------> 3.3
GND -------------> GND
share|improve this question
    
What technology are you using to connect to the Internet, and hence to "www.linysoft.com"? How have you checked that WiFi access point, and internet connection works? – gbulmer Jan 10 at 15:32

The domain is missing. Try this instead:

GET http://www.linysoft.com/arduino/?light=on HTTP/1.0\r\n\r\n

Cheers!

Ref. http://contractorwolf.com/esp8266-wifi-arduino-micro/

share|improve this answer
    
I didn't know that was allowed in HTTP, as browsers use the Host header. But apparently using an absoluteURI is allowed. – Gerben Jan 10 at 16:29

linysoft.com is a virtual host. Just try going to http://100.42.56.28/ and see that the connection is reset.

So after the GET /arduino/?light=on, you have to also send Host: www.linysoft.com (on the next line).

share|improve this answer

Just found out a POST wouldn't work. Try this GET request to turn on the light.

    GET /arduino/?light=on HTTP/1.1\r\nHost: www.linysoft.com\r\n\r\n

Then you can get the status of the LED by GETting light.json like this:

    GET /arduino/light.json HTTP/1.1\r\nHost: www.linysoft.com\r\n\r\n
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.