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.