DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C# (http://www.daniweb.com/forums/forum61.html)
-   -   C# COM ports in Linux (http://www.daniweb.com/forums/thread151804.html)

Duki Oct 17th, 2008 3:26 pm
C# COM ports in Linux
 
Hey everyone,

we're still working trying to get Linux to communicate to our robot via an RS232 port. We added this code to the project in Mono:

Using System.Ports.IO
SerialPort ports = new SerialPort("ttyS0",19200,Parity.None, 8, StopBits.One);

We can't get anything sent out of our COM ports. We're not even sure if we're coding it correctly. Is ttyS0 (we've tried S0-Sf) what we should be putting in the code? Please help!!

thanks!

LizR Oct 17th, 2008 4:41 pm
Re: C# COM ports in Linux
 
Start at the beginning

Does your kernel have serial built in?
If so, what serial ports does it find? and tell you are available?

Duki Oct 20th, 2008 8:00 pm
Re: C# COM ports in Linux
 
I'm not sure. We tried some command, can't remember what it was, and it showed ttyS0-3

LizR Oct 20th, 2008 8:09 pm
Re: C# COM ports in Linux
 
Well, having the kernel support would be somewhat essential to your program, so it would make sense that you learn how to tell.

If you are sure you have ttyS0, thats a terminal running through a serial port, not the serial port itself.

Duki Oct 20th, 2008 8:16 pm
Re: C# COM ports in Linux
 
Hmm, ok. What commands can I enter to see my com ports?


All times are GMT -4. The time now is 1:55 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC