If you’re having trouble compiling code for your ESP32 or ESP8266 boards using Arduino IDE due to an error downloading the boards’ URLs, you can follow this guide to help you fix the Arduino IDE installation on a Windows PC.
- Installing ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)
- Installing ESP8266 Board in Arduino IDE (Windows, Mac OS X, Linux)
If you see a similar error in your Arduino IDE or any error related to downloading URLs, cleaning your Arduino IDE installation folder usually solves this issue.
If your Arduino IDE doesn’t launch (you click the Arduino icon and nothing happens) this trick might also solve the issue.
Fixing Arduino IDE Installation
1. In your Windows PC, open the File Explorer, select View menu and enable “Hidden items“:
2. Go to your Windows device (for example C:), open Users and find the hidden AppData folder:
3. Select the AppData folder and open Local.
4. Open the Arduino15 folder, then I recommend deleting all files in this folder.
5. That’s it! Now, you just need to re-install the ESP32 and ESP8266 board add-ons.
Installing ESP32 and ESP8266 Board Add-on in Arduino IDE
Finally, you need to re-install the ESP board add-ons, you can either continue reading this guide or open one of the next links for more detailed instructions:
- Installing ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)
- Installing ESP8266 Board in Arduino IDE (Windows, Mac OS X, Linux)
1. In your Arduino IDE, go to File > Preferences.
2. Enter the following URLs into the “Additional Board Manager URLs” field as shown in the figure below.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
Then, click the “OK” button:
3. Open the Boards Manager. Go to Tools > Board > Boards Manager…
4. Search for ESP32 and press the install button for the “ESP32 by Espressif Systems“:
5. Search for ESP8266 and press install button for the “ESP8266 by ESP8266 Community“:
Testing the ESP32 and ESP8266 Board Add-on Installed in Arduino IDE
Plug the ESP32 or ESP8266 board to your computer. With your Arduino IDE open, follow these steps:
1. Select your Board in Tools > Board menu (in my case it’s the DOIT ESP32 DEVKIT V1)
2. Select the Port (if you don’t see the COM Port in your Arduino IDE, you need to install the CP210x USB to UART Bridge VCP Drivers):
3. Open the following example (or any other example) under File > Examples > WiFi (ESP32) > WiFiScan
4. A new sketch opens in your Arduino IDE:
5. Press the Upload button in the Arduino IDE. Wait a few seconds while the code compiles and uploads to your board.
6. If everything went as expected, you should see a “Done uploading.” message.
If you get the “Timed out waiting for packet header” error, follow this guide: [SOLVED] Failed to connect to ESP32: Timed out waiting for packet header.
7. Open the Arduino IDE Serial Monitor at a baud rate of 115200:
8. Press the ESP on-board Enable button and you should see the networks available near your ESP32:
Wrapping Up
We hope this guide fixed your Arduino IDE installation. Now, you’re ready to start building your IoT projects with the ESP32 and ESP8266 boards!
For more ESP32 troubleshooting tips, try our ESP32 Troubleshooting Guide.
You might also like reading:
Many thanks for this!
My compiles for ESP32 and 8266 are very very slow (10 mins sometimes).
I’ve stopped anti virus to try that.
It seems to take ages compile the same stuff every time, even if I make a 1 line change, surely the caching can take care of this.
I had a problem just starting my IDE and the solution was the same – delete the arduino15 file. So my problem was more general than just downloading board URLs
My issue was that every time I tried to start the IDE I got the message “Initialising Packages” that that’s as far as it got – it returned to the start up screen.
There were many suggestions on Internet including deleting file arduino15. Unfortunately I didn’t appreciate it was a hidden file so couldn’t find it (immediately) to delete.
Once I did find and delete arduino15 everything worked fine. As I was only using the UNO I will have to re-install any add ons.
Perfect!,
Strangely though, despite a good hour googling for answers, I decided to uninstall Arduino IDE while also removing the Arduino folder in AppData. Once I reinstalled IDE and added the apt. URL’s for esp32 and esp8266 everything is running again. Then out of curiosity, I googled again to see if others had the same problem and your link was top of the page…confirming my actions as correct!
Thanks for providing clarification with your highly informative website.
Regards,
Thank you, man! Its solved my issue)))
I was looking for a tutorial like this, but …
Is it possible to install the esp32 and esp8266 boards without internet connection but with a file that you can download and put in the right file tree ?
It is because at work the connection do not pass for security reason. At home with the same laptop, no problem to install.
Hi, I just bought a new esp32 board (wemos d1 mini esp32) and I am getting this error ever since it arrived. I have another which i bought last year and I dont have any issue with that one. I tried reinstalling the USB serial driver, arduino (several times), and pressing the button while uploading but nothing solved it. Hope anyone could help.
esptool.py v3.0-dev
Serial port COM7
Traceback (most recent call last):
File “esptool.py”, line 3682, in
File “esptool.py”, line 3675, in _main
File “esptool.py”, line 3329, in main
File “esptool.py”, line 263, in init
File “site-packages\serial__init__.py”, line 88, in serial_for_url
File “site-packages\serial\serialwin32.py”, line 62, in open
serial.serialutil.SerialException: could not open port ‘COM7’: WindowsError(5, ‘Access is denied.’)
Failed to execute script esptool
the selected serial port Failed to execute script esptool
does not exist or your board is not connected
Hi.
That probably means that you didn’t select the right COM port or it is being used by another program.
Regards,
Sara
fatal esptool.py error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, ‘A device attached to the system is not functioning.’, None, 31)
any body resolve my error
Hi
Make sure you have the Serial monitor closed and that you’ve selected the right port in Tools > Port.
Regards,
Sara