Networking Forums

Networking Forums > Computer Networking > Linux Networking > Serial port configuration

Reply
Thread Tools Display Modes

Serial port configuration

 
 
Jerónimo Lopes
Guest
Posts: n/a

 
      01-18-2007, 11:31 AM
I have a problem connecting an old serial device (a weighing machine) in
RedHat Enterprise Linux 4 ES.



I tested telnet from another computer with the same cable and the
communication is correct when I use de default settings.



It seems I can't use the correct options and commands to configure the
serial port. I tried to use a line on inittab with "m:2345ff:/sbin/agetty
9600 ixon .. ttyS1";

I tried to put the stty line on rc.local.



I think setserial command does not allow all the parameters I need.

I think there is another issue about controlling the flow between the
devices and maybe another one with UART capability of devices.



On SCO Openserver I used to turn around the problem editing the S80lp file
and introduce the following line:

(stty 9600 ixon ixoff -ixany parenb cs7 ; while :; do sleep 3600 ; done)
</dev/tty2a &





Can please someone help me in this case?


 
Reply With Quote
 
 
 
 
David M
Guest
Posts: n/a

 
      01-19-2007, 04:06 AM
On Thu, 18 Jan 2007 12:31:44 +0000, Jerónimo Lopes rearranged some
electrons to form:

> I have a problem connecting an old serial device (a weighing machine) in
> RedHat Enterprise Linux 4 ES.
>
>
>
> I tested telnet from another computer with the same cable and the
> communication is correct when I use de default settings.
>
>
>
> It seems I can't use the correct options and commands to configure the
> serial port. I tried to use a line on inittab with "m:2345ff:/sbin/agetty
> 9600 ixon .. ttyS1";
>
> I tried to put the stty line on rc.local.
>
>
>
> I think setserial command does not allow all the parameters I need.
>
> I think there is another issue about controlling the flow between the
> devices and maybe another one with UART capability of devices.
>
>
>
> On SCO Openserver I used to turn around the problem editing the S80lp file
> and introduce the following line:
>
> (stty 9600 ixon ixoff -ixany parenb cs7 ; while :; do sleep 3600 ; done)
> </dev/tty2a &
>
>
>
>
>
> Can please someone help me in this case?


Try:

http://tldp.org/HOWTO/Serial-HOWTO.html
http://tldp.org/HOWTO/Serial-Program...WTO/index.html


--
David M (dmacchiarolo)
http://home.triad.rr.com/redsled
T/S 53
sled351 Linux 2.4.18-14 has been up 7 days 18:58

 
Reply With Quote
 
Juha Laiho
Guest
Posts: n/a

 
      01-21-2007, 05:52 PM
"Jerónimo Lopes" <(E-Mail Removed)> said:
>I have a problem connecting an old serial device (a weighing machine) in
>RedHat Enterprise Linux 4 ES.

....
>It seems I can't use the correct options and commands to configure the
>serial port. I tried to use a line on inittab with "m:2345ff:/sbin/agetty
>9600 ixon .. ttyS1";


Issues with the above:
- it's "off" - so whatever values you have on that line have no effect
- even if it was not "off", you wouldn't want to have a getty talking
to a special piece of hardware (unless that thing somehow knows how
to log in to a system)

>I tried to put the stty line on rc.local.

....
>On SCO Openserver I used to turn around the problem editing the S80lp file
>and introduce the following line:
>
>(stty 9600 ixon ixoff -ixany parenb cs7 ; while :; do sleep 3600 ; done)

</dev/tty2a &

The above looks pretty much like something that would work on Linux
as well. Below is a description on what it does, to help in understanding
the key points (apologies if this is already all clear to you):
The "( ... ) < /dev/tty2a &" format starts a process to read something
from /dev/tty2a (and puts in into background, so that it doesn't
interrupt the startup process). This is significant, because serial devices
revert to system-specific default settings when they are closed. Here
what is run inside the parentheses is an interesting (and a good) trick:
it'll first set the interface parameters with stty - and then start
an endless loop that just sleeps. So, the parameters get set at
startup, and the device line stays open.

The "stty" parameters seem to be ok: 9600 bps, 7-bit characters and
a single parity bit. What is odd is that "polarity" of parity (even or
odd) is not specificed - so you may need to add parodd (for odd parity)
or -parodd (for even parity) to match the settings of the weighing
device.

Then, one thing that could be is that the serial port driver expects to
see some hardware handshake signals. This you should be able to set with
stty parameters "-clocal -crtscts". You might also wish to disable the
port lockouts with setserial ^pgrp_lockout ^session_lockout. Also,
do not use the cua device, but the ttyS device.

Hope this was of any help.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
no serial port and no parrallel port how do i console to a router sloan949@gmail.com Linux Networking 4 02-13-2007 07:02 PM
Map serial port through TS Tippy Windows Networking 0 11-23-2005 12:06 AM
Linux-HA serial cable pin-out configuration details sipitai Linux Networking 2 11-01-2004 11:17 AM
Serial Port Multiplexing (2 apps to 1 port) Onslo Linux Networking 0 10-06-2004 08:53 AM
Simulating a serial port Gonzales Valero Daniel Linux Networking 6 11-07-2003 02:55 PM



1 2 3 4 5 6 7 8 9 10 11