Previous Next Contents

5. How Do I Dial Out With My Modem?

5.1 Hardware Requirements

First, make sure you have the right cable. Your modem requires a straight through cable, with no pins crossed. Any computer store should have these. Make sure you get the correct gender. If you are using the DB25 serial port, it will always be the male DB25. Do not confuse it with the parallel port, which is the female DB25. Hook up your modem to one of your serial ports. Consult your modem manual on how to do this if you need help.

Notes On Internal Modems

For an internal modem, you will not need a cable. An internal modem does not need a serial port, it has one built in. All you need to do is configure it to use an interrupt that is not being used, and configure the port I/O address. Consult your modem manual if you get stuck. Also, see section Can I Use More Than Two Serial Devices? if you need help on choosing interrupts or addresses.

On some motherboards you will have to disable the serial port that the modem is replacing in order to avoid conflicts. This may be done with jumpers or in the BIOS settings, depending on your motherboard. Consult your motherboard manual.

Due to a bug in IBM8514 video boards, you may encounter problems if you want your internal modem to be on ttyS3. If Linux does not detect your internal modem on ttyS3, you can use setserial and the modem will work fine. Internal modems on ttyS{0-2} should not have any problems being detected. Linux does not do any autoconfiguration on ttyS3 due to this video board bug.

5.2 Talking To Your Modem

Use kermit or some other communications program to test the setup, before you go jumping into complex things SLIP or PPP. You can find the latest version of kermit at http://www.columbia.edu/kermit/. For example, say your modem was on ttyS3, and it's speed was 115200 bps. You would do the following:

linux# kermit
C-Kermit 6.0.192, 6 Sep 96, for Linux
 Copyright (C) 1985, 1996,
  Trustees of Columbia University in the City of New York.
Default file-transfer mode is BINARY
Type ? or HELP for help.
C-Kermit>set line /dev/ttyS3
C-Kermit>set carrier-watch off
C-Kermit>set speed 115200
/dev/ttyS3, 115200 bps
C-Kermit>c
Connecting to /dev/ttyS3, speed 115200.
The escape character is Ctrl-\ (ASCII 28, FS)
Type the escape character followed by C to get back,
or followed by ? to see other options.
ATE1Q0V1                           ; you type this and then the Enter key
OK                                 ; modem should respond with this

If your modem responds to AT commands, you can assume your modem is working correctly on the Linux side. Now try calling another modem by typing:

ATDT7654321
where 7654321 is a phone number. Use ATDP instead of ATDT if you have a pulse line. If the call goes through, your modem is working.

To get back to the kermit prompt, hold down the Ctrl key, press the backslash key, then let go of the Ctrl key, then press the C key:

Ctrl-\-C
(Back at linux)
C-Kermit>quit
linux#

This was just a test using the primitive "by-hand" dialing method. The normal method is to let kermit do the dialing for you with its built-in modem database and automatic dialing features, for example using a US Robotics (USR) modem:

linux# kermit
C-Kermit 6.0.192, 6 Sep 1997, for Linux
 Copyright (C) 1985, 1996,
  Trustees of Columbia University in the City of New York.
Default file-transfer mode is BINARY
Type ? or HELP for help
C-Kermit>set modem type usr        ; Select modem type
C-Kermit>set line /dev/ttyS3       ; Select communication device
C-Kermit>set speed 115200          ; Set the dialing speed
C-Kermit>dial 7654321              ; Dial
 Number: 7654321
 Device=/dev/ttyS3, modem=usr, speed=115200
 Call completed.<BEEP>
Connecting to /dev/ttyS3, speed 115200
The escape character is Ctrl-\ (ASCII 28, FS).
Type the escape character followed by C to get back,
or followed by ? to see other options.

Welcome to ...

login:

See section Communications Programs about communications programs if you need some pointers.

When you dial out with your modem, set the speed to the highest bps rate that your modem supports. Versions of Linux with a libc version greater then 5.x have support for speeds up to 115200 bps. libc usually lives in /lib, so look there for what version you have. If Linux does not recognize a speed of 57600 or 115200 bps, then you must use the setserial program to set your serial port to a higher speed. See section How Do I Set Up My Serial Ports For Higher Speeds? for how to do this. Then, set the speed to 38400 bps in your comm program.

5.3 Dial Out Modem Configuration

For dial out use only, you can configure your modem however you want. If you intend to use your modem for dialin, you must configure your modem at the same speed that you intend to run getty at. So, if you want to run getty at 38400 bps, set your speed to 38400 bps when you configure your modem. This is done to prevent speed mismatches between your computer and modem. In general, factory defaults that enable error correction and hardware flow control are the best setting for dial out modems, consult your modem manual for these settings.

5.4 Hardware Flow Control

If your modem supports hardware flow control (RTS/CTS), I highly recommend you use it. This is particularly important for modems that support data compression. First, you have to enable RTS/CTS flow control on the serial port itself. This is best done on startup, like in /etc/rc.d/rc.local or /etc/rc.d/rc.serial. Make sure that these files are being run from the main rc.sysinit file! You need to do the following for each serial port you want to enable hardware flow control on:

stty crtscts < /dev/ttyS3
You must also enable RTS/CTS flow control on your modem. Consult your modem manual on how to do this, as it varies between modem manufacturers. Be sure to save your modem configuration if your modem supports stored profiles.


Previous Next Contents