esptool.py returning "Invalid head of packet" with ESP-01
Posted: Wed Mar 25, 2015 2:08 pm
I'm trying to flash an ESP-01 module using esptool.py, but it keeps returning "Invalid head of packet". I've tried this on 4 computers, used 3 different USB cables, and at both 9600 and 115200 baud rates. It doesn't seem to die at any single point. Sometimes at 0%, sometimes at 45%, sometimes at 56%, etc...
It's hooked up to an FTDI adapter, and am powering it with an external 3.3v power supply capable of supplying 3A. I have it wired as such:
ESP TX -> FTDI RX
ESP RX -> FTDI TX
ESP CHPD -> External Power 3.3v
ESP VCC -> External Power 3.3v
ESP GPIO0 -> External Power GND
ESP GND -> FTDI GND -> External Power GND
I've tried two different firmwares. I'm not sure where the first one came from (I've long since lost the link), but the other is the custom firmware from:
http://goo.gl/ywkTQV
I've redownloaded to make sure it wasn't a bad download.
The first computer was a Mac Pro. Tried with all 3 USB cables (which I use to program Arduino Nanos without a problem).
The second computer was a Macbook Pro. Again, tried with all 3 USB cables.
The third computer was a Windows laptop I borrowed, all 3 USB cables.
The fourth computer was an Ubuntu server. I only tried 1 of the USB cables, but wrote a small bash script to loop trying to program the device over and over to see if it would ever get further than 56% - it didn't.
At this point, I'm stumped. Any ideas, suggestions, assistance, seances, etc... are greatly appreciated. Here is a sample of the output (this is from the ubuntu box after I dropped the module to 9600 baud):
Thanks!
It's hooked up to an FTDI adapter, and am powering it with an external 3.3v power supply capable of supplying 3A. I have it wired as such:
ESP TX -> FTDI RX
ESP RX -> FTDI TX
ESP CHPD -> External Power 3.3v
ESP VCC -> External Power 3.3v
ESP GPIO0 -> External Power GND
ESP GND -> FTDI GND -> External Power GND
I've tried two different firmwares. I'm not sure where the first one came from (I've long since lost the link), but the other is the custom firmware from:
http://goo.gl/ywkTQV
I've redownloaded to make sure it wasn't a bad download.
The first computer was a Mac Pro. Tried with all 3 USB cables (which I use to program Arduino Nanos without a problem).
The second computer was a Macbook Pro. Again, tried with all 3 USB cables.
The third computer was a Windows laptop I borrowed, all 3 USB cables.
The fourth computer was an Ubuntu server. I only tried 1 of the USB cables, but wrote a small bash script to loop trying to program the device over and over to see if it would ever get further than 56% - it didn't.
At this point, I'm stumped. Any ideas, suggestions, assistance, seances, etc... are greatly appreciated. Here is a sample of the output (this is from the ubuntu box after I dropped the module to 9600 baud):
Code: Select all
blj@nas:~/bin/esptool$ sudo ./esptool.py --port /dev/ttyUSB0 --baud 9600 write_flash 0x00000 v0952ATFirmware.bin
Connecting...
Erasing flash...
Writing at 0x00039800... (45 %)
Traceback (most recent call last):
File "./esptool.py", line 536, in <module>
esp.flash_block(block, seq)
File "./esptool.py", line 195, in flash_block
struct.pack('<IIII', len(data), seq, 0, 0)+data, ESPROM.checksum(data))[1] != "\0\0":
File "./esptool.py", line 106, in command
raise Exception('Invalid head of packet')
Exception: Invalid head of packet
Thanks!