cendev wrote:Same problem here :/ any solution ?
Yep!
See my message above, I had the same problem. Tried a MILLION things, but to no avail.
This morning I wanted to give up, the ESPTOOL.PY command "read_mem" kept giving "invalid packet head", no matter what I tried.
Before calling it quits and throwing the module in the bin, I tried write_flash…….. that works! !@#$%$#&^%$
See the log below for the difference:
Mac-mini-van-gerard:Documents gerard$ sudo python ./esptool.py --port /dev/tty.usbserial-A4004QZw read_mem 0
Connecting...
Traceback (most recent call last):
File "./esptool.py", line 322, in <module>
print '0x%08x = 0x%08x' % (args.address, esp.read_reg(args.address))
File "./esptool.py", line 140, in read_reg
res = self.command(ESPROM.ESP_READ_REG, struct.pack('<I', addr))
File "./esptool.py", line 102, in command
raise Exception('Invalid head of packet')
Exception: Invalid head of packet
Mac-mini-van-gerard:Documents gerard$ sudo ./esptool.py --port /dev/cu.usbserial-A4004QZw write_flash 0x00000 0x00000.bin
Connecting...
Erasing flash...
Writing at 0x00008400... (97 %)
Leaving...
Traceback (most recent call last):
File "./esptool.py", line 351, in <module>
esp.flash_finish(False)
File "./esptool.py", line 188, in flash_finish
raise Exception('Failed to leave Flash mode')
Exception: Failed to leave Flash mode
Mac-mini-van-gerard:Documents gerard$
My connections were:
- FTDI Usb-serial module 3.3V, GND, RX and TX to ESP8266 module
- CH-PD to 3.3V
- GPIO0 to GND for firmware update (leave it floating for normal operation)
- other ESP8266 pins remain not connected
I lost several days of my life getting this thing to update
Not sure if I understand the read_mem command of esptool the wrong way (BTW dump_mem resulted in the same error), or that the read_mem command is faulty. Don't care anymore…. moving on!!