Exit code 2 (oxb)

Recently I started working with an esp32 and a sound sensor. When I finshed the code, it worked without any problem, but a couple of days ago, it stopped working. I tried pressing the boot buttom in the plate to switch to download mode but it didn't work.
Does anyone know how to solve this?

Hi @k_shrobster. Please try this:

  1. Select Sketch > Upload from the Arduino IDE menus.
  2. Watch the black output panel at the bottom of the Arduino IDE window until you see this text printed:
    Connecting...
    
  3. Press and hold the button on your ESP32 board.
    if your board has multiple buttons, you might have to do some trial and error to determine which is the one you need to press.
  4. Wait about one second.
  5. Release the button.

The upload should now finish successfully.

I need some help with my esp32 proyect.
While I was working on it one day it was working properly. but the next day when i came back to try it out it just showed and error (Failed uploading: uploading error: exit status 2). Ive checked out ways to fix it like restarting the plate or pressing the boot button... None of them work and I still dont know why, does anyone know how to fix it???

In a case like this, please always:

  • upload the code you're testing with
  • post the full error message you get in the IDE

const int Pin_Mic = 2;
int Pin_Led = 4;

void setup(){
// Init Serial
Serial.begin(9600);
Serial.println(F("Initialize System..."));
// Init Microphone
pinMode(Pin_Mic, INPUT);
pinMode(Pin_Led, OUTPUT);
digitalWrite(Pin_Led, LOW);
}

void loop(){
int sensor = analogRead(Pin_Mic);
Serial.print(F("dB:"));
Serial.println(sensor);
delay(100);
if(sensor > 4060){
digitalWrite(Pin_Led, HIGH);
}else{
digitalWrite(Pin_Led, LOW);
}
}

Thanks; that already helps.

What kind ESP32 board do you have? Can you post a photo?
What kind of circuit have you built around it; can you post a schematic?

I cant post a photo but the model of the plate is the ESP32-Wroom-32 from AZ delivery
I cant upload an schematic but it is a basic circuit with the led and a resistence and a conection with the sounds sensor: I have conected 3 diferent cables out of 4 from the mic, two of them are the gnd and 5v and the other one is the analogical pin. They are connected to the GND, the other to the 5V and the analog is conected to the pin 2

@xXxPatitoJuanxXx @k_shrobster
Please use only one forum account.
The use of duplicate accounts is a serious violation of the forum rules.

Sorry, he is a friend of mine. We are working in the same project.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.