Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A fatal error occurred: Invalid head of packet (0x00): Possible serial noise or corruption. #11642

Closed Answered by avinashboy
avinashboy asked this question in Q&A
Discussion options

Sketch uses 307051 bytes (23%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20936 bytes (6%) of dynamic memory, leaving 306744 bytes for local variables. Maximum is 327680 bytes.
esptool v5.0.0
Serial port COM6:
Connecting....
A fatal error occurred: Invalid head of packet (0x00): Possible serial noise or corruption.

Failed uploading: uploading error: exit status 2

You must be logged in to vote

I was having issues with ESP32 version 3.3.0 not working as expected. After downgrading to version 3.2.1, everything started working fine again

Replies: 4 comments

Comment options

This is my code:

#define BUZZER_PIN 12 // GPIO pin connected to buzzer
// Function declarations
void happyBirthday();
void setup() {
 Serial.begin(115200);
 
 // Configure PWM for the buzzer (ESP32 Arduino Core 3.x syntax)
 ledcAttach(BUZZER_PIN, 1000, 8); // Pin, frequency, resolution
 
 Serial.println("ESP32 Passive Buzzer Ready!");
}
void loop() {
 happyBirthday();
 delay(5000);
 
}
// Musical note frequencies
int NOTE_C4 = 262;
int NOTE_D4 = 294;
int NOTE_E4 = 330;
int NOTE_F4 = 349;
int NOTE_G4 = 392;
int NOTE_A4 = 440;
int NOTE_B4 = 494;
int NOTE_C5 = 523;
int NOTE_D5 = 587;
int NOTE_E5 = 659;
int NOTE_F5 = 698;
int NOTE_G5 = 784;
// Play "Happy Birthday" - Full Version
void happyBirthday() {
 int noteDuration = 400;
 int pause = 80;
 
 // "Happy birthday to you" (first line)
 playTone(NOTE_C4, noteDuration); delay(pause);
 playTone(NOTE_C4, noteDuration/2); delay(pause);
 playTone(NOTE_D4, noteDuration); delay(pause);
 playTone(NOTE_C4, noteDuration); delay(pause);
 playTone(NOTE_F4, noteDuration); delay(pause);
 playTone(NOTE_E4, noteDuration*2); delay(pause*3);
 
 // "Happy birthday to you" (second line)
 playTone(NOTE_C4, noteDuration); delay(pause);
 playTone(NOTE_C4, noteDuration/2); delay(pause);
 playTone(NOTE_D4, noteDuration); delay(pause);
 playTone(NOTE_C4, noteDuration); delay(pause);
 playTone(NOTE_G4, noteDuration); delay(pause);
 playTone(NOTE_F4, noteDuration*2); delay(pause*3);
 
 // "Happy birthday dear [name]"
 playTone(NOTE_C4, noteDuration); delay(pause);
 playTone(NOTE_C4, noteDuration/2); delay(pause);
 playTone(NOTE_C5, noteDuration); delay(pause);
 playTone(NOTE_A4, noteDuration); delay(pause);
 playTone(NOTE_F4, noteDuration); delay(pause);
 playTone(NOTE_E4, noteDuration); delay(pause);
 playTone(NOTE_D4, noteDuration*2); delay(pause*3);
 
 // "Happy birthday to you" (final line)
 playTone(NOTE_B4, noteDuration); delay(pause);
 playTone(NOTE_B4, noteDuration/2); delay(pause);
 playTone(NOTE_A4, noteDuration); delay(pause);
 playTone(NOTE_F4, noteDuration); delay(pause);
 playTone(NOTE_G4, noteDuration); delay(pause);
 playTone(NOTE_F4, noteDuration*3); delay(pause*4);
}
You must be logged in to vote
0 replies
Comment options

I’ve tried all the methods on my current laptop, but it’s not working. On another laptop, everything works fine. I’m not sure what’s wrong here. Could you help me figure out the problem or how to find a solution? Thanks in advance for your help!

Esp32 version is 3.3.0 & Arduino IDE version is 2.3.6

You must be logged in to vote
0 replies
Comment options

I was having issues with ESP32 version 3.3.0 not working as expected. After downgrading to version 3.2.1, everything started working fine again

You must be logged in to vote
0 replies
Answer selected by avinashboy
Comment options

hey, it started working after downgrading too for me, maybe there is a problem with the version 3.3.0 because it also works with esp-idf on visual studio code

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /