# Can't Connect to ESP32 Thing - "Invalid head of packet"

**URL:** <https://community.sparkfun.com/t/cant-connect-to-esp32-thing-invalid-head-of-packet/35274>\
**Category:** Arduino\
**Created:** [February 15, 2018, 1:27pm UTC](https://community.sparkfun.com/t/cant-connect-to-esp32-thing-invalid-head-of-packet/35274 "2018-02-15T13:27:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohthepain](https://avatars.discourse-cdn.com/v4/letter/o/919ad9/32.png) [@ohthepain](https://community.sparkfun.com/u/ohthepain)\
**Post date:** [February 15, 2018, 1:27pm UTC](https://community.sparkfun.com/t/cant-connect-to-esp32-thing-invalid-head-of-packet/35274/1 "2018-02-15T13:27:52Z")

</div>

I got a new Sparkfun ESP32 Thing today but I so far I can’t upload a sketch to it in the Arduino IDE.

I am following the steps here: [https://learn.sparkfun.com/tutorials/es … okup-guide](https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide)

I have installed the ESP32 Arduino Core and tools.

I also did git submodule update --init --recursive

- I did not understand the part about FTDI Drivers and skipped it. \*

The board and port show up as described in the tutorial.

I copied in the Blink sketch and tried to run it but I get the error

> A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (‘\x00’)

My error messages:

Arduino: 1.8.5 (Mac OS X), Board: “ESP32 Dev Module, QIO, 80MHz, 4MB (32Mb), 921600, None”

Archiving built core (caching) in: /var/folders/w9/8qrgdgdd0fq8\_64g2vhbv59c0000gn/T/arduino\_cache\_470747/core/core\_espressif\_esp32\_esp32\_FlashMode\_qio,FlashFreq\_80,FlashSize\_4M,UploadSpeed\_921600,DebugLevel\_none\_d13fdf85e7630712b5f36ac536480a92.a

Sketch uses 162213 bytes (12%) of program storage space. Maximum is 1310720 bytes.

Global variables use 11064 bytes (3%) of dynamic memory, leaving 283848 bytes for local variables. Maximum is 294912 bytes.

/Users/paul/Documents/Arduino/hardware/espressif/esp32/tools/esptool --chip esp32 --port /dev/cu.usbserial-DN03GFSC --baud 921600 --before default\_reset --after hard\_reset write\_flash -z --flash\_mode dio --flash\_freq 80m --flash\_size detect 0xe000 /Users/paul/Documents/Arduino/hardware/espressif/esp32/tools/partitions/boot\_app0.bin 0x1000 /Users/paul/Documents/Arduino/hardware/espressif/esp32/tools/sdk/bin/bootloader\_qio\_80m.bin 0x10000 /var/folders/w9/8qrgdgdd0fq8\_64g2vhbv59c0000gn/T/arduino\_build\_795682/sketch\_feb15a.ino.bin 0x8000 /var/folders/w9/8qrgdgdd0fq8\_64g2vhbv59c0000gn/T/arduino\_build\_795682/sketch\_feb15a.ino.partitions.bin

esptool.py v2.1

Connecting…_ **…** _…_ **…** _…_ **…** _…\_\_\_ **…**

A fatal error occurred: Invalid head of packet (‘\x00’)

A fatal error occurred: Invalid head of packet (‘\x00’)

This report would have more information with

“Show verbose output during compilation”

option enabled in File → Preferences.

Also,

When I do “Get Board Info” I get

BN: Unknown board

VID: 0403

PID: 6015

SN: Upload any sketch to obtain it

---

<div class="post-metadata">

**Author:** ![ohthepain](https://avatars.discourse-cdn.com/v4/letter/o/919ad9/32.png) [@ohthepain](https://community.sparkfun.com/u/ohthepain)\
**Post date:** [February 16, 2018, 11:49am UTC](https://community.sparkfun.com/t/cant-connect-to-esp32-thing-invalid-head-of-packet/35274/2 "2018-02-16T11:49:19Z")

</div>

Still working on this …

I tried holding boot while programming, also tried holding down GPIO0

I selected ‘Arduino as ISP’

I tried lowering the flash frequency, flash size, and upload speed, all to no avail.

Flash mode is still set to QIO. I did not install a new python or pyserial or FTDI Drivers. Should I try?

Also, I have heard that these boards are sometimes simply faulty or need resoldering. Should I just get a new board?

---

<div class="post-metadata">

**Author:** ![ohthepain](https://avatars.discourse-cdn.com/v4/letter/o/919ad9/32.png) [@ohthepain](https://community.sparkfun.com/u/ohthepain)\
**Post date:** [February 17, 2018, 9:26am UTC](https://community.sparkfun.com/t/cant-connect-to-esp32-thing-invalid-head-of-packet/35274/3 "2018-02-17T09:26:59Z")

</div>

Here is some more info. I connected to the device with a serial terminal and here is my output. RTS & DTR were turned off.

A lot of gibberish, flash read err, RTCWDT\_RTC\_RESET over and over. So I am wondering if the dev board is constantly rebooting?

(me)$ screen /dev/cu.usbserial-DN03GFSC 115200

r’&�LLHJi���%E5�%U5UE�b�������́��e5E�e�j��%��J�jR2��͡�ɕ�����ɱ��jR\*��}��������݊jR�ets Jun 8 2016 00:22:57

rst:0 (RTCWDT\_RTC\_RESET),boot:0x13 (SPI\_F�e�5��%��E�jR2��͡�ɕ�����ɱ�����:R�Յ�������Ł4"�ets Jun 8 2016 00:22:57

rst:0x10 (WDT\_RTC\_RESET),boot:0x13 (SPI\_FAST\_F��%��E�jR2��͡�ɕ�����ɱ�����4"���}��ii��jR�ets Jun 8 2016 00:22:57

lash read err, 1000\_FAST\_FLASH\_BOOT)\_BOC!+k��ɕ�����ɱ���jR\*��}��������jets Jun 8 ���Ғ�Ҫ�jRjD$���������Q��������Q

}IMI������́��A%}MQ}1M!} ==Q�5)���ɕ�����ɱ���jR\*��}��������݊jR�ets Jun 8 2016 00::57

rst:0x10 (RTCWDT\_RTC\_RESET),b����́��A%}MQ}1M!} ==Q�5)���͡�����ɱ���jR\*��}����������jR��ets Jun 8 2016 00:22:

rst:0x10 (RTCWDT\_RTC\_RESET),boot�́��A%}MQ}1M!} ==Q�5)���͡�ɕ�rr, 1000

ets\_main.c 371

rst:0x10 (RTCWDT\_RTC\_RESET),boot:0x(SPI\_FAST\_FLASH\_BOOT)

flash read e2����jR\*��}����������jR��ets Jun 8 2016 00:22:57

}IMQ���������
