Chat here is you are connecting ESP-xx type modules to existing AVR based Arduino

Moderator: igrr

User avatar
By lorensiuswlt
#69868 Hello fellows..

I'm new to esp8266 and arduino and now working on my iot project. I have problem on flashing nodemcu firmware into esp8266-01 wifi module. I use esptool.py to flash but before flashing i tried to get my device id, so i use this command from command line (i use MacOS).

$sudo esptool.py --port /dev/cu.usbmodem1421 flash_id

This command returns

esptool.py v2.1
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header
.

My configuration as follows:

Image

Mac to Arduino using USB cable. I use arduino uno as usb serial ttl (empty sketch).


ESP8266 - Arduino

GND <-> GND (black)
VCC <-> 3.3v (red)
GPIO0 <-> GND (purple)
GPIO2 <-> 3.3v (orange)
CH_PD <-> 3.3v (pink)
TX <-> TX (via logic level shifter) (yellow)
RX <-> RX (green)

The esp module works normally in normal mode (Esp GIPO0 ->3.3v), i can run AT commands and connect to access point. But if change the GPIO0 to GND in flash mode, i get no response in serial terminal and also the esptool.py returns reponse time out.

Is anything wrong with my configuration? sorry i'm new to this, need your help. thank you.
User avatar
By schufti
#69883 your problem: the µC on Arduino Uno R3 and ESP-01 both want to talk on the same line.
Either remove the Atmel328 from the board or hold it in reset.

Do yourself a favour and spend the 2bucks for an ESP-01 flasher.
User avatar
By dscott
#88342 I know I'm late (i mean REALLY late) adding my 2 cents here, but FWIW some further background to the same problem I had might benefit someone else...

The short answer: schufti is right.

The reason someone might NOT think schufti is right at first: I personally experienced scores, possibly hundreds of successful uploads to an 8266-01 with my personal tool chain that did (and still does) include an UNO-R3 with my own homemade shield to accommodate the 01's needy (compared to EVERY thing else) criteria for setting it to upload vs. normal running state - all without ever having the UNO's reset connected to ground. One day, out of the blue, it all of a sudden and without any warning stopped uploading. I didn't update any libs of any kind. The board didn't get struck by lightning, and the flash shouldn't have by any means been worn out - it just quit working after all that time. Despite having thought a few times about all the uploads to ATTiny84/85's needing the obligatory capacitor between RST/GND - i just didn't occur to me that was the problem because ATTiny's blow chunks every time I forget the capacitor, this little dude has worked for I don't know how long that way. After losing three days to the issue - I finally tried pressing reset as a last resort - damn, I should have started there! :? Another lesson learned.