I just bought a nano and have successfully uploaded some test code to it with no issues. I then uploaded the code below with no issue. Now, when I try to make modifications or upload different code, I get the error message listed. I have searched this forum and tried various things suggested, such as restarting and changing the port from COM4 to COM5, all with no luck. I have also uninstalled and reinstalled the IDE. If I unplug the board and plug it in again, it will run the code that is on the board, but nothing more. At this point, the board has become useless to me.
Computer: Windows 11 Home - version 24H2 (last update installed KB5053598 on 3/12/25)
Arduino IDE Version: 2.3.4
Arduino Nano - Serial Number: 900000100016862
Additional Information: DFROBOT DFPlayer hooked up via breadboard
Error:
Sketch uses 4550 bytes (14%) of program storage space. Maximum is 30720 bytes.
Global variables use 391 bytes (19%) of dynamic memory, leaving 1657 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\.\COM4": Access is denied.
Failed uploading: uploading error: exit status 1
Code Currently on Board:
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
// Use pins 2 and 3 to communicate with DFPlayer Mini
static const uint8_t PIN_MP3_TX = 11; // Connects to module's RX
static const uint8_t PIN_MP3_RX = 10; // Connects to module's TX
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);
const int wirePin = 4;
const int endPin = 5;
// Create the Player object
DFRobotDFPlayerMini player;
void setup() {
pinMode(wirePin, INPUT);
pinMode(endPin, INPUT);
// Init USB serial port for debugging
Serial.begin(9600);
// Init serial port for DFPlayer Mini
softwareSerial.begin(9600);
// Start communication with DFPlayer Mini
if (player.begin(softwareSerial)) {
Serial.println("OK");
// Set volume to maximum (0 to 30).
player.volume(30);
// Play the first MP3 file on the SD card
player.play(001);
} else {
Serial.println("Connecting to DFPlayer Mini failed!");
}
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
}
void loop() {
}
The odds are you have the serial monitor or serial plotter already open on that port. Or possibly another terminal program.
How do I turn those off or find out if they are open? All I have running on my computer is the IDE and videos running in google chrome.
I don't use the IDE, so you'll have to do some research to discover how to do that.
What do you use? This is my first foray into Arduino, so I'm just using what was suggested.
Which process do i shut off?
Process Explorer is a Windows Tool which you will need to download and install. It will help you find what is using a Serial Port.
https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer
Some instructions on it's use is here
https://forum.arduino.cc/t/arduino-nano-unable-to-establish-connection-with-laptop/1322559/10
The top one, Arduino IDE(17). Then start only one copyh of the IDE.
This is a user windows error, nothing to do with Arduino other than an Arduino board wants to use a resource but windows will not let it.

That's impossible; the IDE runs multiple processes and that is what one sees in task manager.
Serial monitor; click the little cross to close it

Serial plotter
That will be opened in a new window so is basically in your face.
Note:
The access denied problem can have several causes. A known one is if your Nano has the FTDI serial-to-usb converter and serial monitor / serial plotter is open in the IDE.
My bad, I forgot Win works differently from *nix. I use Mac, which is based on BSD Unix. Also, the terms process and task get misused a lot. I know it is possible to have two instances of the IDE open, as I recall a project that required that. IIRC, the project used one sketch but opened in two 'processes,' so one was the TX and the other the RX. The 'trick' was to do an 'open IDE' IIRC, but that may have been a Mac 'trick'. I recall a discussion about the 'right' way in order to get two processes rather than the usual two or more sketches open at once. Two copies of the Serial Monitor were needed. I am not positive, but it may have been 1.x, not 2.x, which handles the Seial Monitor differently. My apologies for causing any confusion.
First. have I properly understood? The sketch you posted is running correctly, yes? It plays the first track on your mSD card? (No more, because you are doing nothing with pins 4, 5, 7, 8 and 9.)
So you're saying that suddenly you cannot now upload a sketch again? Not even that original?
Please show a clear photo of your wiring. And also spell out exactly the steps you are using to upload a sketch again.
BTW, I recomend you drop the volume from its present max of 30. The higher current consumption risks power supply issues.
Also I see you're still showing this line, despite changing RX/TX to 10/11:
// Use pins 2 and 3 to communicate with DFPlayer Mini
Yes, the sketch is running correctly; it plays the track on the SD card.
Correct, I cannot upload any other sketch to the board. When I try, I get the error message.
I copied the code from the forum, I simply changed the pins; I did not change the notes. I was testing to see if I could make it work, before I tried another sketch, which will not upload.
Pictures attached:
Thank you very much, that worked and now I do not get the error. It's always the simple things.