ESP01 flashing error

I am trying to program an ESP8266-01 WiFi module using an Arduino Uno as a USB to TTL programmer. I have removed the ATmega, grounded the RESET pin (quite useless without the uC though) and converted the 5v TTL to 3.3v with simple diodes. Then, using esptool.py I tried to upload a Bare minimum sketch with the Arduino IDE and later using the following:
However, both ways give me the same output:
I have tried sending AT commands to the ESP01 like "AT" or "AT+GMR" and everything works fine, performed several code variations (mainly timing and baud rate) and to connect the GPIO0 to a pushbutton to ground but I still cannot upload any sketch because of that error.

Code: Select all
python esptool.py -b 57600 -p /dev/cu.usbport write_flash 0x000000 "nodemcu.bin"
However, both ways give me the same output:
Code: Select all
A fatal error occurred: Failed to connect to ESP8266: Invalid head of packet ('\x08')
I have tried sending AT commands to the ESP01 like "AT" or "AT+GMR" and everything works fine, performed several code variations (mainly timing and baud rate) and to connect the GPIO0 to a pushbutton to ground but I still cannot upload any sketch because of that error.
