LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2008, 03:55 PM   #1
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Rep: Reputation: 15
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

Last edited by sjpiv44; 03-11-2008 at 04:30 PM.
 
Old 03-11-2008, 05:19 PM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
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.

Last edited by harry edwards; 03-11-2008 at 05:20 PM.
 
Old 03-12-2008, 05:01 PM   #3
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Original Poster
Rep: Reputation: 15
Smile 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 View Post
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.
 
Old 03-12-2008, 05:03 PM   #4
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Original Poster
Rep: Reputation: 15
Smile 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 View Post
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.
 
Old 03-13-2008, 07:09 PM   #5
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Original Poster
Rep: Reputation: 15
Question how can I see that I have connectivity with my SCO and Linux? And

Quote:
Originally Posted by sjpiv44 View Post
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
 
Old 03-13-2008, 08:08 PM   #6
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
Maybe rmount after creating a mount point.If that is slow, then rcp.
 
Old 03-14-2008, 06:37 PM   #7
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
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.

Last edited by harry edwards; 03-14-2008 at 06:38 PM.
 
Old 03-15-2008, 12:33 PM   #8
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Original Poster
Rep: Reputation: 15
Thumbs up 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.
 
Old 03-15-2008, 04:09 PM   #9
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
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.
 
Old 03-17-2008, 02:51 PM   #10
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Original Poster
Rep: Reputation: 15
Question 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 View Post
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.
 
Old 03-17-2008, 05:16 PM   #11
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
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?
 
Old 03-21-2008, 04:19 PM   #12
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Original Poster
Rep: Reputation: 15
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
 
Old 03-21-2008, 04:22 PM   #13
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Original Poster
Rep: Reputation: 15
Question 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
 
Old 03-22-2008, 05:59 AM   #14
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
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.
 
Old 03-23-2008, 10:06 PM   #15
sjpiv44
Member
 
Registered: Jan 2008
Location: Little Rock
Distribution: SUSE 10.3
Posts: 38

Original Poster
Rep: Reputation: 15
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
 
  


Reply

Tags
file, linux, ports, sco, serial, setting, transfer



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RS232 programming (sigaction problem) lucky6969b Linux - Networking 2 04-05-2008 02:06 PM
USB-RS232 communication problem (I think) damip Linux - Hardware 1 10-31-2007 08:57 AM
USB>RS232 versus PCMCIA>RS232 jayhel Linux - Laptop and Netbook 2 08-04-2005 06:09 PM
i have a problem writting to my rs232 krisi Programming 14 12-22-2004 11:00 AM
Serial RS232 problem Onyx^ Linux - Hardware 6 09-09-2004 11:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration