Help!

Text between PCs via serial connection

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> System Development RSS
Next:  XORG AND AMD PATCH PROBLEM  
Author Message
arka.n.roy
External


Since: Aug 04, 2007
Posts: 3



PostPosted: Sat Aug 04, 2007 2:31 pm    Post subject: Text between PCs via serial connection
Archived from groups: comp>os>linux>development>system (more info?)

I am trying to do something VERY simple in concept.

All I want to do is connect two PCs by RS232 serial cable (cross
cable), start up the Linux (Unix) console and be able to type messages
to each other.

There are two scenarios:

1) Two Linux machines, in which case I would like to just use the
console.

2) A Linux machine connected to a Windows XP machine. In this case I
would like to use the console on the Linux machine and a terminal
program on Windoze, such as HyperTerminal or Tera Term.

I would just like to send messages back and forth, chat-like, such as
"How are you?" and "I am fine".

I know this sounds useless and antiquated, I just want to do it for
study.
Back to top
arka.n.roy
External


Since: Aug 04, 2007
Posts: 3



PostPosted: Sat Aug 04, 2007 2:34 pm    Post subject: Re: Text between PCs via serial connection [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sorry, so my question was does anyone know how to do this?

I have not been able to find information through my Googling.

In fact, I find that with HyperTerminal or Tera Term on Windows you
can't even really type. The main window just displays stuff that
arrives.
Back to top
Floyd L. Davidson
External


Since: Aug 24, 2006
Posts: 393



PostPosted: Sat Aug 04, 2007 2:34 pm    Post subject: Re: Text between PCs via serial connection [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"arka.n.roy" <arka.n.roy.RemoveThis@gmail.com> wrote:
>Sorry, so my question was does anyone know how to do this?
>
>I have not been able to find information through my Googling.
>
>In fact, I find that with HyperTerminal or Tera Term on Windows you
>can't even really type. The main window just displays stuff that
>arrives.

There are basically two "simple" ways to provide the
functionality you ask about. They are simple only if
you have a *lot* of experience...

The first method is exactly what you have in mind and
have described. First, there is a RS-232 connect
between serial ports on two computers. The RS-232
connection can be about as simple as it gets with just
three wires (TxData on each host is connected to RxData
on the other host, and the third wire is Signal Ground).

Then you need a "terminal program" running on each
computer. HyperTerminal is one such program for
Windows. On a Linux box you can run Seyon, Minicom, or
several others (including just redirecting input and
output of an Xterm, but that is not recommended.)

Normally a terminal program only displays what is
received, and not what is sent. That is because they
expect the distant end to "echo" back whatever is sent.
But the terminal program itself does not echo what it
receives back, of course, and in this case it's two
terminal programs talking to each other. So the trick
is to configure the terminal programs for what is called
"half duplex", which isn't quite what it actually does
do, but that is what the configuration option is called.
What it does is echo everything you send to your own
screen.

A second method is significantly more complicated than
the above simple RS-232 connection, but provides
significantly more flexibility. For example, it would
be entirely possible to have not just two, but many
computers connected this way, all talking to each other
at once. And the connections need not all be via serial
ports, as the exact same user interface is used for an
Internet connection too.

This method is to set up a Point-to-Point Protocol (PPP)
TCP/IP link via the serial port RS-232 connection. The
way to do this is to use the /pppd/ program on a Linux
box, and use the dialup networking configuration on a
Windows box. Neither is a simple project. The first
problem is that the RS-232 connection, and the cable
used, is necessarily a bit more complex. In addition to
the three wires described above, others are required to
deal with this method. A fully functional "Null Modem"
cable will be needed. They can be purchased for a
relatively small price.

Once the two computers have a PPP connection, any
program that uses TCP/IP can be used between them. For
your project you want a /talk/ program. Some of them
are also labeled /ntalk/, or /ytalk/, and I suppose
there are others.

--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd.RemoveThis@apaflo.com
Back to top
arka.n.roy
External


Since: Aug 04, 2007
Posts: 3



PostPosted: Sat Aug 04, 2007 5:15 pm    Post subject: Re: Text between PCs via serial connection [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks Floyd.


>
> There are basically two "simple" ways to provide the
> functionality you ask about. They are simple only if
> you have a *lot* of experience...
>

Alas, that is what it looks like Smile


> The first method is exactly what you have in mind and
> have described. First, there is a RS-232 connect
> between serial ports on two computers. The RS-232
> connection can be about as simple as it gets with just
> three wires (TxData on each host is connected to RxData
> on the other host, and the third wire is Signal Ground).
>

So far I am just using a cross-cable. I know the machine are
"talking". This is because I have MATLAB installed on the Linux box,
and it has a pretty high-level language for serial communication. On
the other (Windows) machine I have HyperTerminal running. If I send
"Hello World" from MATLAB on the Linux machine, it actually shows up
in Hyperterminal on the Windows machine.

I guess this means that in terms of physical connection things are
correct as they are, right?


> Then you need a "terminal program" running on each
> computer. HyperTerminal is one such program for
> Windows. On a Linux box you can run Seyon, Minicom, or
> several others (including just redirecting input and
> output of an Xterm, but that is not recommended.)
>

Can I just use the command-line console?


> Normally a terminal program only displays what is
> received, and not what is sent. That is because they
> expect the distant end to "echo" back whatever is sent.
> But the terminal program itself does not echo what it
> receives back, of course, and in this case it's two
> terminal programs talking to each other. So the trick
> is to configure the terminal programs for what is called
> "half duplex", which isn't quite what it actually does
> do, but that is what the configuration option is called.
> What it does is echo everything you send to your own
> screen.
>

So does this mean that if I type something with the focus on
Hyperterminal's main window, it is actually getting "typed", even
though I can't see it? And when I hit return it is actually getting
sent across the serial cable?

The problem was that I was not able to receive this text (e.g. "Hello
to you too") in MATLAB on the Linux machine. I might as well state my
objective at this juncture, I avoided doing so since it may lead the
discussion off-topic, but I want to find out if I am doing something
wrong in MATLAB, or if there is a problem with sending from the
Windows box and receiving on the Linux box. I thought terminals would
be an easy way to check this.



> A second method is significantly more complicated than
> the above simple RS-232 connection, but provides
> significantly more flexibility. For example, it would
> be entirely possible to have not just two, but many
> computers connected this way, all talking to each other
> at once. And the connections need not all be via serial
> ports, as the exact same user interface is used for an
> Internet connection too.
>
> This method is to set up a Point-to-Point Protocol (PPP)
> TCP/IP link via the serial port RS-232 connection. The
> way to do this is to use the /pppd/ program on a Linux
> box, and use the dialup networking configuration on a
> Windows box. Neither is a simple project. The first
> problem is that the RS-232 connection, and the cable
> used, is necessarily a bit more complex. In addition to
> the three wires described above, others are required to
> deal with this method. A fully functional "Null Modem"
> cable will be needed. They can be purchased for a
> relatively small price.
>
> Once the two computers have a PPP connection, any
> program that uses TCP/IP can be used between them. For
> your project you want a /talk/ program. Some of them
> are also labeled /ntalk/, or /ytalk/, and I suppose
> there are others.
>

This sounds interesting, but for now it goes way beyond my objective,
which is to just test the serial communication between the two
machines.

Thanks again, I was pleasantly surprised to get such a thought-out
answer in such a short time!

Arka
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> System Development All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum