Next Previous Contents

5. How Do I Dial Out With My Modem?

5.1 Hardware Requirements

You may use either an external or internal modem. The internal costs less and takes up no space on the desk or table. But the external are easier to "install" and have lights to give you a clue as to what is happening. But externals need to be switched off when not in use and are likely to consume a little electricity even when turned off.

External Modems

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.

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.

If you have an IBM8514 video board, then there is a bug you should know about. 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, minicom 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 serial port speed that your modem supports (provided it's not over 115200 bps). This is not the same as the "advertised" speed of the modem such as 56K. Versions of Linux with a libc version greater then 5.x have support for speeds up to 115200 bps. Even higher speeds than this are in the works for Linux.

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. However, most modems today set their speed automatically to the same speed that modem commands use. Thus having getty run at 115,200 will automatically set the modem at this speed when getty sends an init string to the serial port where the modem is. 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
If its not enabled by default, you must also enable RTS/CTS flow control on your modem. Your communication program may enable it. Consult your modem manual if needed and then save your modem configuration if your modem supports stored profiles.


Next Previous Contents