I'm getting an error while uploading my code to esp8266 via an arduino (FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error)))
You need to set esp 8266 to flash mode.
Please connect en PIN to Gnd pin.
Then flash again.