user42813: Im trying to connect my esp8266-01 to my arduino mega 2560 to get the code working from the following video tutorial found on youtube: 
https://www.youtube.com/watch?v=zGgUfAB4m24
This is the code Im using from the youtube video:
#include <SoftwareSerial.h>

#define ESP8266_rxPin 4
#define ESP8266_txPin 5

//SSID + KEY
const char SSID_ESP[] = "SSID";
const char SSID_KEY[] = "PASSWORD";

// URLs
const char URL_youtube[] = "GET https://api.thingspeak.com/apps/thinghttp/send_request?api_key=S7QNK85SG9D9YD27 HTTP/1.0\r\n\r\n";
const char URL_current_temp[] = "GET https://api.thingspeak.com/apps/thinghttp/send_request?api_key=S7QNK85SG9D9YD27 HTTP/1.0\r\n\r\n";

//MODES
const char CWMODE = '1';//CWMODE 1=STATION, 2=APMODE, 3=BOTH
const char CIPMUX = '1';//CWMODE 0=Single Connection, 1=Multiple Connections

SoftwareSerial ESP8266(ESP8266_rxPin, ESP8266_txPin);// rx tx

//DEFINE ALL FUNCTIONS HERE
boolean setup_ESP();
boolean read_until_ESP(const char keyword1[], int key_size, int timeout_val, byte mode);
void timeout_start();
boolean timeout_check(int timeout_ms);
void serial_dump_ESP();
boolean connect_ESP();
void get_youtube();
void get_current_temp();
void get_hilo_temp();

//DEFINE ALL GLOBAL VAARIABLES HERE
unsigned long timeout_start_val;
char scratch_data_from_ESP[20];//first byte is the length of bytes
char payload[150];
byte payload_size=0, counter=0;
char ip_address[16];
char youtube_subs[10];
char youtube_views[13];
char current_temp[5];
char hi_temp[5];
char lo_temp[5];

//DEFINE KEYWORDS HERE
const char keyword_OK[] = "OK";
const char keyword_Ready[] = "Ready";
const char keyword_no_change[] = "no change";
const char keyword_blank[] = "#&";
const char keyword_ip[] = "192.";
const char keyword_rn[] = "\r\n";
const char keyword_quote[] = "\"";
const char keyword_carrot[] = ">";
const char keyword_sendok[] = "SEND OK";
const char keyword_linkdisc[] = "Unlink";


//keywords for youtube
const char keyword_html_start_b[] = "b>";
const char keyword_html_end_b[] = "</b";

//keywords for current temp
const char keyword_html_start_temp[] = "p\">";
const char keyword_html_end_temp[] = "<s";
const char keyword_html_start_body = "<body>";
const char keyword_html_end_body = "</body>";



void setup(){//        SETUP     START
  //Pin Modes for ESP TX/RX
  pinMode(ESP8266_rxPin, INPUT);
  pinMode(ESP8266_txPin, OUTPUT);

  ESP8266.begin(9600);//default baudrate for ESP
  ESP8266.listen();//not needed unless using other software serial instances
  Serial.begin(115200); //for status and debug
  delay(5000);//delay before kicking things off

  setup_ESP();//go setup the ESP 
}//                    SETUP     END

void loop(){//         LOOP     START

  //get_youtube(); // get youtube views and subs
  //delay(15000);//thingspeak needs ~12 secs before next connection

  get_current_temp();//current temperature
  delay(15000);

}//                    LOOP     END

Whenever I run the code everything just fails and Im not able to send AT commands from my arduino to the ESP. 
Im using the following connection between the arduino and the ESP:
**ESP <---------------------> ARDUINO
GND -------------------------- GND
GP2 -------------------------- Not connected
GP0 -------------------------- Not connected
RXD -------------------------- DIGITAL PIN 4
TXD -------------------------- DIGITAL PIN 5
CHPD ------------------------ 3.3V
RST -------------------------- Not connected
VCC -------------------------- 3.3V**

If I connect RESET pin on the arduino to GND and the RX and TX pins on the ESP to digital pins 1 and 0 on the arduino and run the serial monitor and try the AT commands they work fine. 
But when I try to run the AT commands by sending them from the arduino to the ESP (by running the code) I get the failed every time. What am I doing wrong?
Here is the link to the full code:
http://www.kevindarrah.com/wp-content/uploads/2015/01/ESP8266_BASE_01_28_15.zip

user42813: I fixed it by changing everything on the code from SoftwareSerial ESP8266 to the hardware serial: Serial1.
I used the pins 18 and 19 of the hardware serial. I also made sure connect the RX pin of the ESP to the TX pin of the Arduino and do the same with the TX pin. 

42813: <p>Im trying to connect my <strong>esp8266-01</strong> to my <strong>arduino mega 2560</strong> to get the code working from the following video tutorial found on youtube: </p>

<p><a href="https://www.youtube.com/watch?v=zGgUfAB4m24" rel="nofollow noreferrer">https://www.youtube.com/watch?v=zGgUfAB4m24</a></p>

<p>This is the code Im using from the youtube video:</p>

