Chat freely about anything...

User avatar
By gerardwr
#2364
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:

Code: Select allMac-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!!
User avatar
By stb
#2733
gerardwr wrote:
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! !@#$%$#&^%$

Code: Select allMac-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$



Hhm, I did run the same, and the flashing seems to have gone just fine, according to the console output, but now the module appears to be dead :-( Neither LED on my -01 turns on, pulling GPIO2 high does not change anything.

Before I brick the next one, is there a clear explanation of which file needs to be flashed at which address? I have the feeling that 0x0 has the boot loader, and if you write the application code at that address, it won't quite work.

Edit: nevermind, nothing's bricked. Not sure why the power led didn't come on, but after I switched to a new module and had success with three different firmwares, I tried again with the first module, and I had no problem refreshing it.
User avatar
By rrezaii
#2767 I keep getting the following "Failed to connect" error. I've set GPIO0 to GND and CH_PD to VCC as suggested. If I set GPIO0 to float, I can connected using CoolTerm and send AT commands just fine. What am I missing?


Code: Select allMBPro:~/Downloads/esptool-ck-master$ sudo python ./esptool.py --port /dev/tty.usbserial-FTXLFUXM write_flash 0x00000 /Volumes/200g/at_v0.19_on_SDKv0.9.2_mod/firmware/0x00000.bin
Connecting...
Traceback (most recent call last):
  File "./esptool.py", line 299, in <module>
    esp.connect()
  File "./esptool.py", line 136, in connect
    raise Exception('Failed to connect')
Exception: Failed to connect