Arduino mega + esp

It’s a pity you didn’t edit your existing post as I asked, rather than re-posting the code again. I’ll delete your post that has the incorrectly formatted code.

Personally, I wouldn’t start trying to Flash the ESP-01 with an updated firmware until you’ve tried a regular Wi-Fi network.