• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 Built-in OLED Board (Wemos Lolin32): A fatal error occurred: Invalid head of packet (0x72)

Q&A Forum › Category: ESP32 › ESP32 Built-in OLED Board (Wemos Lolin32): A fatal error occurred: Invalid head of packet (0x72)
0 Vote Up Vote Down
ramatito asked 6 years ago

Hi Rui Santos,

Referring to your tutorial ESP32 Built-in OLED Board (WEMOS Lolin32), I did try out and shows me the following error: –

Sketch uses 220260 bytes (16%) of program storage space. Maximum is 1310720 bytes.

Global variables use 14364 bytes (4%) of dynamic memory, leaving 313316 bytes for local variables. Maximum is 327680 bytes.

esptool.py v2.6
Serial port COM7
Connecting....

A fatal error occurred: Invalid head of packet (0x72)
A fatal error occurred: Invalid head of packet (0x72)
4 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Hello, that error means that your ESP32 OLED board is not in flashing mode.

  1. After pressing the “Upload” button in the Arduino IDE
  2. Hold down the BOOT button in the ESP32 to put it in flashing mode.

Regards,
Rui

0 Vote Up Vote Down
ramatito answered 6 years ago

Good day, Rui Santos,

After following the step, I do get the following error message:-

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "WEMOS LOLIN32, 80MHz, Default, 921600"

A fatal error occurred: Timed out waiting for packet header
A fatal error occurred: Timed out waiting for packet header
0 Vote Up Vote Down
ramatito answered 6 years ago
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "WEMOS LOLIN32, 80MHz, Default, 115200"

Build options changed, rebuilding all
Sketch uses 220260 bytes (16%) of program storage space. Maximum is 1310720 bytes.
Global variables use 14364 bytes (4%) of dynamic memory, leaving 313316 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port COM7
Connecting....

A fatal error occurred: Timed out waiting for packet header
A fatal error occurred: Timed out waiting for packet header

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

 

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

That error means that your ESP32 is not establishing a serial communication with your computer and it fails to upload the code. I’ve encountered that error before (with many ESP32 boards) and it’s always solved by:

  • Ensure that you’ve selected the ESP32 COM Port in the Tools Menu
  • After you see the message “Connecting….”, you need to hold down the BOOT button until the uploading process begins
  • In some cases, using a different USB cable (shorter) fixed the connection issue
  • Your board might be faulty (that’s very unlikely)

Unfortunately to fix that error there’s no clear solution… It’s one of those things… Regards,
Rui

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.