A
A
Alexey Poloz2016-02-06 21:49:29
Arduino
Alexey Poloz, 2016-02-06 21:49:29

WiFi on Arduino: ESP8266 AT commands in client mode how to get a web page?

I successfully connect to the router, server, but I don’t know how to read the data, please tell me (ESP did not flash), preferably using standard AT commands, the answer is not large 1-2 characters
Here is the code:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);
 
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
delay(50);
mySerial.println("AT+CWMODE=1");
Serial.write(mySerial.read());
delay(50);
mySerial.println("AT+CWJAP=\"routerr\",\"1029384756\"");
Serial.write(mySerial.read());
delay(6000);
delay(50);
mySerial.println("AT+CIPMODE=0");
Serial.write(mySerial.read());
delay(50);
mySerial.println("AT+CIPMUX=0");
Serial.write(mySerial.read());
delay(50);
mySerial.println("AT+CIPSTART=\"TCP\",\" arduino.zhodinovel.com\",80");
Serial.write(mySerial.read());
delay(500);
mySerial.println("AT+IPD,10:"); //Вот что здесь надо??? esp выдаёт ошибку
Serial.write(mySerial.read());
delay(500);
}
 
void loop()
{
if (Serial.available()) mySerial.write(Serial.read());
if (mySerial.available()) Serial.write(mySerial.read());
delay(10);
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Poloz, 2016-02-07
@kosyachniy

Who needs this working code:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);

void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
mySerial.println("AT+RST");
mySerial.println("AT+GMR");
mySerial.println("AT+CWMODE_DEF=1");//_DEF
delay(50);
mySerial.println("AT+CWJAP_DEF=\"routerr\",\"1029384756\"");
delay(6000);
mySerial.println("AT+CIPSTART=\"TCP\",\"192.168.1.11\",80");
delay(50);
mySerial.println("AT+CIPSEND=43");
delay(50);
mySerial.println("GET / HTTP/1.1\r\nHost: 192.168.1.11\r\n\r\n\r\n\r\n");
//delay(5000);
//mySerial.println("AT+CIPCLOSE");
}

void loop()
{
if (Serial.available()) mySerial.write(Serial.read());
if (mySerial.available()) Serial.write(mySerial.read());
delay(10);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question