Google Answers Logo
View Question
 
Q: Stty on Red Hat 9.0 ( No Answer,   0 Comments )
Question  
Subject: Stty on Red Hat 9.0
Category: Computers > Operating Systems
Asked by: johngl-ga
List Price: $15.00
Posted: 09 Feb 2005 13:19 PST
Expires: 11 Mar 2005 13:19 PST
Question ID: 471898
I have a Red Hat 9.0 box.  I'm trying to do a stty < /dev/ttyS0 or a
stty -a < /dev/ttyS0 and it just hangs.  When I do it on SCO it works
fine.  I'm trying to change and view some settings on that port and
don't know now other than that.  Any help would be appreciated.

Clarification of Question by johngl-ga on 09 Feb 2005 13:22 PST
FYI /dev/sttyS0 is a modem.  Thank you.

Request for Question Clarification by denco-ga on 09 Feb 2005 13:54 PST
Howdy johngl-ga,

Please try the following and see if it helps.

Use minicom and send the modem an "AT&C" command.  Here's a minicom man page.
http://www.die.net/doc/linux/man/man1/minicom.1.html

Once you do the above, quit from minicom (the Q command) without doing a reset
of the modem.

Then try using stty on the port.  If that helps, please post a note here, and
I will post this with details as an answer for you.

Thanks!  denco-ga - Google Answers Researcher

Clarification of Question by johngl-ga on 09 Feb 2005 14:39 PST
That seemed to help.  How can I change settings though.  I'm trying to
get that modem to match these settings I have on my old system.

bin> stty < /dev/tty1a
speed 9600 baud;   ispeed 0 baud;   ospeed 9600 baud;
-parity hupcl clocal
swtch = <undef>; susp = <undef>;
-inpck -istrip -ixon -opost
-isig -icanon -echo -echoe -echok

Thank you.

Request for Question Clarification by maniac-ga on 09 Feb 2005 18:40 PST
Hello Johngl,

A few possible problems to check:

[1] Are you root / do you have full access to the device /dev/ttyS0?

[2] Is there an application already using /dev/ttyS0 (e.g., getty)?
[check using something like lsof]

[3] If you bring the system up in single user mode (e.g., add "single"
as a boot parameter or do telinit 1 after boot up), do you still have
the same problem?

The answers to these questions may help isolate the cause of the
problem you are having.

I've been setting serial devices (to monitor another Linux system with
a serial console) for some time, but it will be tomorrow before I can
check the exact command line I have been using.

Just curious, but why don't you use
  stty -F /dev/ttyS0 (whatever parameters)
per the documentation. Yes - I know the default is that stty works on
stdin (which IS redirected with your command) but there may also be an
odd interaction between the shell you are using and stty.

  --Maniac

Clarification of Question by johngl-ga on 09 Feb 2005 20:59 PST
I've been trying stty -F /dev/ttyS0 (whatever parameters) but the
changes don't seem to stick.  I'm not sure what the problem is.  Thank
you.

Request for Question Clarification by maniac-ga on 10 Feb 2005 13:27 PST
Hello Johngl,

Hmm. Very odd behavior. I have looked at an older Red Hat system (7.3)
and see the following...
 (as the root user...)
# stty -F /dev/ttyS0 -a
speed 38400 baud; rows 0; columns 0; line = 0;
(plus all the rest of the parameters)
# stty -F /dev/ttyS0 38400 raw -echo -echoe -echok -echoctl -echoke
# stty -F /dev/ttyS0 -a
(shows the revised settings)

This appears to work for me even if have another window open with
# cat /dev/ttyS0 | tee 076.txt
(to capture the serial console data to a file and display it)
or not.

The main difference I may have in my application is the use of a raw
(not cooked) interface and that I suppress all echoing to the remote
system [otherwise the monitored system gets REALLY mad].

Now that I think of it, you may want to check the flow control
settings. For example a non POSIX setting crtscts enables / disables
RTS/CTS (request to send / clear to send) handshaking.

The other note I see in the man page (or info stty) is a note that states in brief:
  This option (-F) is necessary because opening a POSIX tty requires
use of the O_NONDELAY flag to prevent a POSIX tty from blocking until
the carrier detect line is hign if the clocal flag is not set.
[this may be why using -F doesn't hang up while </dev/ttyS0 does hang]

The clocal value is used to disable modem control signals [something
you may need to do to set up the modem link & then reset if you expect
remote dialins on the modem]. It could be that the serial cable I use
makes it look like a modem is online and active (where you have a real
modem instead).

Let me know if this information helps and you get the modem set up properly.

  --Maniac
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy