AT get request

who_took_my_nick
Posts: 3
Joined: Wed Jan 17, 2018 4:16 am

AT get request

Postby who_took_my_nick » Wed Jan 17, 2018 4:27 am

I have a problem sending a get request to a remote server with ESP01.
I connect ESP with UNO and everything works fine. I connect it to my local network etc. But i can not send data to remote server. What am i doing wrong?

Code: Select all

#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);
void setup(){
  mySerial.begin(9600);
  Serial.begin(9600);
  reset();
  }
void reset(){
mySerial.println("AT+RST");
 delay(5000);
mySerial.println("AT+CWMODE=1");
mySerial.println("AT+CIFSR");
mySerial.println("AT+CIPMUX=1");
mySerial.println("AT+CIPSERVER=1,80");
delay(5000);
  }

void loop() {
mySerial.println("AT+CIPSTART=4,\"TCP\",\"www.somesite.org\",80");
delay(1000);
mySerial.println("AT+CIPSEND=4,40");
delay(1000);
mySerial.println("GET /test/index.php?lm35=10 HTTP/1.1");
mySerial.println("Host: www.somesite.org");
mySerial.println();
mySerial.println();
delay(1000);
mySerial.println("AT+CIPCLOSE=4");
delay(1000);
}

I set connection with my network previously.

Her Majesty
Posts: 294
Joined: Mon Oct 27, 2014 11:09 am

Re: AT get request

Postby Her Majesty » Wed Jan 17, 2018 3:57 pm

Did not call command AT+CWJAP to connect to a router?

who_took_my_nick
Posts: 3
Joined: Wed Jan 17, 2018 4:16 am

Re: AT get request

Postby who_took_my_nick » Wed Jan 17, 2018 4:51 pm

I did of course.

Who is online

Users browsing this forum: zhanggx9 and 2 guests