Jump to content
  • 0
Sign in to follow this  
Chalk-X

PowerShell and serial ports

Question

I have had no success communicating with serial ports using PowerShell under Ubuntu 18.  I can create the port object:

$port = new-object system.io.ports.serialport ttyACM0

And I can use "Echo $port" to view all the specifics of the com port.  But when I attempt to open the port:

$port.open()

I get a message that says "access denied".  I never encounter this error using PowerShell under Windows.  Any idea how to fix this?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
13 hours ago, Chalk-X said:

I have had no success communicating with serial ports using PowerShell under Ubuntu 18.  I can create the port object:

$port = new-object system.io.ports.serialport ttyACM0

And I can use "Echo $port" to view all the specifics of the com port.  But when I attempt to open the port:

$port.open()

I get a message that says "access denied".  I never encounter this error using PowerShell under Windows.  Any idea how to fix this?

Hi Calk-X,

Did you run PowerShell with sudo or as root user?

In order to get access to the serial ports, you must have super user privileges.

Share this post


Link to post
Share on other sites
  • 0

Hi...i have a query too. I'm trying to communicate with an old piece of equipment that is only accessible through an RS-232 port using async send/receive messages.
I realize the above is extremely simplified, just looking for a heads-up on if PowerShell is capable of doing something like this and if so a few tips on where to get started.

Share this post


Link to post
Share on other sites
  • 0
20 hours ago, BonniCase said:

Hi...i have a query too. I'm trying to communicate with an old piece of equipment that is only accessible through an RS-232 port using async send/receive messages.
I realize the above is extremely simplified, just looking for a heads-up on if PowerShell is capable of doing something like this and if so a few tips on where to get started.

You can try reading Writing and Reading info from Serial Ports from Microsoft DevBlog to get started on RS-232 serial communication using PowerShell.

 

I hope this helps.

Shovon

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...