• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

The selected serial port Failed to execute script esptool.

Q&A Forum › Category: ESP32 › The selected serial port Failed to execute script esptool.
0 Vote Up Vote Down
Carl Anderson asked 7 years ago

I am setting up a laptop with Win 10 Pro and an i7 CPU.  I set the laptop up as described in the tutorial.  When I  run the WiFiScan sketch I get the error “File “site-packages\serial\serialwin32.py”, line 62, in open
serial.serialutil.SerialException: could not open port ‘COM3’: 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”  I have tried my NodeMCU-32S and ESP32 DEVKIT V1 boards and get the same result with different cables and USB ports.  When I go the the device manager I only see “Intel(R) Active Management Technology – SOL (COM3).  In the past when I plugged in a ESP32 board a new COM port would appear when I had success running wifiscan.  I installed the CP210x Driver.  I also tried the CDM21228 Driver.  The wifiscan sketch is WiFIScan Arduino 1.8.7.
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

3 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 7 years ago

Hi Carl,

  1. How did you install the ESP32 add-on in your Arduino IDE? Through the boards manager?
  2. When you connect your ESP32 board to your computer, do you see a new COM port appearing? 
  3. Can you try to open the Arduino IDE as an administrator?
  4. What’s the exact serial driver that your ESP32 uses?

Thanks!

0 Vote Up Vote Down
Carl Anderson answered 7 years ago
  1. Yes, just like the tutorial.
  2. Yes, I see Com 4 now.  I found out of 7 USB cables only 2 caused com4 to appear. 

I now get the error I got before.  Copied from the IDE Messages. 
Arduino: 1.8.7 (Windows 10), Board: “NodeMCU-32S, 80MHz, 115200”
Sketch uses 599086 bytes (45%) of program storage space. Maximum is 1310720 bytes.
Global variables use 41484 bytes (12%) of dynamic memory, leaving 286196 bytes for local variables. Maximum is 327680 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
Holding the Boot button down when connecting does work but I would like a more permanent solution.
I see the same problem with 5 differnent ESP32 boards, 4 NodeMCU 32S and 1 ESP32 Devkitv1.
Carl

1 Vote Up Vote Down
Rui Santos Staff answered 7 years ago

Hello Carl,
Please take a look at this Unit: https://rntlab.com/esp32-troubleshooting-guide/
Section/heading number 4: “4. A fatal error occurred: “Failed to connect to ESP32: Timed out… Connecting…”” Holding down the BOOT button during upload will solve your problem. Regards,
Rui

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.