When trying to upload new sketches or install the ESP32 add-on on the Arduino IDE, the ESP32 has a few typical issues. This article is for the ESP32 when used with the Arduino IDE. We’ve put together a list of some of the most common issues with the ESP32 and how to fix them.
1.Install ESP32 Add-on in ArduinoIDE
An add-on for the Arduino IDE that allows us to programme the ESP32 using the Arduino IDE and its programming language is accessible on the internet. The procedure is the same for operating systems such as Windows, Mac, and Linux.
Instructions for Windows
Step 1: In your Arduino IDE, go to File> Preferences.
Step 2: Enter https://dl.espressif.com/dl/package_esp32_index.json into the “Additional Board Manager URLs” in settings.
Step 3: Check to see if the network settings have been configured. Check for No Proxy or Auto-detect proxy settings if your computer is linked to a mobile phone hotspot or WiFi connection without proxy. Similarly, if you’re using a proxy to access the internet, go for Manual Proxy Configuration and enter the proxy information. Tap then presses the “OK” button. In my instance, I’m utilising the internet on my phone, which is set up with Auto-detect proxy settings.
Step 4: Open the Boards Manager. Go to Tools > Board > Boards Manager.
Step5: Search for ESP32 and press install button for the “ESP32 by Espressif Systems”
Step 6: That’s it. The Add-on for ESP32 will be installed after a few seconds. After a successful installation, you can close this window
Step 7: Now Return to the Tools section. Search for ESP32 Dev module or ESP32 Wrover module in Tools > Board.
Your ArduinoIDE with ESP 32 Board Add-on has been successfully configured. With AdruinoIDE, you can now programme your ESP 32.
2. C:\\Users\\ User\\Documents \\Arduino\\ hardware\\ espressif\\ esp32/tools /xtensa-esp32-elf /bin/ xtensa-esp32- elf-g++”: file does not exist
If the Arduino IDE fails to compile code to your ESP32 board after installing the ESP32 add-on, we recommend re-running the Arduino IDE ESP32 add-on installation.
Note that numerous Arduino IDE versions can be installed on a Windows PC (portable and local installations). Make sure you’re using the Arduino IDE with the ESP32 add-on installed.
4. A fatal error occurred: “Failed to connect to ESP32: Timed out… Connecting…”
When you try to upload a new sketch or programme to your ESP32 and it fails to connect, it implies either your ESP32 is not in flashing/uploading mode or you didn’t choose the correct board or com port. Normally, the Arduino IDE sends several command sequences to put the ESP32 into flashing/uploading mode automatically. However, the Arduino IDE fails to send those commands in your scenario.
Fix: Hold the “BOOT” button on your ESP32 board, then press and hold the “UPLOAD” button. Release your finger from the “BOOT” button whenever you see “Connecting…” in the Arduino IDE bottom bar. You will notice the message “Done uploading” after some time.
That’s it. Your ESP32 should have the new sketch running. With those boards/with that setup, after uploading a new sketch, press the “ENABLE” button to restart the ESP32 and run the new uploaded sketch.
5. Error compiling WiFiScan sketch
If you try to upload the ESP32 WiFiScan.ino sketch.
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();
It looks like your Arduino IDE is compiling the WiFi library for the Arduino board (instead of using the ESP32 WiFi library).
Fix: The WiFi library is located, in a similar path:
After removing the entire WiFi library folder from one location or both locations, restart your Arduino IDE and try to compile the code again.
6. COM Port is not found/not available
If you connect your ESP32 board to your computer but are unable to locate the port in your Arduino IDE.
It could be one of the following three issues: 1. USB drivers are not installed 2. No data wires on the USB cable; 3. Your ESP32 is broken.
Case1: USB drivers missing
If you don’t see the ESP’s COM port, it’s because you don’t have the USB drivers installed on your computer. Examine the chip adjacent to the voltage regulator on the board and make a note of its name. It’ll most likely be CP2102. This driver is available on the Silicon Labs website. After installing the CP2012 driver, restart the Arduino IDE (close current tab and reload) and the COM port should appear in the Tools menu.
Case 2:USB cable without data wires
Data wires are missing from some USB cables used by power banks (they are for charging purposes only). As a result, your computer will never be able to communicate serially with your ESP32. Your problem should be solved if you use a suitable USB cord. Connect your USB cable to your phone and computer to see whether it can transfer data. If it can, it’s OK; if it can’t, you’ll need to acquire a new data cable.
Case 3: ESP32 is damage
If you have the correct USB drivers loaded and your data cord is in good working order.Then there’s a chance it’s a problem with ESP32. Check to see if your ESP32 has been overheated or if you can detect a burning odour in the area. If you answered yes, you should obtain a new one.
6. Arduino IDE Serial Monitor is not working.
If the ESP32 is only printing weird text or gibberish messages in your Arduino IDE Serial Monitor, make sure you have the right COM port selected and set the right baud rate
7.Error: “Brownout detector was triggered
When you open your Arduino IDE Serial monitor, you’ll notice that the error message “Brownout detector was activated” appears repeatedly. It suggests there’s a problem with the hardware.
It’s frequently linked to one of the following problems:
- USB cable of poor quality; USB cable is very long;
- A board with a flaw (poor solder joints);
- a defective computer USB port;
- or a computer USB port that does not give enough power.
Fix: try a different shorter USB cable (with data wires), try a different computer USB port or use a USB hub with an external power supply.
8.I can’t make the ESP32 add-on work with Arduino IDE
If the ESP32 add-on still doesn’t function with the Arduino IDE after trying all of the troubleshooting steps, we propose programming the ESP32 with Atom text editor and PlatformIO IDE.
We have discussed various common errors while working with ESP32 and ways to fix those errors.