Avrdude: ser_open(): can't open device "\\.\COM4": Access is denied

Hi,

Apologies as I know this question have been appearing everywhere but after googling and looking around I have really no feasible solution to it. I am completely new to arduino and I am starting to try to connect my TinyCircuit smartwatch to it and tried running the blink example but it kept popping up this error "avrdude: ser_open(): can't open device "\.\COM4": Access is denied.",

Here are the things that I had tried

  1. Using this link from Arduino support page "https://support.arduino.cc/hc/en-us/articles/4401874331410--Error-avrdude-when-uploading" to find and close whatever program that is using the port through the process finder but I found out that only avrdude is using the port and whenever I kill the process and reupload the script it still shows the error message.

  2. Changing my usb cables, did it 3 times still the same result

  3. restarting my laptop, changing the com port on device manager, still the same result.

  4. Checking if the serial monitor or any other process on the IDE is using the port but none.

I do really need some advice on this as I had been looking around and trying different methods for the past few hours.

https://arduino.stackexchange.com/questions/19207/access-denied-when-uploading

Thanks for the link! But I had actually tried the methods given in there as well such as changing the com ports, and ensuring that all other applications are closed and I only have the TinyCircuit connected to my laptop with no other additional devices. As for choosing the right com port, I only have 1 com port shown in the IDE.

Are you running an antivirus? If yes, try to temporarily disable it and see if it helps.

Windows event viewer might be able to shine some light on the actual cause. But as I have never had to deal with the "access denied" problem, I would not know where to look.

Which version of the IDE?

I had same type of problem, despite all the drivers being loaded etc, my UNO and Mega were not loading my sketches. Mine was a COM port issue, you might have same issue.
go to https://theitbros.com/how-to-delete-com-ports-in-use/, be brave and remove suspect COM ports (e.g. usually anything serial using 9600, n ,8, 1) from the registry. (step 6. " Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports"

As you plug each device back in it will be assigned a New com port and the IDE should (after a short interval) recognise the COM Port for the device device . "Tinys" are a bit peculier because some use a software serial port, sometimes you need to actually disconnect the device before uploading, you will then be prompted to connect the device after you select "upload"

I'm having the same problem. I plug the mega 1280 (I've tried 6 difference devices including duemilonove, 2560) into a USB port (tried multi ones and USB 3 or 2). The port appears without any problems. I select the port and select the processor. I can click on board info and it replies BN: Ardunio Mega or Mega 2560, VID:0x2341, PID: 0x0010.

I can compile a sketch and if I try to upload it I get an error: avrdude: ser_open(): can't open device "\.\COM17": Access is denied.
Failed uploading: uploading error: exit status 1

I have tried the fix of going into device manager and changing the com port number but this doesn't help.

The computer is running windows 11 but it is a 3rd computer that has barely been used since it was upgraded so I have no idea what updates it has.

I've tried running the actual executable as admin

I'm running a fresh install of IDE 2

It's not had the Arduino IDE installed before.

The boards all work on my Macbook pro and on the other Windows computer but I want to use this computer as it is in my lab where I plan to use it.

I've just installed IDE 1.8.19 and it works perfectly.......

Likewise, its a version 2 feature. Uploaded with 1.8.15 all is fine.
Spent ages trying to sort it.

Early version bugs I guess - Do like the IDE though

Best Regards

piccloc

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