Can't upload sketches. *SOLVED*

Getting back into playing with Arduino, but now I can’t get any sketch to upload.

Tried a clone Nano, nothing.
Switched to a genuine Mega (and different cable), nothing.

Currently have the Mega plugged in. Its trying to Tx/Rx (lights blinking), but can’t open serial port.

When I had the nano plugged in (same USB on the computer), serial port worked, but could not upload.

Error when trying to upload blink:

Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

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


avrdude: ser_drain(): read error: The handle is invalid.


avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
the selected serial port avrdude: stk500v2_getsync(): timeout communicating with programmer
 does not exist or your board is not connected
avrdude: ser_open(): can't open device "\\.\COM15": Access is denied.

That is the relevant message. Do a google search on "avrdude: ser_open(): can't open device" without the quotes, and you'll see an abundance of things to check. I haven't used Windows for years, (since XP), so can't really help beyond this point. Good luck!

Couple of quick things to try are.

Use a USB 2.0 port and USB 2.0 cable to test as USB 3.0 can on occasions cause problems.
If you have access to another computer please try that.
Cables can go bad easily so if you have another known GOOD cable also try that.
Sometimes extra security can cause issues with comms so turn antivirus etc. off for a quick test.

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.

Posting tips.

  • Your OS and version can be valuable information, please include it along with extra security you are using.
  • Always list the version of the IDE you are using and the board version if applicable.
  • How to insert an image into your post. ( Thanks Robin2 )
  • Add your sketch where applicable but please use CODE TAGS ( </> )
  • Add a SCHEMATIC were needed even if it is hand drawn
  • Add working links to any specific hardware as needed (NOT links to similar items)
  • Remember that the people trying to help cannot see your problem so give as much information as you can

Restarted my PC, and my anti-virus wanted to run an update. Did that, now it works.

Sweet...
Glad you got it figured out.

Bob.