Mega 2560 with esp8266 communication with WiFi module failed

As indicated in previous replies, why does you wiring diagram show the ESP connected to pins 0 and 1 while using Serial1 on the Mega?

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.