Arduino Mega with Esp8266 incorporated with Blynk

Hi. I am new to this forum. Can anyone help me with my project, please?
I have Arduino Mega with Esp8266 incorporated and I want to connect it to Blynk. I took the code from the examples blynk. After I upload the code on the board, I went to the Serial Monitor to check if the Esp8266 is connected, but I received the follwing message:
[1531] ESP is not responding
What should I do?
Thank you!

    It's very tricky to get it working. Please read this article:

  You’ll need:
   - Blynk IoT app (download from App Store or Google Play)
   - Arduino Uno board
   - Decide how to connect to Blynk
     (USB, Ethernet, Wi-Fi, Bluetooth, ...)

  There is a bunch of great example sketches included to show you how to get
  started. Think of them as LEGO bricks  and combine them as you wish.
  For example, take the Ethernet Shield sketch and combine it with the
  Servo example, or choose a USB sketch and add a code from SendData

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID "template"
#define BLYNK_DEVICE_NAME "name"
#define BLYNK_AUTH_TOKEN "token"

// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial

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

char auth[] = BLYNK_AUTH_TOKEN;

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

// 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);

void setup()
  // Debug console

  // Set ESP8266 baud rate

  //Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  Blynk.begin(auth, wifi, ssid, pass, "", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);

void loop()
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!

There are a few potential reasons why your Arduino ESP8266 might not be responding. Here are a few things you can try:

Make sure the ESP8266 is properly connected to your Arduino board and that all connections are secure.

Check that you are using the correct type of ESP8266 board in your Arduino IDE. Go to Tools > Board and make sure the correct board is selected.

Check the baud rate and make sure it matches the baud rate of your ESP8266 board. You can find the baud rate in the Arduino IDE by going to Tools > Serial Monitor.

Make sure you have installed the necessary drivers for the ESP8266 board. You can find the necessary drivers on the Arduino website or in the Arduino IDE by going to Tools > Board > Board Manager.

If you are using a USB-to-serial adapter to connect the ESP8266 to your computer, make sure it is properly configured and working properly.

Make sure the ESP8266 is getting enough power. If you are using a battery to power the ESP8266, make sure it is fully charged. If you are using a USB connection, make sure the USB port is providing enough power.

Exactly what board is this?

Does the board have a set of DIP switches to select which mode it should operate in?

Your sketch assumes that the ESP8266 is connected to Serial1 (Pins 19 and 18) and that the ESP8266 is set to communicate at a baud rate of 115200
Either of these assumptions may be incorrect, depending on your hardware.

Al;so, if you’ve ever uploaded a sketch to the onboard ESP8266 then you will have over-written the factory AT firmware and it won’t work with Blynk until that firmware is restored.

TBH, using a Mega/Uno/Nano + ESP8266 is a really poor choice of hardware in most situations. You’d be far better choosing an IoT capable board such as the NodeMCU or ESP32, depending on what sort of project you are building and how many analog and digital IO pins you require for the project.


Yes, the board has switches that change the mode I operate in.

And are they configured correctly?


I uploaded some blank code, I went to the Serial monitor, I wrote AT and didn’t appear anything

And what did you expect to happen?

You’re serial monitor is attached to the Serial port, and the ESP8266 is attached to a different COM port (you’re assuming that this is Serial1, although I suspect that it’s actually Serial3, but as you haven’t answered any of my questions it’s impossible to say).

This means that AT commands sent to your serial port won’t be seen by Serial1, or Serial3 if that’s what the ESP is connected to, so you won’t get any response to the command. This is entirely normal.


Well I don’t know for sure how the wifi board inside Mega works. So I am not sure what to write to make the mega communicate with the wifi board inside it.

It looks like this

Okay, I think you need switches 1 and 2 on, and all the others off, and this…

should say Serial3 not Serial1.

But, as I said before, if you’ve uploaded a sketch to teg ESP then it won’t work.


It’s still the same issue. Also, I can upload the code only when the 1,2,3,4 pins are on. By the way, I upload the code on the mega board. I am doing it right?

It should be 3 & 4 to upload to the Mega, if it’s the board I’m thinking of.

Yes, and it’s I’ve said before, if you’ve ever uploaded a sketch to the ESP you will have overwritten the AT firmware.


I think that the AT firmware is ok. I tried to update it with a flasher and it worked. Still, I have the same issue
[1531] ESP is not responding
Have you other suggestions, please? I can’t figure out why it doesn’t connect

So if you’ve re-flashed the firmware it may have a different default baud rate.

You should probably try different baud rates here…


Sir, do you have some free time to connect with me? (I can use Google Meet).

No thanks.
I’d suggest you buy a decent board.


Ok. Thank you very much for your advice! Have a nice evening!