After months of being able to program an ESP32, I am now unable to do so:
Sketch uses 198834 bytes (15%) of program storage space. Maximum is 1310720 bytes.
Global variables use 13248 bytes (4%) of dynamic memory, leaving 314432 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port COM4
Connecting…….._____….._____….._____….._____….._____….._____….._____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Device Manager shows the following:
I press the BOOT button as I have done for months, but now it is ignored, and I get the ‘Failed to connect’ error.
I admit that I have somehow caused the error, but I don’t know how to fix it.
A little history, I have been using ESP32s for many months now. Recently, I added an ESP-PROG to my hardware, successfully. A few days ago, I screwed things up most likely due to Zadig. My setup stopped working and I incorrectly convinced myself that I needed to tweak the Dual RS-232 Interface 1. I went wild with Zadig and now my Com port is not recognized when I try to upload code.
I’m trying, unsuccessfully, to get my Com port back to where it can be used to program my ESP32. I can program an Uno. My latest attempt was to remove the Arduino IDE’s, both 1.X.XX and 2.X.XX. I rarely use them as I am a convert to PlatformIo. My thought was by reinstalling the IDE, my Com port would be restored. This was based on a comment that I read from someone else suffering the same fate. He had success. I did not. After reinstallation and adding the URL that allows for ESP32 recognition under the IDE, I loaded a known ESP32 blink program that was simple, yet normally works. My Com port was greyed out (as expected). I loaded a CP210X USB to UART Bridge driver. This set my port to Com4 as had always been the case. I then made several upload attempts with all of them failing. What am I missing? My USB port is configured as Com4, but I am not putting the ESP32 into upload mode when I push the boot button.
It’s my fault. I want to fix it so I can once again upload to my ESP32. Am I screwed? Do I need to research how to upload using my ESP-PROG? Thanks for any helpful input.
Him Paul.
I’m not sure how to solve the issue.
I would suggest all the steps that you’ve done already.
Check that you don’t have any peripherals connected to the GPIOs that might prevent flashing mode.
My advice is to try to use another board and forget about that one. Maybe something is fried and it can’t go into flashing mode?
I had a similar issue a few weeks ago, the error was different but I couldn’t upload any code to the board. It turns out the memory was corrupted. I’m not sure if that’s the case with your board… But, if you can afford another board, I think it’s the best thing to do.
I’m sorry that I can’t help much.
Regards,
Sara
Thanks for responding, Sara. I have many ESP32’s and I will try replacing my current on later today.
The frustrating thing is I am studying your book “Build Web Servers with the ESP32 and ESP8266, Second Edition”. I am at 3.1 – Web Server: Display Sensor Readings (SSE). I am starting to slowly become a PlatformiO power user and was really enjoying understanding how to use this fantastic extension. This is very frustrating not being able to continue. I’m hoping I get it figured out.
Your books are fantastic. I can’t say enough good about them. I made Christmas lights for both of my daughters using individually addressable LEDs. The interface was very crude. I knew a webpage interface was possible. I just didn’t know how to do it. Your book “Build Web Servers with the ESP32 and ESP8266, Second Edition” was the perfect tutorial for me to learn enough HTML to make a nice, user-friendly interface. Now I just need to be able to program ESP32’s again.
I will figure out a solution.
Thanks,
Paul
I tried a different ESP32 to no avail. Right now I am trying to upload my code using an esp-prog. Hopefully, that works.
Paul
I was able to upload code to an ESP32 using an ESP-PROG. This is good news.
Paul
Thanks for your nice words about our eBook.
I’m really glad that you find it useful.
But, can you upload the code without the ESP-PROG?
Does that happen with all your ESP boards with Arduino IDE and platformIO?
Regards,
Sara
I can only upload my code when I use an ESP-PROG no matter which ESP32 I am using or whether I am using the Arduino IDE or PlatformIo. Basically, I messed up my USB to serial port configuration when I used the Zadig tool for modifying the USB driver.
I’m not the first person to screw things up with the Zadig tool. You can Google similar problems.
Ok, I understand now.
I’m not familiar with that tool.
I’m sorry that I can’t help much.
Regards,
Sara
No worries, Sara. I have a workable solution. If I ever totally figure it out, I will post what I did wrong and how to fix it.
Your books and samples are superb. If you ever write a radio button sample, I would love to see it.
Paul