The ESP32 has a few problems when you are trying to upload new sketches or install the ESP32 add-on. This is the ESP32 troubleshooting guide for Arduino IDE.
Important: Install the latest version of the Arduino IDE and make sure it's up-to-date. Other unexpected problems and mistakes might result from using a different Arduino IDE version.
Note: In the ESP32, Espressif found some silicon design errors that might be responsible for some unexplained errors or behaviors. In the following document, the errors are detailed:
3.1 (related to power-up and deep sleep wake-up) and 3.4 (referring to not restarting on brownout) are particularly noteworthy. The older v0 and v1 chips were used in modules labeled ESP32-WROOM-32. The errors have been corrected in modules ESP32-WROOM-32E and any other ESP32 designation that ends with E.
For more information, visit https://www.espressif.com/en/products/modules. We recommend searching for the ones labeled ESP32-WROOM-32E to prevent issues with your ESP32.
1. How do I install the ESP32 add-on for the Arduino IDE?
The Arduino IDE has an add-on that enables you to program the ESP32 using the Arduino IDE and its programming language. To prepare your Arduino IDE to work with the ESP32 in your operating system, complete the following article:
2. I can’t see the ESP32 boards in the Arduino IDE Tools menu (Windows PC)
If you still don't see the boards in the Arduino IDE, be sure to scroll all the way down by clicking on the small arrow (highlighted in the figure below):
We recommend repeating the installation process from scratch if you can't find your ESP32 board name at this time.
3. C:\\Users\\ User\\Documents \\Arduino\\ hardware\\ espressif\\ esp32/tools /xtensa-esp32-elf /bin/ xtensa-esp32- elf-g++”: file does not exist
If you open the Arduino IDE after installing the ESP32 add-on and it fails to compile code for your ESP32 board, we recommend re-running the ESP32 add-on installation.
Note: Multiple Arduino IDE versions are often installed on Windows PCs (portable and local installs). If you installed the ESP32 add-on, make sure you are running the Arduino IDE.
4. A fatal error occurred: “Failed to connect to ESP32: Timed out… Connecting…”
If you try to upload a new sketch to your ESP32 and it fails to connect to your board, that means your ESP32 is not in flashing or uploading mode.
After having the right board name and COM port selected, follow these steps:
- Hold down the “BOOT” button on your ESP32 board.
- Press the “Upload” button in the Arduino IDE to upload a new sketch.
- After you see the “Connecting…” message in your Arduino IDE, release the finger from the “BOOT” button.
- After that, you should see the “Done uploading” message.
That's all. The new sketch should be running on your ESP32. After uploading a new sketch to those boards or that configuration, press the “ENABLE” button to restart the ESP32 and run the newly uploaded sketch.
You'll have to repeat that button sequence each time you wish to upload a new sketch. However, if you want to solve this problem once and for all without having to press the “BOOT” button, follow the suggestions in the following guide:
To be honest, we're not sure why this occurs on newer boards. We don't have any ESP32 boards that behave like that. We think there is something wrong with your flashing board or that the Arduino IDE fails to transmit the right instruction sequence to put the ESP32 in flashing or uploading mode automatically.
5. Error compiling WiFiScan sketch
If you try to upload the ESP32 WiFiScan.ino sketch from the ESP32 Getting Started guide, you will get the following error:
And it fails to compile with a similar error message:
In function ‘void setup()’: ScanNetworks:52: error: ‘class WiFiClass’ has no member named ‘firmwareVersion’ String fv = WiFi.firmwareVersion();
Instead of using the ESP32 WiFi library, it looks like your Arduino IDE is compiling the WiFi library for the Arduino board.
Note: You're not going to use a WiFi shield with your Arduino board, right? You need to remove that folder or those folders from your Arduino IDE if you don't use them (for example, by moving them to your desktop).
The WiFi library is located, on a similar path:
Restart your Arduino IDE and try to compile the code again after removing the entire WiFi library folder from one location or both locations.
6. COM Port not found/not available
If you put the ESP32 plug into your PC but can't find the ESP32 port in your Arduino IDE (it's greyed out):
It might be one of these two problems: 1. USB drivers are missing; or 2. USB cables have no data wires.
1. It usually means you don't have the USB drivers installed if you don't see your ESP's COM port available. Check the name of the chip on the board that is next to the voltage regulator.
The ESP32 DEVKIT V1 DOIT board uses the CP2102 chip.
To find the drivers and install them on your operating system, search Google for your particular chip.
The CP2102 drivers are available for download from the Silicon Labs website.
Restart the Arduino IDE when they have been installed, and you should be able to see the COM port in the Tools menu.
2. If you've installed the drivers but can't see your device, make sure you're using a USB cable with data wires.
USB cables from power banks often lack data wires (they are just for charging). As a result, your computer will never be able to establish serial contact with your ESP32. Your issue should be resolved by using a proper USB cable.
7. Arduino IDE Serial Monitor “doesn’t work”
If the ESP32 only prints weird text or gibberish messages in your Arduino IDE Serial Monitor, make sure you have the right COM port chosen and the weird baud rate set as shown below. In most cases, we're using a baud rate of 115200.
8. Error: “Brownout detector was triggered”
When you open the Arduino IDE Serial Monitor, the error message “Brownout detector was triggered” is printed repeatedly. It means there is a hardware issue of some sort.
It’s often related to one of the following issues:
- Poor-quality USB cable.
- The USB cable is too long.
- Board with some defects (bad solder joints).
- Bad computer USB port.
- Or not enough power provided by the computer's USB port.
Solution: Try a shorter USB cable (with data wires), a different computer USB port, or a USB hub with an external power supply.
9. I can’t make the ESP32 add-on work with Arduino IDE
If you've tried everything and the ESP32 add-on still doesn't work with the Arduino IDE, we recommend experimenting with programming the ESP32 using the Atom text editor and PlatformIO IDE. Continue reading this post: Programming ESP32 with Atom Text Editor and PlatformIO IDE.
We hope you find ESP32 Troubleshooting Guide helpful. If you run across any other issues, please post them in the comments section below, and we'll try to help you solve them.
If you like ESP32, you may also like:
- Install ESP32 Board in Arduino IDE in less than 1 minute
- Get MAC Address of ESP32/ESP8266 and Change It (Arduino IDE)
- Getting Started with MicroPython on ESP32 and ESP8266
- How to Install ESP32 Boards in Arduino IDE 2.0
We hope you find this tutorial useful. Thanks for reading.