Notifications
Clear all

ESP8266 Port Compile Error

6 Posts
3 Users
0 Likes
211 Views
ronpenrose
(@ronpenrose)
Active Member
Joined: 4 months ago
Posts: 5
Topic starter  

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).

image

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.

 

 


   
Quote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 4801
 

Posted by: @ronpenrose

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).

-- attachment is not available --

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.

 

 

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.

0

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.

 

 

 

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
MrRemedy
(@mrremedy)
Eminent Member
Joined: 2 years ago
Posts: 19
 

@zander

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


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 4801
 

@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.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
MrRemedy
(@mrremedy)
Eminent Member
Joined: 2 years ago
Posts: 19
 

@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


   
ReplyQuote
ronpenrose
(@ronpenrose)
Active Member
Joined: 4 months ago
Posts: 5
Topic starter  

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.


   
ReplyQuote