Not entirely sure if I am posting n the correct forum, so I apologize in advance if I picked the incorrect one.
I am having problems uploading a sketch to the Arduino Uno from PlatformIO. I can upload from the Arduino IDE without error, 100% of the time.
What is happening with PlatformIO, is that the majority of the time, it gives me an access denied error accessing the com port the Arduino is connected to. Retrying over and over, and eventually it works.
Have tried different cables and USB ports, with no change in the way it works. I have rebooted the computer, as well as reset the Arduino, again with no change.
Resource manager doesn’t show anything using the com port.
When trying to upload the TX light on the Arduino flashes before I get the access denied message.
Here is a short video showing what it is doing.
Any help fixing this would be greatly appreciated, as I like PlatformIO, over the Arduino IDE, and don’t want to have to switch back
Hm, the error message for “Access denied” is rather generic, but mostly because another program (like the [Arduino] serial monitor) is using the COM port, or because some antivirus is blocking access to it.
Also if your Uno board is a clone with a CH340 chip on it, make sure to install the latest drivers.
There are some threads about it with generic solution hints, like
trying different USB cables and ports on the computer
reconnecting the device
changing the COM port number of the device in the device manager (here)
kill eventually running avrdude.exe zombie processes hogging the port (here)
temporarily disable additional antivirus software, if installed
If the problem occurrs again after a restart (or starting some other software), it will be a strong indication though that some program is hogging all available COM ports in the system (and just hasn’t yet caught wind of the COM port number change that you just did), so be wary of that.
You were on point. It has started giving me access denied on Com10 now as well, so back to the drawing board to try to figure out what is holding that port, without showing up in resource manager
So it doesn’t show anything using the port, and I confirmed that I was getting an access denied error both before and after I took these screenshots.
As for Anti Virus, I am running MalwareBytes paid version on the computer, and it looks like the Ransomware protection may be the culprit. First I turned off all protection, and found that I was able to upload multiple times without issue, then turning the protections back on, one at a time, it still uploaded each time without issue, until I turned on the Ransomware protection. Then it started failing again. Ultimately, I found that I could have everything except ransomware protection turned on and upload fine. It’s only when the Ransomware protection is active that I have the problem. So it looks like you have definitely pointed me in the proper place.
So, now I just need to pour through MalwareBytes and see if I can figure out how to make it leave the com ports alone, while still providing protection against ransomware, if that is even possible
I really appreciate all the help you have been on this issue for me. It is always great to find a community that is willing to help each other out.