-->
Page 1 of 5

esptool.py: Exception('Invalid head of packet')

PostPosted: Sun Oct 26, 2014 1:43 pm
by stb
I'm getting this on my Mac and from the Linux VM from the 0.9.2 SDK:
Code: Select all./esptool.py --port /dev/cu.usbserial 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


Any ideas? I think the module is in firmware mode, since through the terminal, I'm only getting gibberish on power-up, and the AT commands don't work anymore. If I remove the pull-up on GPIO2 and the pull-down on GPIO0, everything is back to normal.

Re: esptool.py: Exception('Invalid head of packet')

PostPosted: Sun Nov 02, 2014 9:27 pm
by Fadi
Getting that same problem as well.

UPDATE: Ok so after a bit more testing, I left GPIO2 floating!
(although https://github.com/esp8266/esp8266-wiki/wiki/Uploading states it should be HIGH)
and was able to get the firmware onto there.

Re: esptool.py: Exception('Invalid head of packet')

PostPosted: Wed Nov 05, 2014 4:23 am
by gerardwr
Fadi wrote:Getting that same problem as well.

UPDATE: Ok so after a bit more testing, I left GPIO2 floating!
(although https://github.com/esp8266/esp8266-wiki/wiki/Uploading states it should be HIGH)
and was able to get the firmware onto there.


I've got the same problem on my Mac and on the VM
Code: Select allmac-mini-van-gerard:Documents gerard$ sudo ./esptool.py --port /dev/cu.usbserial 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$


Code: Select allesp8266@esp8266-VirtualBox:~$ sudo esptool.py --port /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 read_mem 0
Connecting...
Traceback (most recent call last):
  File "/usr/bin/esptool.py", line 322, in <module>
    print '0x%08x = 0x%08x' % (args.address, esp.read_reg(args.address))
  File "/usr/bin/esptool.py", line 140, in read_reg
    res = self.command(ESPROM.ESP_READ_REG, struct.pack('<I', addr))
  File "/usr/bin/esptool.py", line 102, in command
    raise Exception('Invalid head of packet')
Exception: Invalid head of packet


I have experimented with GPIO2 as Fadi suggests:
- GPIO2=FLOAT "Invalid head of packet"
- GPIO2=HIGH "Failed to connect"
- GPIO2=LOW "Failed to connect"
I have RESET the ESP between tests.

After reconnecting the module still responds to AT commands. Firmware version reported via AT_GMR is 00160901.

So my result differs from Fadi here.

Could this be caused by the older FW version, or anyone with other suggestions, please?

Re: esptool.py: Exception('Invalid head of packet')

PostPosted: Sat Nov 08, 2014 3:13 pm
by cendev
Same problem here :/ any solution ?