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 and grounded the RESET pin (quite useless without the uC though).
Then, using esptool.py I tried to upload a Bare minimum sketch with the Arduino IDE and later using the following:

python esptool.py -b 57600 -p /dev/cu.usbport write_flash 0x000000 "nodemcu.bin"


However, both ways give me the same output:

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, but I cannot upload any sketch because of that error.

I also followed esp8266 official forum advice to edit the Python script according to the following, but without success.

Line 43 ESP RAM BLOCK = 0x1800 //change this to 180
Line 44 ESP RAM BLOCK = 0x400 //change this to 40


The level conversion from 5v TTL to 3.3v is done through simple resistor node (2k and 1k), while RST is kept at Vcc through 10k pull-up resistor and a push button to ground it.
Your wiring sounds wrong.

Tie CHPD to Vcc (3.3v) to enable the device. 

Tie GPIO0 to ground as you power up, to put it into programming mode. 

RST can be left floating, or PULL (not tie!) up to Vcc through a resistor, say 10k.

That diode level shifter arrangement is unusual. A potential divider on the ESP's RxD is all you need - say 1k and 2k.