I am getting the following errors when I try and upload a simple sketch to the ESP32
Archiving built core (caching) in: /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_cache_403549/core/core_espressif_esp32_node32s_FlashFreq_80,UploadSpeed_921600_b81e46ca5d0311887b6f51e603a22d30.a
Sketch uses 163224 bytes (12%) of program storage space. Maximum is 1310720 bytes.
Global variables use 11164 bytes (3%) of dynamic memory, leaving 283748 bytes for local variables. Maximum is 294912 bytes.
esptool.py v2.3.1
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
I am using NodeMCU 32S on Macbook Pro.
I initially had problems with serial port but now have solved that when I saw it was being blocked in Security settings. I now see the SLAB port fine.
However it is not downloading to the board.
Hi David,
That problem usually happens when there’s a bad USB cable, some error in your circuit or a power issue that causes the ESP32 to crash during uploading mode.
I’ve saw that you already tried with different USB cables. Do you have any component or circuit connected to your ESP32?
No just an LED and a resistor. I am at the blink test stage.
It intermittently works fine and then I get this error above. It seems to happen even when I use the same cable.
Despite all my previous posts saying I have fixed the problem, I have not as they keep recurring.
I have tried to test again and the port has yet again disappeared. Even when I do get the port back, I get the error message above when uploading. V occasionally it works.
Not sure how to resolve this.
Right now, it looks like your drivers are properly installed, otherwise you would never see the board connected to your computer.
If you can’t always see the board or have problems uploading code to your ESP32 means that you have bad connection to your computer – whether it’s a bad USB port, bad USB cable or the USB port doesn’t provide enough power.
Can you remove all the circuit from your ESP? It’s just to keep testing without having to worry about another variable that might be causing problems (like using extra power)…
Some USB ports are really used and sometimes they cause problems with these device (for what I can tell this is problem that readers have).
Do you have a USB hub for example that you would connect to your Mac? (You would plug the ESP32 to the USB hub…)
Hi, I have removed the all circuits and connected to an externally powered USB hub. It worked 1st time and not the 2nd or 3rd, with nothing changed. V occasionally it works, but mostly not. I have tried different cables, including one I know that works with ESP8266.
I am at a loss and can not proceed with the course at this stage.
Do you have different ESP32 boards (from different vendors)?
Does that happen with all the boards?
You are doing everything right and it should be working… So, I can only assume that you are using a faulty board that causes all those issues…
I have now ordered a 2nd board based on the type and supplier that you used. So hopefully that will fare better. Visually, the one I have is identical to the DOIT version, but it is a NodeMCU 32S. I will need to now wait.
I suppose one other thing I could try is to power the unit externally, could this help? If so, could you advise on which pins to use and what supply?
I don’t think using an external power supply will make a difference, because you’ve already used a USB hub with power source.
I think you had bad luck and you’ve received a board that has some sort of problem that causes those crashes and unstable behavior. Using an external power source would require you to upload code with an FTDI, for example.
I would recommend trying to use the ESP32 in another computer as a last test, but I really think that you’re using a faulty board that has some bad connection/component that causes that issue.
Thanks. I did test with external power. No difference. I will try another computer.
Let me know if that’s a problem with the computer or with the actual board. Thanks!
I have gone through the setup process on a PC running Windows 10 as well and I am getting the same error. So it looks as though I have a faulty board. I now have the same DOIT board on order that you use from the same supplier. I just need to wait for it to arrive.
Will let you know how I get on.
After many emails with the ESP32 supplier (in Asia) I have now returned the board to Amazon and re-ordered an Espressif ESP32 ESP32-DEVKITC inc ESP-WROOM-32 soldered dils CE FCC Rev. 1. from Olimex Ltd. in the UK via Amazon. The first thing I noticed was the new board was immediately recognised as “Silicon Labs CP210x USB to UART Bridge on COM 7. My pulse raced…. The other observation was with the old board on connection the red LED flashed quickly for a few seconds, then turned off. My new board illuminates constantly. I am pleased to say I have compiled and uploaded a sketch sucessfully and I can continue with the course. YAY…!
Rui, by the way I have your new book and will write a review after my operation next week when I am laid up. It’s been to my Code Club and the kids have already build some of the projects – Well Done!
Thanks Ian. My board shows a solid red light and connects ok now to the UART bridge. However it still fails on upload.
Luckily I’ve never received a bad board… But unfortunately that happens with these inexpensive boards. Let me know if everything works fine when you receive the new board. Thanks for providing all those steps to help me understand possible problems in different setups and scenarios.
@Ian thanks for your help, I would love if you could post a honest review on Amazon, because that would help me a lot. There seems to be some sort of problem with the reviews on my book… A few readers tried to submit and they cannot get the reviews approved. Not sure what’s going on and I hope it works for you. Let me know if you have any problems, because I’m trying to understand what’s going on.Thanks!
I just took delivery of my DOIT dev board and it works flawlessly. So the issue seems to be down to the board I ordered.
Now I can get back to the course, which looks fun
David
That’s great news David, the same thing happened to me. It was very frustrating. I think I spent hours trying to resolve it. Anyway, I will resume the course on Friday as I have been busy at work getting up to speed with outstanding projects.