From the error messages it seems that avrdude is trying to use COM1 to do the upload. Are you sure that you have got COM3 selected as the port in the IDE under Tools/Port ?
I have exactly the same problem. My Device Manager shows connected to COM4 when board is connected. IDE also shows COM4. Did you guys find any solution?
avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM4
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "\.\COM4": Access is denied.
avrdude: ser_drain(): read error: The handle is invalid.
Has anyone here found any solutions to their problems? My mega has just devolved the same problem as the people here. I am getting these error messages below:
avrdude: ser_open(): can't open device "\.\COM12": Access is denied.
avrdude: ser_drain(): read error: The handle is invalid.
Connect the arduino and find it in the ports list in device managed. Go into the advance setting and change the port number to the one the ID is attempting to talk to. Then the device will be on that port and see if it still occurs.
I was getting the same problem:The handle is invalid: it was trying to send to port
COM1 When the mega was on COM3, the tools menu clearly said COM3. So I clicked "get board info " and back came the information from the board.
Now that was very confusing in the least. So I tried to up load the sketch again, guess what it worked. Some how reading the board must have reset the pointer to the upload location. Problem solved. The board now works as expected.
I'm a first time newby Just joined today.
KEVIN_P
Same issue, i reboot PC and 3D printer , i changed baud rate to = Port com 3 , Did all as above and still :
Sketch uses 93,634 bytes (36%) of program storage space. Maximum is 253,952 bytes.
Global variables use 3,561 bytes (43%) of dynamic memory, leaving 4,631 bytes for local variables. Maximum is 8,192 bytes.
avrdude: ser_open(): can't open device "\.\COM3": Access is denied.
avrdude: ser_drain(): read error: The handle is invalid.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Hi i know this was long ago so you most probably have solved this issue already but i managed to do something that worked for me try it out if you've still got the issue.
I went to device manager, then right clicked on the Arduino Mega 2560(COM 3 - in my case) and selected properties.
Then went to port setting tab and changed the bits per second to 115200 (it was set as 9600) because in my program my baud rate was set as 115200.
I pressed okay and it asked if it can restart my computer, i did and then it seemed to work afterwards.