<pre><code>#include &lt;SoftwareSerial.h&gt;

#define ESP8266_rxPin 4
#define ESP8266_txPin 5

//SSID + KEY
const char SSID_ESP[] = "SSID";
const char SSID_KEY[] = "PASSWORD";

// URLs
const char URL_youtube[] = "GET https://api.thingspeak.com/apps/thinghttp/send_request?api_key=S7QNK85SG9D9YD27 HTTP/1.0\r\n\r\n";
const char URL_current_temp[] = "GET https://api.thingspeak.com/apps/thinghttp/send_request?api_key=S7QNK85SG9D9YD27 HTTP/1.0\r\n\r\n";

//MODES
const char CWMODE = '1';//CWMODE 1=STATION, 2=APMODE, 3=BOTH
const char CIPMUX = '1';//CWMODE 0=Single Connection, 1=Multiple Connections

SoftwareSerial ESP8266(ESP8266_rxPin, ESP8266_txPin);// rx tx

//DEFINE ALL FUNCTIONS HERE
boolean setup_ESP();
boolean read_until_ESP(const char keyword1[], int key_size, int timeout_val, byte mode);
void timeout_start();
boolean timeout_check(int timeout_ms);
void serial_dump_ESP();
boolean connect_ESP();
void get_youtube();
void get_current_temp();
void get_hilo_temp();

//DEFINE ALL GLOBAL VAARIABLES HERE
unsigned long timeout_start_val;
char scratch_data_from_ESP[20];//first byte is the length of bytes
char payload[150];
byte payload_size=0, counter=0;
char ip_address[16];
char youtube_subs[10];
char youtube_views[13];
char current_temp[5];
char hi_temp[5];
char lo_temp[5];

//DEFINE KEYWORDS HERE
const char keyword_OK[] = "OK";
const char keyword_Ready[] = "Ready";
const char keyword_no_change[] = "no change";
const char keyword_blank[] = "#&amp;";
const char keyword_ip[] = "192.";
const char keyword_rn[] = "\r\n";
const char keyword_quote[] = "\"";
const char keyword_carrot[] = "&gt;";
const char keyword_sendok[] = "SEND OK";
const char keyword_linkdisc[] = "Unlink";


//keywords for youtube
const char keyword_html_start_b[] = "b&gt;";
const char keyword_html_end_b[] = "&lt;/b";

//keywords for current temp
const char keyword_html_start_temp[] = "p\"&gt;";
const char keyword_html_end_temp[] = "&lt;s";
const char keyword_html_start_body = "&lt;body&gt;";
const char keyword_html_end_body = "&lt;/body&gt;";



void setup(){//        SETUP     START
  //Pin Modes for ESP TX/RX
  pinMode(ESP8266_rxPin, INPUT);
  pinMode(ESP8266_txPin, OUTPUT);

  ESP8266.begin(9600);//default baudrate for ESP
  ESP8266.listen();//not needed unless using other software serial instances
  Serial.begin(115200); //for status and debug
  delay(5000);//delay before kicking things off

  setup_ESP();//go setup the ESP 
}//                    SETUP     END

void loop(){//         LOOP     START

  //get_youtube(); // get youtube views and subs
  //delay(15000);//thingspeak needs ~12 secs before next connection

  get_current_temp();//current temperature
  delay(15000);

}//                    LOOP     END
</code></pre>

<p>Whenever I run the code everything just fails and Im not able to send <strong>AT</strong> commands from my arduino to the <strong>ESP</strong>. </p>

<p>Im using the following connection between the arduino and the ESP:</p>

<pre><code>**ESP &lt;---------------------&gt; ARDUINO
GND -------------------------- GND
GP2 -------------------------- Not connected
GP0 -------------------------- Not connected
RXD -------------------------- DIGITAL PIN 4
TXD -------------------------- DIGITAL PIN 5
CHPD ------------------------ 3.3V
RST -------------------------- Not connected
VCC -------------------------- 3.3V**
</code></pre>

<p>If I connect RESET pin on the arduino to GND and the RX and TX pins on the ESP to digital pins 1 and 0 on the arduino and run the serial monitor and try the AT commands they work fine. </p>

<p>But when I try to run the <strong>AT</strong> commands by sending them from the arduino to the ESP (by running the code) I get the failed every time. What am I doing wrong?</p>

<p>Here is the link to the full code:</p>

<p><a href="http://www.kevindarrah.com/wp-content/uploads/2015/01/ESP8266_BASE_01_28_15.zip" rel="nofollow noreferrer">http://www.kevindarrah.com/wp-content/uploads/2015/01/ESP8266_BASE_01_28_15.zip</a></p>
 42813: <p>I fixed it by changing everything on the code from <strong>SoftwareSerial ESP8266</strong> to the hardware serial: <strong>Serial1</strong>.</p>

<p>I used the pins 18 and 19 of the hardware serial. I also made sure connect the <strong>RX</strong> pin of the ESP to the <strong>TX</strong> pin of the <strong>Arduino</strong> and do the same with the <strong>TX</strong> pin. </p>
