Page 1 of 1

Finding com ports programmatically in SharpCap?

Posted: Wed Jan 24, 2024 4:54 am
by tmnathe
In working through Python programming ShartpCap with my Atlas Pro AZ/EQ mount (which requires using EQMOD to work), I'm finding that the com port sometimes comes up with a different location. As far as I can tell, SharpCap cannot read out what ports are available. There is a plugin called pyserial that will allow for that level of functionality but requires PIP to make it work, which SharpCap's version of IronPython doesn't have.

So is there a way to make this work and how do I go about doing that?

The two programs-
https://pyserial.readthedocs.io/en/latest/pyserial.html
https://pip.pypa.io/en/stable/getting-started/

Re: Finding com ports programmatically in SharpCap?

Posted: Wed Jan 24, 2024 2:09 pm
by admin
Hi,

the easiest thing when you encounter this sort of problem is to remember that IronPython is based on the Microsoft .NET framework, so C# code using the .NET framework can usually be translated fairly easily to IronPython. In this case.

Code: Select all

clr.AddReference("System.IO.Ports")
from System.IO.Ports import SerialPort
print (SerialPort.GetPortNames())
COM4 COM5 COM3
Hope this helps,

Robin

Re: Finding com ports programmatically in SharpCap?

Posted: Wed Jan 24, 2024 8:51 pm
by tmnathe
Ah-ha!
I'm not a programmer, so stuff like .NET or C# is way beyond me.
As it is, I'm barely understanding Python.

Thanks, Robin.