Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Linux Magazine - Missing Anything?

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 77 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here



Current HOWTO: Modem-HOWTO

Modem-HOWTO: Configuring the Serial Driver (high-level) "stty" Next Previous Contents

7. Configuring the Serial Driver (high-level) "stty"

7.1 Introduction

This configuring is normally done by your communications program such as wvdial. It may do much of it without even letting you know what it's done. In olden days it was done with the "stty" utility. If you set something manually with stty, the communications program may change the setting to something else so it's usually best to just let the communications program handle it. See What is stty ?

7.2 Hardware flow control (RTS/CTS)

See Flow Control for an explanation of it. You should always use hardware flow control if possible. Your communication program or "getty" should have an option for setting it (and hopefully it's enabled by default). It needs to be set both inside your modem (by an init string or default) and in the device driver. Your communication program should set both of these (if you configure it right).

If none of the above will fully enable hardware flow control. Then you must do it yourself. For the modem, make sure that it's either done by the init string or is on by default. If you need to tell the device driver to do it is best done on startup by putting it in a file that runs at boot-time. See the subsection Boot-time Configuration You need to add the following to such a file for each serial port (example is ttyS2) you want to enable hardware flow control on:

stty -F /dev/ttyS2 crtscts
stty crtscts < /dev/ttyS2

If you want to see if flow control is enabled do the following: In minicom (or the like) type AT&V (or ATI4 on 3Com modems) to see how the modem is configured and look for &K3 (or &H1 on 3Com modems) which means hardware flow control. Then without exiting the communications program (such as minicom) see if the device driver knows about it by typing: stty -F /dev/ttyS2 -a. Look for "crtscts" (without a disabling minus sign). Remember that communication programs change these settings so you may want to check them after you have started up your communication program.

7.3 Speed Settings

Besides flow control there is speed. See What Speed Should I Use with My Modem. There's also are parity and bits-per-byte settings. Normally the port is set by the communications program at 8N1 (8-bits per byte, No parity, and 1 stop bit). If you're running PPP then you must use 8N1. So if you get a complaint that it's not 8-bit clean then it's likely not 8N1 like it should be.

7.4 Ignore CD Setting: clocal

Normally a CD (Carrier Detect) signal (on the CD wire for an external modem) is required before a serial port can be opened. But if stty has negated clocal (-clocal), then the port requires CD raised for the port to open and remain open. Actually, a skilled programmer can write the program in such a way as to force the port to open even when CD and clocal say not to. So if stty shows -clocal then there might be a problem with opening the port. But for dial-in, in some cases you may want -clocal so that when the remote modem stops sending a carrier and CD drops, the port will close and terminate all processes running on it.

One way to keep CD raised is to send "AT&C" to the modem so that CD from the modem will always be on. CD always-on is fine for dial-out but for dial-in, the CD signal is sometimes (but rarely) used to detected an incoming call.

clocal may be asserted by default in recent serial drivers. Minicom raises clocal automatically when it starts up so there is no problem with it opening the port. But it restores the clocal setting to it's original when you exit minicom. But version 6.0.192 of Kermit hung when I set -clocal and tried to "set line ...".

7.5 What is stty ?

stty is something like setserial but it sets the speed (baud rate), hardware flow control, and other parameters of a serial port. Typing "stty -F /dev/ttyS2 -a" should show you how ttyS2 is configured. Most of the stty settings are for things that you never need to use with modems. Many of the setting are only needed for Text-Terminals (and some are only needed for antique terminals of the 1970s). Your communication package should automatically set up the several settings needed for modems. For this reason you normally don't need to use stty so it's not covered much in this Modem-HOWTO. But stty is sometimes useful for trouble-shooting. More is said about stty in the Serial-HOWTO or Text-Terminal-HOWTO..

Next Previous Contents

The Linux Tutorial completely respects the rights of authors and artists to decide for themselves if and how their works can be used, independent of any existing licenses. This means if you are the author of any document presented on this site and do no wish it to be displayed as it is on this site or do not wish it to be displayed at all, please contact us and we will do our very best to accommodate you. If we are unable to accommodate you, we will, at your request, remove your document as quickly as possible.

If you are the author of any document presented on this site and would like a share of the advertising revenue, please contact us using the standard Feedback Form.




Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 10.9 Seconds