I'm trying to upload a sketch to a pro mini using a FTDI breakout board but I get the error:
avrdude: ser_open(): can't open device "\.\COM9": Access is denied.
What is odd is that if I open the serial monitor through the Arduino IDE it sees what the mini is sending out via serial.print. Additionally, right after I restart my computer and start the IDE it has an error at the bottom that reads "CLE DAEMON Offline". During that moment I can upload new code to the mini.
I followed this guide from arduino on how to find the process that is blocking the port that the FTDI breakout/Mini is on and I get the Service Value of "FTSER2K", but when I search for that with Process Explorer I get no results.
I have checked that there are no other programs using the ports and there are not, as far as I can tell.
Hi @Smolders. Which version of Arduino IDE are you using (e.g., "2.0.1")? The version is shown on the window title bar and also in the Help > About dialog.
I ask for this information because I want to give you the appropriate instructions for the IDE version you are using.
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 to a board using an FTDI chip while Serial Monitor or Serial Plotter is open.
A port can only be used by one process at a time, so Arduino IDE must automatically close 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 when the FTDI USB chip is used.
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
Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:
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:
Close the "Serial Plotter" window.
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
Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:
That was it! Thank you so much! I searched and screwed around with this for at least an hour without getting anywhere and here you figured it out in less than fifthteen!