Programming ESP32: how its done and issues that might occur [solved]

Поделиться
HTML-код
  • Опубликовано: 29 авг 2024
  • In this video I show how to program an ESP32 (ESP32-WROOM-32D) with the Arduino IDE and discuss the following three errors that can occur:
    NOTE: please make sure you restart the Arduino IDE after board installation.
    NOTE2: make sure that the com port of the ESP32 shows up in the windows device manager. In some cases you might need to install these drivers:
    www.silabs.com...
    Error 1:
    A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
    * Solution: press "Boot" for at least one second when programming in the connection phase
    Error 2:
    A fatal error occurred: Timed out waiting for packet content
    * Solution: replace USB cable
    Error 3:
    USB device not recognized: The last USB device you connected to this computer malfunctioned, and Windows does not recognize it
    * Solution: replace USB cable

Комментарии • 84

  • @1queijocas
    @1queijocas Год назад +3

    I think the reason why you need to have the right USB cable is that it must transfer data as well as power. Many USB cables are power only

    • @mothunderz
      @mothunderz  Год назад

      Yes indeed the cable must support data transfer and cannot just provide power, but even if you use a power that allows for data transfer there are some cables that dont work. It might be that there is too much cross talk between the wires or that there is too much interference, but the ESP is actually quite picky on the cable used.

  • @KnightBear123
    @KnightBear123 Год назад +3

    Addition : if you don't want to press the boot button when uploading you can use capasitor elcho 1uf 16v/10uf 16v and connect to ground and en

    • @mothunderz
      @mothunderz  Год назад

      Yes, this is a valid point. Thank you for contributing this.

  • @dominichawkins7997
    @dominichawkins7997 2 года назад +1

    BOOM! Finally! Thanks loads! press boot x2 after compiling ':]

  • @vladimirastrelin1719
    @vladimirastrelin1719 7 месяцев назад +1

    Thanks a lot for your advice ! It's really helpful !

  • @codeworId
    @codeworId 2 года назад

    Thank you so much brother i m trying to search the solution of this problem since 4 days bt now it fixed thank you so much🥳🥳

    • @mothunderz
      @mothunderz  2 года назад

      Glad to hear that it worked out for you !!

  • @RajinDragon
    @RajinDragon 2 года назад +2

    I went through about 5 cables trying to get mine programmed, but finally got a good cable and programmed them all. Short thick usb cable.

    • @mothunderz
      @mothunderz  2 года назад

      Great to hear it worked for you!

    • @LiliZorn
      @LiliZorn 2 года назад

      Also had the problem with the usb cable, which is funny because i used that to program the esp8266 which worked fine :-)

  • @KnightBear123
    @KnightBear123 Год назад +1

    why when I reset the esp it still doesn't want to connect to wifi? and the serial monitor reads like random letters and numbers?

    • @mothunderz
      @mothunderz  Год назад

      We should first make a separation between whether you have a problem with programming the ESP or whether you have a problem with connecting to WiFi. If you program something else that simply writes some data to the serial interface, can you see that without problem? If that is the case then programming is not the issue and you should look into the code you use for connecting to WiFi. If this is not the case then focus on why programming is not working. If you give me some more information on what problem you have exactly I can try to help you out.

  • @penyomiraikhan7890
    @penyomiraikhan7890 4 месяца назад

    The error comes as “ A fatal error occurred : Packet content transfer stopped (received 8 bytes) “ Can you please provide a solution asap , I have been banging my head and brainstorming still nothing is working. Also , I’m already using a 10uF capacitor between En and ground still the adamant error persists. Please provide a solution

  • @lazarusmagellan2367
    @lazarusmagellan2367 Год назад

    FYI on Mac m1, you may need to quit and reopen arduino ide after pasting the link for the board installation to show up

    • @mothunderz
      @mothunderz  Год назад +1

      Thank you for your comment! I dont have a Mac myself, but I think also for the PC it is required to restart the Arduino IDE. I will add this to the comments of the video.

  • @DiyintheGhetto
    @DiyintheGhetto 2 года назад +1

    Do you press and hold down the boot while trying to upload after it compiles, Or do you press and release the button while trying to upload after it compiles?

    • @mothunderz
      @mothunderz  2 года назад +1

      During compilation you dont have to press the button. You wait until it is done compiling and tries to upload to the ESP32. Then you press the boot button and hold it a few seconds. You can release as soon as it starts uploading. Hope this works for you!

    • @DiyintheGhetto
      @DiyintheGhetto 2 года назад

      @@mothunderz I bought a 5 pack and the first 2 I got to program with the buttions and the other 3 don't want to program. 1 Out of them 3 the power LED doesn't come up. It seems the LDO and The diode is bad. So I cleared the two that does work and them them all back for new ones.

    • @mothunderz
      @mothunderz  2 года назад

      @@DiyintheGhetto Yes, sounds like bad units. Hope the next batch works for you. Please try as well different USB cables. This can solve the problem too.

    • @DiyintheGhetto
      @DiyintheGhetto 2 года назад

      @@mothunderz I have tons of usb cables and the 3 doesn't work. The one that doesn't power on I thought it might be a USB cable so I changed it 4 times and it still did not power up. So I know these 3 esp32 are bad.

  • @christiancalderon7428
    @christiancalderon7428 11 месяцев назад

    Hello: I'm working with Xiao esp32 light sleep: I put this code at the beginig of the loop function. Now I cannot re-program the device. I've tryed by pressing the boot button while connecting USB-c; but fail to program the Xiao Esp32... I cannot make the device enter in download mode: A fatal error occurred: Failed to connect to ESP32-C3: Wrong boot mode detected (0x1)! The chip needs to be in download mode.
    Please some help.

    • @mothunderz
      @mothunderz  9 месяцев назад

      My apologies, but I am not familiar with the Xiao Esp32

  • @SuperLukelo
    @SuperLukelo Год назад

    I'm getting a fatal error: failed to connect to esp32: download mode successfully detected, but getting jo sync reply: the serial tx path seems to be down

    • @mothunderz
      @mothunderz  Год назад

      Here a few pointers for you to look at:
      I assume you have already verified many different USB cables -> they make a large difference
      Make sure there are no other USB devices on the same USB-hub that you are using. I have seen interference on some computers (depends on the quality of the hub)
      Is it a custom board that you using? In that case, pls check:
      esp32.com/viewtopic.php?t=25493
      Please also consult:
      docs.espressif.com/projects/esptool/en/latest/esp32s3/troubleshooting.html
      I hope you can find the root cause for the problem!

  • @edward090909
    @edward090909 2 года назад

    Mine is still giving issues. Even with capacitor and different cables used, the IDE does not go past "Connecting ......___....". Any other solutions I should try?

    • @mothunderz
      @mothunderz  2 года назад

      The main thing is that during the "Connecting ......___...." phase that you press the boot button. Of course you should make sure that the IDE is properly configured and right serial port selected. No capacitor should be needed. If you then try various cables and nothing works that most likely your ESP is not functional...Hope you get it solved!

  • @ztiger09
    @ztiger09 2 года назад

    I have the wesmos d1 r32 and I had the same issue until I finally was able to upload it but then the circuit does not do any action at all. Like I've made a simple code for led light and nothing happens.

    • @mothunderz
      @mothunderz  2 года назад

      Unfortunately I am not familiar with the wesmos d1. Hope you get your problem solved. What I do recommend is that you start with writing to the serial console. With LEDs there are some things that can go wrong (forget to initiate a port, connect the LED the wrong way around, broken LED, etc). With the serial port there is close to nothing that can go wrong as long as you set the correct baudrate.

  • @orangepoof4654
    @orangepoof4654 Год назад

    how about error: Failed to connect to ESP32: Download mode successfully detected, but getting no sync reply: The serial TX path seems to be down. I try lot of way until i buy new usb cable and still didn't work, press and hold EN & Boot button, restart the ide, laptop etc. Still didnt work, help

    • @mothunderz
      @mothunderz  Год назад

      Please make sure you do not have a phone connected to the computer when programming.
      Have you tried to program on a different computer?
      Have you tried a different usb port on the computer?
      Have you tried a different ESP32?
      Have you tried Arduino IDE 1.x and 2.x?
      By doing the above you should be able to isolate what the problem is.

    • @sujithonhaga8430
      @sujithonhaga8430 5 месяцев назад

      Bro I got the same error on my new 😢 esp32 did you get any solution for this problem

  • @jaykumarmehar4283
    @jaykumarmehar4283 2 года назад

    The WiFi LED is not switching off and am not able to boot the ESP32 using the boot button.

    • @mothunderz
      @mothunderz  2 года назад

      Please try different USB cables and make sure the ESP32 is properly configured. If nothing works than most likely you have a faulty ESP32 unfortunately. Good luck!

  • @narendrarohit8455
    @narendrarohit8455 2 года назад

    Thank you for your tutorial bro, But I'm facing an other error like this "A fatal error occurred: MD5 of file does not match data in flash!"
    how to solve this error please help me on this bro
    thamk you in advance

    • @mothunderz
      @mothunderz  2 года назад

      Unfortunately that sounds to me like you have corrupt memory in your ESP...

  • @goldenentertainment5868
    @goldenentertainment5868 Год назад

    Download mode successfully detected, but getting no sync reply: - how to solve this error ?

    • @mothunderz
      @mothunderz  Год назад

      Sorry to hear this did not work for you. Hope you find a solution for your problem programming the ESP. Some new findings were:
      *) Make sure that there are no phones connected with USB to the computer (they disturb the communication to the ESP)
      *) Try different USB ports

  • @tipofthespear7821
    @tipofthespear7821 2 года назад +1

    It keeps saying no i2c devices found HEELP

    • @mothunderz
      @mothunderz  2 года назад

      To me that error makes no sense as I2C is not used for programming the ESP32. What code are you trying to program? Please start with a simple "hello world" or a simple LED blink code. Did you configure the "ESP32 Dev Module" board in the Arduino IDE? Which version of the ESP32 do you have exactly?

  • @vigneshmani4923
    @vigneshmani4923 3 года назад

    I am facing some errors in compiling esp32 codes.pls give a solution.
    Error-
    variable or field'blynkwidgetwrite1'declared void

    • @mothunderz
      @mothunderz  3 года назад

      Dear Vignesh, the error you are facing has to do with the code, not with the ESP32 itself. Debugging the code is not possible without seeing the complete code, but it seems to me that you did not define a variable properly. See for instance this link, perhaps this can help:
      forum.arduino.cc/t/variable-or-field-declared-void/201442

  • @0124akash
    @0124akash 2 года назад

    Brother am facing problem with ESP32. This device is not connect to wifi serial monitor displayed "trying to connect"
    Please give me a solution.
    LED blink
    wifi scan
    Serial monitor display
    code is properly working.

    • @mothunderz
      @mothunderz  2 года назад

      Hi Akash, sorry for my late reply, was out for a few days. I am not sure what the problem is you are facing and which code you are using. When I first read your comment I thought you are trying to use a "wifi serial monitor", but that does not exist. I think what you are stating is that you cannot connect to wifi and that the serial monitor states "trying to connect". Which code did you use? Perhaps the one from this video?
      ruclips.net/video/0AlATlN95Y0/видео.html
      If that is the case: did you update the username and password to the one of your router? Did you make sure your router is 2.4G capable (the ESP32 does not work with 5G wifi). Good luck! Sander

    • @0124akash
      @0124akash 2 года назад

      @@mothunderz thanks for responding sir. But problem solved. Presently am facing different type problem like,
      I have node MCU chip and worked properly. As you know chip has only one adc pin, so am purchasing esp32. And my project code transfer to esp32 but I feel working is slow compare to nodemcu.
      Code is same for both chip and only header file name change.
      So please tell me what and where is problem ?

    • @mothunderz
      @mothunderz  2 года назад

      @@0124akash the ESP32 should actually be really fast. However that can be very many different reasons why your code is not working well on the ESP. Please try some other reference codes. I hope you find the root cause.

  • @countcustoms7134
    @countcustoms7134 2 года назад

    Thank you so much for this tutorial. It helped me when I was working on ESP32 WROOM. Now, I'm working on ESP32-C3 and having same issue only this time the fatal error is No serial data received. Do you have any clues how do I sort this out? Thanks in advance

    • @mothunderz
      @mothunderz  2 года назад

      Unfortunately I do not have the ESP32-C3 myself and thus have not been able to look into this. So my apologies, but am afraid I cannot help you with this issue. Hope you manage to solve the problem!

    • @eduardozavala1330
      @eduardozavala1330 Год назад

      Did you found the solution? mine was working. got everything done except now i can´t make serial conneciton even tho with all disconnected.

    • @skyvortexhd8774
      @skyvortexhd8774 Год назад

      I have the same error but with the ESP32 Devkit V1. Did you manage to solve your problem and if yes, how?

    • @countcustoms7134
      @countcustoms7134 Год назад

      @@skyvortexhd8774 I managed to solve the problem at first. I got my custom built board running, the only mistake I did was I didn't document the steps I followed. Fast forward to few months later I designed another board with ESP32-C3 only this time without onboard flash chips. Now I have the board I can upload program to it, but I'm not sure if it executes it or not

  • @luisherrera7652
    @luisherrera7652 Год назад

    In my case I had to use a different cable because the port was not recognized.

    • @mothunderz
      @mothunderz  Год назад

      Thank you for your feedback, that is an excellent point. Another thing I noticed is that often times the ESP does not upload when a phone is connected with USB on the same USB hub on the computer. Great you got it working!

  • @nicolasagustinmartinez9310
    @nicolasagustinmartinez9310 2 года назад

    Love you, thats all

  • @educationaltechnology8363
    @educationaltechnology8363 2 года назад

    wonderful 🤝👏👏👏👏 thanks

  • @filtermindmusic4208
    @filtermindmusic4208 2 года назад

    very useful

  • @albertoschwendg
    @albertoschwendg Год назад

    This is the first error I get when compiling any program. Not even programing in Python
    exec: "python": executable file not found in $PATH
    Compilation error: exec: "python": executable file not found in $PATH

    • @mothunderz
      @mothunderz  Год назад

      I have not encountered this issue before, but please check here:
      forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847

  • @pdlngsqrs9547
    @pdlngsqrs9547 2 года назад

    A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0x00)
    1: Capacitor, others have noted resistor, "solution" no good on ESP32_WROOM-32d
    2: boot/enable button press combo 100000000 so no good.
    3: hair loss extreme... 🤯

    • @mothunderz
      @mothunderz  2 года назад

      That sounds like a broken device to me :-/

    • @pdlngsqrs9547
      @pdlngsqrs9547 2 года назад

      @@mothunderz had to resign to that fact and returned it. Using esp8266 instead.-easy

  • @rahulb5360
    @rahulb5360 11 месяцев назад

    hard resetting via rts i am using esp 32

    • @rahulb5360
      @rahulb5360 11 месяцев назад

      suggest me asap

    • @mothunderz
      @mothunderz  9 месяцев назад

      Unfortunately it is not clear to me what you mean

    • @rahulb5360
      @rahulb5360 9 месяцев назад

      @@mothunderz when i run my program i am getting hard resetting via rts pin what should i fot

  • @attariazeddine6603
    @attariazeddine6603 3 года назад

    Merci...

  • @Aj_11135
    @Aj_11135 2 года назад

    Please send link esp 32

    • @mothunderz
      @mothunderz  2 года назад

      Hi Akshay, what exactly do you mean with a link to the ESP32? These devices are developed by ESPRESSIF and the official site is:
      www.espressif.com/en/products/socs/esp32
      For all my videos I use the ESP32-WROOM-32D, which is a common version of the ESP32 that you can purchase at many different stores: Digikey, Mouser, Amazon, Ebay, etc. It depends on the country you live in which of these stores works best. Cheers, Sander

  • @amalsatheesan329
    @amalsatheesan329 2 года назад

    thank u brother

  • @TheJavaSync
    @TheJavaSync Год назад

    Micropython playliat, pls 🙏

    • @mothunderz
      @mothunderz  Год назад +1

      Thank you for the feedback. I have not looked into Micro Python yet, but will do after I finish my BLE tutorial session

  • @kanishkawijayananda6957
    @kanishkawijayananda6957 2 года назад

    i think this is the time waster esp32

    • @mothunderz
      @mothunderz  2 года назад

      Not sure what you mean with the comment, but hope you get your ESP32 going!

  • @beastgamerz3696
    @beastgamerz3696 Месяц назад

    pls be vegan animals also have lifes Radhe Radhe

  • @SaysAnX
    @SaysAnX Год назад

    Perdida de tiempo

    • @mothunderz
      @mothunderz  Год назад

      sorry to hear this did not work for you. Hope you find a solution for your problem programming the ESP. Some new findings were:
      *) Make sure that there are no phones connected with USB to the computer (they disturb the communication to the ESP)
      *) Try different USB ports

    • @SaysAnX
      @SaysAnX Год назад

      @@mothunderz ok

  • @Arihant-xo5wj
    @Arihant-xo5wj Месяц назад

    pls be vegan animals also have lifes Radhe Radhe