Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Anelito
#62632 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:

Code: Select allpython esptool.py -b 57600 -p /dev/cu.usbport write_flash 0x000000 "nodemcu.bin"

However, both ways give me the same output:

Code: Select allA 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.

Image
User avatar
By eduperez
#62836 You cannot leave GPIO0 and GPIO2 floating like that: each line must be held high or low, and each combination has a meaning during the boot procedure.
User avatar
By Anelito
#63018 ok so now, apart from VCC and GND, I am using this suggested wiring and still getting the invalid packet error.

    CHPD to Vcc (3.3v) to enable the device.
    GPIO0 to ground through a push button, to put it into programming mode.
    RST pull-up to Vcc through a 10k resistor and a button to ground.
User avatar
By mrburnette
#63055 For the ESO8266-01, I cover the basic connections here:
https://www.hackster.io/rayburne/esp8266-01-using-arduino-ide-67a124

Using the UNO @ 5V and the diodes shunts as you have for level-shifting may simply not work well-enough for flashing: diodes junctions have capacitance when biased "off" and may cause the waveform to be "non-square" or distorted. I did read that the circuit allows you to talk using AT commands, but the "AT" interrupter is in the user-code space and the flash serial code is in silicon.

A 3.3V serial-USB is what I always recommend. Alternately, a low-cap junction zener diode of 3.6V works well in the V-USB circuits and would likely work here. See:
https://www.obdev.at/products/vusb/index.html

Good luck,

Ray