Setup arduino uno with ESP8266 ESP-1 Iam trying to set up the arduino uno with the wifi module ESP8266. I use this schematic setup:



I have followed this tutorial: Tutorial ESP8266

Thereby I removed the Mega328P Chip like it says above, I can communicate trough my terminal in the arduino IDE with the ESP-module but when I want to upload an simple test file like this: 

#include &lt;SoftwareSerial.h&gt;


SoftwareSerial ESP8266(0, 1); // RX = 8 en TX = 9

boolean FAIL_8266 = false;

void setup() {
  // put your setup code here, to run once:
   do {
    ESP8266.begin(115200); // start communicatie met esp8266

    //Wait Serial Monitor to start
    while (!Serial);

    ESP8266.print("AT\r\n");

    delay(500);

    if (ESP8266.find("OK")){
        ESP8266.print("ready");
    }

   } while (FAIL_8266);
}

void loop() {
  // put your main code here, to run repeatedly:

}


Than it keeps throwing me this error: avrdude: stk500_getsync() attempt x of x: not in sync: resp=0x20 is it because I removed the Mega328P Chip?

Thereby I've tried the test code from the tutorial here is an link to the code: LINK. 

There it keeps saying that Serial2 was not declared in scope

I'll hope someone can help me out on this one and run an simple test script to communicate with the ESP8266 WIFI Module
You must have your microcontroller in place if you are uploading code to it. 

You can talk to ESP8266 via serial monitor because you are connected directly to the pins of your USB-UART bridge.

Place your uC back, change this line of code:

SoftwareSerial ESP8266(0, 1);

to this one:

SoftwareSerial ESP8266(8, 9);

and change your wires accordingly(what was on pin 0, now connect to pin 8, pin 1 to pin 9).
Now your Atmega can talk to ESP8266 after you upload the code. 

btw. "Serial2" is Serial port for more advance Arduino boards, it won't work on Atmega328 based board.