void setup() { // put your setup code here, to run once: while (!Serial); // wait for serial port to connect. Needed for Leonardo only delay(2000); Serial.begin(9600); Serial.println("USB Serial ready"); //usb port Serial.println("Did you want to change wifi? Enter:"); Serial.println("AT+CWJAP=\"SSID\",\"PASSWORD\""); Serial.print("Want to see a list of networks? Enter:AT+CWLAP"); Serial.println("AT+CWJAP=\"SSID\",\"PASSWORD\""); Serial.println("Want to see your IP? Enter:AT+CIFSR"); Serial1.begin(115200); Serial.println("ESP8266 Serial ready"); //ESP8266 } void loop() { // put your main code here, to run repeatedly: if (Serial.available()) { String str = Serial.readStringUntil('\n'); Serial.println(""); Serial.println("You sent: " + str); Serial1.println(str); } if (Serial1.available()) { char chr = Serial1.read(); if(chr != 0) Serial.print(chr); } }