I am switching over from the Arduino IDE to PlatformIO and VS Code.
All has gone well, compiled Uno programs. When I get to uploading working code I get a com port error. Com5 is the port vs automatically detected (and is the port I'm using on the Arduino IDE).
This is the error:
serial.serialutil.SerialException: could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5)
*** [upload] Error 1
I am nit posting any code because it behaves the same when I simply create a default new project (main.ccp).
I have tried several board selections with same error.
Ron Penrose
I am switching over from the Arduino IDE to PlatformIO and VS Code.
All has gone well, compiled Uno programs. When I get to uploading working code I get a com port error. Com5 is the port vs automatically detected (and is the port I'm using on the Arduino IDE).
This is the error:
serial.serialutil.SerialException: could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5)
*** [upload] Error 1I am nit posting any code because it behaves the same when I simply create a default new project (main.ccp).
I have tried several board selections with same error.
I am pretty sure someone else reported the same error. Perhaps do a search of the forum. I can't recall if he resolved the situation.
Just reading the english, it appears to be a permissions error, are you using Win or *nix
Found these solutions
Thats error means your COM port is already in use and getting data, try to use ser.close() to close the connection
I had the same exact same error message. I fixed it by closing the serial monitor on the Arduino, since Python and Arduino cannot access the COM port at the same time.
This is the result of the serial port still being active by the last execution, or the active kernel if you are using a Jupyter notebook. If you can run the program once, and then get an error the second time, this is definitely the case.
Adding ser.close()
at the end of the program should fix this.
If you are stuck in a loop, you can send ser.close() in the terminal or restart the kernel.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
If it's Windows and it's not a port stuck open, try running the application as Administrator.
If it's *nix, try starting the application via sudo command.
-d
@mrremedy Oops, it's not my problem, you addressed the wrong party. Also, the arduino environment makes proper use of the 'owner access' permissions concept so you never need sudo or administration rights. I recently had another user in trouble and pointed out to him that with a regular windows user that can't even see the library files, he could successfully build an app since the ide was enabled for what is called owner access. Similar for UNIX. Thanks for the effort.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@zander Oops, my bad. I guess I got "Reply Button" happy and didn't check who I was replying to.
But yeah, I understand. I've not set up Platform IO yet on my Linux Distro (Yet). It's one of my adventures on my list to fool around with.
Thanks for the correction. And do forgive me @ronpenrose
-d
Issue resolved. Unknowingly I had an Uno in one USB and the 8266 in the other. Disconnected Uno and all good. Suppose there was a conflict in Windows. Thanks for help all.
Ron Penrose