Can't connect to my esp01

So my team tried to connect arduino MEGA 2560 + ESP-01
we flash the necessary AT firmwares, download the latest blynk libraries but could not make the ESP 01 connect to the blynk server. There are times that it connects, but the connection will drop after 20 to 30 seconds.! Here’s my serial monitor after uploading the code to the MEGA board

[9] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.1 on Arduino Mega

[592] Connecting to PLDTHOMEDSLPAKABITKADIN
[3642] AT version:1.1.0.0(May 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb)
Ai-Thinker Technology Co. Ltd.
Jun 13 2016 11:29:20
OK
[10771] +CIFSR:STAIP,"192.168.1.10"
+CIFSR:STAMAC,"60:01:94:4c:94:d4"
[10779] Connected to WiFi
[21219] Redirecting to 45.55.96.146:8080

And the nothing happens.
any suggestions on what might be the problem?
here’s my code

#define BLYNK_PRINT Serial


#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <DHT.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "MYAUTHTOKEN";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "MYSSID";
char pass[] = "MYPASSWORD";

// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);

#define DHTPIN 22          // What digital pin we're connected to

// Uncomment whatever type you're using!
#define DHTTYPE DHT22     // DHT 11
//#define DHTTYPE DHT22   // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21   // DHT 21, AM2301

DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
void myTimerevent ()
{
  Blynk.virtualWrite(V7, millis() / 1000);
}

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, h);
  Blynk.virtualWrite(V6, t);
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth,wifi, ssid, pass);
  // You can also specify server:
 // Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 8442);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8442);

  dht.begin();

  // Setup a function to be called every second
  timer.setInterval(1000L, sendSensor);
  timer.setInterval(1000L, myTimerevent);
}

void loop()
{
  Blynk.run();
  timer.run();
}

Too much too fast?? both timers are trying to run at the same time… try changing the timer for the DHT22 to 5 seconds (5000L)

And put this up with the Serial.begin()… before your Blynk.begin()… as it might help get the DHT up and running quicker.

I’ll try that later! Thanks for the suggestion.

How is the hardware connected? The ESP is VERY picky about power. Adding a seperate powersupply and some elco’s seems advisable.

-edit

One more, 115200 is way too fast for ESP softserial. Try lowering it to 9600 and set the ESP accordingly with the AT command.

The OP is running Serial1, the 2nd of 4 total hardware UARTs on a Mega… so not softserial. And I can confirm that 115200 runs just fine on Serial1.

Crap, I need to learn to read…

But still, it can’t hurt to try a lower speed. Maybe the ESP itself is not 100%. I got one who works now but doesn’t do any serial output…