ESP-01 issue with Arduino Mega

I am having the same issue. My ESP-01 responds to AT commands properly with Arduino Mega on serial port(RX0,TX0) but when I check it with seial1/serial3/serial3, it does not respond to AT commands. I check AT command in blank code. Am I doint it in a wrong way?

The USB connector on your Mega is connected to the UART0, which is referenced as Serial. The RX0 and TX0 pins are also connected to the same Serial port.

This means that when you connect the Mega to your PC via the USB connector and connect the ESP-01 to pins RX0 and TX0 you are able to type an AT command in to your serial monitor which passes straight through the Mega to the ESP-01 (because they are directly connected) and the response comes back to the serial monitor via the same route.

When you connect your ESP-01 to Serial1, Serial2 or Serial3, but still have the PC connected to Serial the AT commends are still going to pins RX0 and TX0, and you don’t get a response because the ESP-01 isn’t connected to Serial anymore.
This is normal behaviour.

When you use a Blynk sketch with a Mega, it makes sense to use Serial for debug messages, as there is the built-in USB port that connects directly to Serial (when I say ‘directly’ that’s actually an over-simplification. It’s connected via a TTL to USB adapter on board the Mega, and this is hard-wired to Serial. The other serial ports don’t have this).
The ESP-01 can’t connect to the same port, as AT messages and serial debug messages would get mixed-up and the WiFi/Blynk connection would fail.So, your ESP-01 should be connected to one of the other serial ports and your sketch should be configured accordingly.

Pete.