Post topics, source code that relate to the Arduino Platform

User avatar
By nate4495
#11805 Thanks!! I switched to external 3v3 and the ESP is now working, but for some reason, the output is the same as the input? AKA When I send "AT", or "AT+RST", the ESP responds with that same input, not "OK".. here is my arduino code, I am using an adafruit LCD to display the data so that I can use pins 0,1 for RX, TX.

Code: Select all#include <SoftwareSerial.h>
SoftwareSerial esp8266(1,0);

void setup()
{
  esp8266.begin(115200);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

 display.println(sendData("AT+RST",2000)); // reset module
  displayz(1000);
  display.println(sendData("AT+CWMODE=2",1000)); // configure as access point
  displayz(1000);
  display.println(sendData("AT+CIFSR",1000)); // get ip address
  displayz(1000);
  display.println(sendData("AT+CIPMUX=1",1000)); // configure for multiple connections
  displayz(1000);
  display.println(sendData("AT+CIPSERVER=1,80",1000)); // turn on server on port 80
  displayz(1000);
 
}
void loop()
{   }
void displayz(int timeout)   {
  display.display();
  delay(timeout);
  display.clearDisplay();
  display.setCursor(0,0);
}

String sendData(String command, const int timeout)
{
    String response = "";
    esp8266.print(command); // send the read character to the esp8266
    long int time = millis();
    while( (time+timeout) > millis())
    {
      while(esp8266.available())
      {     
        char c = esp8266.read(); // read the next character.
        response+=c;
      } 
    }
    return response;
}


Any help appreciated!! :)