Hi, i'm new to using ESP01 module and my aim is quite simple, opening a HTTP url whenever a button is pressed, but i cant seem to get it to work
This is the code i have
#include <SoftwareSerial.h>
SoftwareSerial espSerial(2, 3); // RX, TX
void setup() {
pinMode(7, INPUT);
Serial.begin(9600);
espSerial.begin(9600);
delay(1000);
espSerial.println("AT+RST");
delay(2000);
espSerial.println("AT+CWJAP=\"WIFI\",\"PASSWORD\"");
delay(2000);
Serial.println("Upload complete");
}
void loop() {
if(digitalRead(7) == HIGH) {
Serial.println("Initiated");
nya();
}
while (espSerial.available()) {
Serial.write(espSerial.read());
}
}
void nya() {
espSerial.println("AT+CIPSTART=\"TCP\",\"EXAMPLE.COM\",80");
delay(2000);
espSerial.println("AT+CIPSEND=128");
delay(1000);
espSerial.println("GET EXAMPLE_LINK HTTP/1.1");
espSerial.println("Host: EXAMPLE.COM");
espSerial.println("Connection: close");
delay(2000);
espSerial.println("AT+CIPCLOSE");
espSerial.println("Nya!");
delay(2000);
}
However when i execute it, this message pops up in the serial monitor:
initiated
AT+CIPSTART="TCP","EXAMPLE.COM",80
CONNECT
OK
AT+CI
i tried to debug on my own but cant seem to get it to open the http