LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with connecting to rs232, com, ports. (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-connecting-to-rs232-com-ports-627333/)

sjpiv44 03-11-2008 03:55 PM

Problem with connecting to rs232, com, ports.
 
I have a suse 10.3 box and I am trying to connect to an old SCO box to transfer some data files.

I need to use a RS232 ports. I can pull up uucp on both, just seeing the serial ports is the problem.

Can anybody help?

Thanks,
Jack

harry edwards 03-11-2008 05:19 PM

The serial ports on Linux are found in the device folder (/dev/). They are normally called /dev/ttySX, were X is the serial port number: for example, /dev/ttyS0 is COM1. Udev is the layer within modern Linux systems that configures the default permissions and device mapping for the serial ports. Of course serial ports first need to be configured correctly before you can transmit and receive data. The Baud rate, Flow Control and Start, Stop and Data bits will need to match on both servers.

In Linux and Unix (SCO) serial settings are set using the stty command (MAN page http://unixhelp.ed.ac.uk/CGI/man-cgi?stty) i.e.

Code:

stty sane 9600 raw  -echo crtscts </dev/ttyS0

Your current serial setting can be seen by running the following:

Code:

stty -a </dev/ttyS0
Linux also comes with a command to view the status of the serial ports. This is called statserial. See http://linux.about.com/library/cmd/b...statserial.htm for more info.

Finally, you must have a null modem serial cable between the two hosts.

sjpiv44 03-12-2008 05:01 PM

Problem with serial ports much better
 
Thanks Harry, Now do I need to set ispeed and ospeed? And a recomendation of the best way to tranfer some data from our SCO box to our SUSE linux box?
Thanks Jack Privitt

Quote:

Originally Posted by harry edwards (Post 3085571)
The serial ports on Linux are found in the device folder (/dev/). They are normally called /dev/ttySX, were X is the serial port number: for example, /dev/ttyS0 is COM1. Udev is the layer within modern Linux systems that configures the default permissions and device mapping for the serial ports. Of course serial ports first need to be configured correctly before you can transmit and receive data. The Baud rate, Flow Control and Start, Stop and Data bits will need to match on both servers.

In Linux and Unix (SCO) serial settings are set using the stty command (MAN page http://unixhelp.ed.ac.uk/CGI/man-cgi?stty) i.e.

Code:

stty sane 9600 raw  -echo crtscts </dev/ttyS0

Your current serial setting can be seen by running the following:

Code:

stty -a </dev/ttyS0
Linux also comes with a command to view the status of the serial ports. This is called statserial. See http://linux.about.com/library/cmd/b...statserial.htm for more info.

Finally, you must have a null modem serial cable between the two hosts.


sjpiv44 03-12-2008 05:03 PM

Problem with serial ports much better
 
Thanks Harry, Now do I need to set ispeed and ospeed? And a recomendation of the best way to tranfer some data from our SCO box to our SUSE linux box?
Thanks Jack Privitt

Quote:

Originally Posted by harry edwards (Post 3085571)
The serial ports on Linux are found in the device folder (/dev/). They are normally called /dev/ttySX, were X is the serial port number: for example, /dev/ttyS0 is COM1. Udev is the layer within modern Linux systems that configures the default permissions and device mapping for the serial ports. Of course serial ports first need to be configured correctly before you can transmit and receive data. The Baud rate, Flow Control and Start, Stop and Data bits will need to match on both servers.

In Linux and Unix (SCO) serial settings are set using the stty command (MAN page http://unixhelp.ed.ac.uk/CGI/man-cgi?stty) i.e.

Code:

stty sane 9600 raw  -echo crtscts </dev/ttyS0

Your current serial setting can be seen by running the following:

Code:

stty -a </dev/ttyS0
Linux also comes with a command to view the status of the serial ports. This is called statserial. See http://linux.about.com/library/cmd/b...statserial.htm for more info.

Finally, you must have a null modem serial cable between the two hosts.


sjpiv44 03-13-2008 07:09 PM

how can I see that I have connectivity with my SCO and Linux? And
 
Quote:

Originally Posted by sjpiv44 (Post 3086655)
Thanks Harry, Now do I need to set ispeed and ospeed? And a recomendation of the best way to tranfer some data from our SCO box to our SUSE linux box?
Thanks Jack Privitt


I can stty both computers, the SCO computes is ttyb02 and the linux is ttyS0. Baud rates 38400. M parity. Now I need to establish a connection between both. Any suggestions?

Again, thanks Jack

AnanthaP 03-13-2008 08:08 PM

Maybe rmount after creating a mount point.If that is slow, then rcp.

harry edwards 03-14-2008 06:37 PM

The simplest way to confirm the connection is working is to send some data down the line. On the box to receive the data run the following:

Code:


cat < /dev/ttyS0

Substitute '/dev/ttyS0' for the correct port. On the box to transmit:

Code:


echo "This is a test" > /dev/ttyS0

Again, substitute '/dev/ttyS0' for the correct port.

On executing the command you should see text "This is a test" on the machine receiving.

sjpiv44 03-15-2008 12:33 PM

I think I have set up ports right.
 
Thanks again Harry.

In a previous reply, you suggested 'stty sane 38400 raw -echo crtscts </dev/ttyS0' . The port on the SCO box is already set up for baud 38400, but I am not sure how to check data bit, stop bit and parity. I have set the ttyS0 using the above command. and stty -a </dev/ttyS0 shows baud 38400.

Checking a third computer, that is using Anzio to access the SCO box, is setup to access SCO box at 38400,7,M.

I am at my office and I will go to site this afternoon and test your suggestion.

My goal is to transfer the Key files from SCO filePro to SUSE filepro.

harry edwards 03-15-2008 04:09 PM

The previous post I made was only an example (sorry), normally when using a serial port you will have the baud rate, data bits and stop bits as a prerequisite, in your case you need to choose the attributes and assigned them so they match on both sides.

To set the data bit, stop bit and parity you can add the following to your stty command:

Code:


stty 38400 parenb cs8 -cstopb -parodd crtscts  < /dev/ttyS0

Note: The syntax of the command may differ between SCO and Linux.

This does the following:

38400 - Set the Baud rate speed.
parenb - Enable the parity generation and detection.
cs8 - Select character size to 8.
-cstopb - Use one stop bits per character.
-parodd - Select odd even parity
crtscts - Enable output hardware flow control.

sjpiv44 03-17-2008 02:51 PM

What is the minimum parameters for SCO/Linux to talk?
 
Larry,
I used your code on the linux box and when I tried on the SCO box, it did not have crtscts option. I used the ixon, which the linux box also shows for flow control.

When I cat (a file) /dev/ttyb02 on the SCO to Linux. Data was displaying on the screen, but nothing on the Linux box.

Thanks,
Jack

;

PHP Code:

[PHP

[/PHP]
Quote:

Originally Posted by harry edwards (Post 3089787)
The previous post I made was only an example (sorry), normally when using a serial port you will have the baud rate, data bits and stop bits as a prerequisite, in your case you need to choose the attributes and assigned them so they match on both sides.

To set the data bit, stop bit and parity you can add the following to your stty command:

Code:


stty 38400 parenb cs8 -cstopb -parodd crtscts  < /dev/ttyS0

Note: The syntax of the command may differ between SCO and Linux.

This does the following:

38400 - Set the Baud rate speed.
parenb - Enable the parity generation and detection.
cs8 - Select character size to 8.
-cstopb - Use one stop bits per character.
-parodd - Select odd even parity
crtscts - Enable output hardware flow control.


harry edwards 03-17-2008 05:16 PM

The port set-up on both sides must match, so if you opt for hardware control cts/rts then both sides need this setting. The opposite is software control xon/xoff. I've not had much experience with software control; hence, I would used hardware control. SCO should has an equivalent setting. The other thing to check is the RS232 cable: is it wired correctly?

sjpiv44 03-21-2008 04:19 PM

Harry,
I have not been able to connect yet. I am seeing some of the differences between SCO and Linux, SUSE.

I have Linux set, parity generator on, parenb, even parity, -parodd, cs8, 8 bit word, hupcl, hangup when last process closes the tty, cread, allow input to be read, crtscts, enable RTS/CTS handshaking. I still have clocal and all of the default output settings that I originally did when I did the 'stty sane.

The SCO box is setup with -parenb, which I can not seem to enable. When I try, the flow control get disabled. Flow control enabled is ortsfl ctsflow rtsflow. When I enable flow control, I get loblk enabled. ?????...

I also have just preformed the connection confirmation procedure. 1st, I set up the receive, cat < /dev/ttySO, and then went across the shop and to do an echo "this is a test" > /dev/ttyb02 and nothing.

I hope you understand this email. Thanks again for you help.

Jack Privitt

sjpiv44 03-21-2008 04:22 PM

See last reply, I hope that I am doing reply correctly.
 
Harry, please see my last reply. I am trying to do reply as requested. Jack

harry edwards 03-22-2008 05:59 AM

I've just checked the SCO manual. It appears that flow control is not support for your specified port. The article I read states there is a difference between ttyb02 and ttyB02 . The capital letter device supports hardware flow control (RTS/CTS). Do you have the ttyB02 device?

Also, have you tried to use 'Serial Manager' supplied with SCO. This explains the 'Serial Manager', http://docsrv.sco.com:507/en/HANDBOO...ger_level.html

It might help to post the version of SCO are you on.

sjpiv44 03-23-2008 10:06 PM

Harry,
I will check ttyB02 & see about serial manager tomorrow when I get to site. I hope you know that this is an old SCO 3.x. (1988-1989). I have saved it on two occasions, but it has its noises and problems and is still holding up, I don't know how long it is going to hold up.

Also, we have been using the serial port that I am trying to use on another PC that has Anzio as a port emulator. We did connect to the other WinXP system and access the filePro program. I was hoping that this serial access woulb be easier that it has been.

Also, I am going to try to use Microscope Diagnostics and check to see if the serial port on the Linux system is good. That is one of the verables that I have not checked. Linex see it and configueres it, but I don't know that just because Linux sees the port, that it is ok.

Again I really appreciate you help on this. I am really having to call up some of my old Hardware experance.

Hope you had a nice Easter.

Jack Privitt


All times are GMT -5. The time now is 03:26 AM.