[2.11] "\\.\COM3": Access is denied

Today I upgraded to v2.11 ide. I had been working with a NODEMCU. I switched to a Pro Mini with a fake FTCI chip (I think). I've been using this programmer literally for years with no issues.
However now I get

avrdude: ser_open(): can't open device "\.\COM3": Access is denied.

I reset my USB (using a nirsoft utility) and the com port opened but same error.

I uninstalled v2.11 and installed v2.10. However I received the same results.

I did install:

Windows 11 Version 22H2 for x64-based Systems (KB5027303)
a few days ago and it might be the culprit.

In all cases windows Device Manager showed the com port and running properly.

Anyone else have an issue?

John

Hi @JohnRob.

There is a known bug in Arduino IDE 2.x that can cause uploads to fail with this "Access is denied" error if you try uploading via an FTDI 232R chip while Serial Monitor or Serial Plotter is open. A port can only be used by one process at a time, so Arduino IDE automatically closes the port in Serial Monitor and Serial Plotter during an upload, automatically opening it again after. For some reason, that juggling of the port control is not working for certain boards.

If that bug is the cause of the problem you are having, the workaround will be to manually close the port in Serial Monitor/Serial Plotter before doing an upload. Please give that a try and then let me know if you still have the error while uploading:

Serial Monitor

  1. Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:
    image
  2. Upload the sketch.
  3. Open Serial Monitor again if needed (by clicking the icon on the IDE toolbar or the Tools > Serial Monitor menu item) after the upload is finished.

Serial Plotter

If you have the "Serial Plotter" window open, the procedure is a bit different from closing the Serial Monitor connection:

  1. Close the "Serial Plotter" window.
  2. If the "Serial Monitor" view is not already open, select Tools > Serial Monitor from the Arduino IDE menus to open it.
    We must do an open/close cycle on Serial Monitor as a workaround for a bug in Serial Plotter
  3. Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:
    image
  4. Upload the sketch.
  5. Open Serial Monitor and/or Serial Plotter again if needed after the upload is finished.

Please let me know if you have any questions or problems while following those instructions.

3 Likes

Hi @ptillisch,

Thank you for you suggestion. The instructions were very clear. However I have another issue, which I think had to do with the driver.

My test procedure was to:

  • Reboot the computer
  • open the ide
  • connect the target processor (Pro Mini)
  • download

So there would be no reason for the monitor or plotter to be open.

Thanks
John

Update:

The issue was the FTDI board I was using had a counterfeit chip. I purchased a legit FTDI device but haven't bothered to make up a cable.

Somehow either the installation of 2.11 or a windows update changed the FTDI driver to a new one that would not work with my old FTDI board.

Interestingly enough even when I plugged in the genuine FTDI board I received the same error.... hmmmm

I uninstalled the IDE, Went in and deleted everything in the "C:\Users\john\AppData\Local" and roaming path.

Reinstalled the IDE. Now the Genuine FTDI board works. The counterfeit board goes in the trash.

Serial Plotter, no, but the Serial Monitor state is persistent, so if you had Serial Monitor open during the previous IDE session, it will also be open after you restart Arduino IDE.

The bug occurs both with genuine and counterfeit FTDI FT232R chips.

When you do that, you delete the files where the Serial Monitor state was recovered, so this would cause the IDE to have the default state of the Serial Monitor being closed the next time you open Arduino IDE.

I'm glad it is working now. I suspect you will still have the error if you try uploading with Serial Monitor or Serial Plotter open, but maybe I'm wrong about that.

1 Like

Thanks again.

So if I simply "close" the serial monitor (and plotter) the error should go away?

If that is it, I'll be disappointed in myself. But a bit happier :slight_smile:

If the upload errors you encountered were caused by the bug in Arduino IDE 2.x, then yes the instructions I provided in post #2 of closing Serial Monitor and Serial Plotter before doing an upload via an FTDI FT232R is all that is needed to work around the bug.

But there are other potential causes of an "Access is denied" error during an upload so it is always possible that there was some other factor. However, the fact that your problem was specific to an FTDI chip makes me fairly confident that it was indeed arduino/arduino-ide#1783

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.