Esp8266 to aurdino mega error

You missed an important one :stuck_out_tongue_winking_eye: Hardware uses port 8080 for Local Server, and while not yet enforced, I believe the same goes for Cloud Server.

And of course there could be all sorts of other reasons, but you haven’t provided enough details on your sketch and device hookup, ESP BAUD rate, power sources for the ESP (Do NOT use the 3.3v pin on the Mega… not powerful enough), etc.

All of these issues have been detailed multiple times in this forum.