6 How do I dial out with my modem?

Contents of this section

6.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. Your DB25 serial port on your PC is always male. 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.

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 I/O address. Consult your modem manual if you get stuck. Also, see section Can I use more than 2 serial devices? if you need help on choosing interrupts or addresses.

Due to a bit of stupidity on IBM's part, 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.

6.2 Talking to your modem

Make sure that nothing is using the serial port you hooked your modem to. Check to see if there is a getty watching it. If there is a getty process running on that port, check your /etc/inittab file for entries using that serial port. Comment the line out (with a ``#'') and restart init. Do not comment any lines that contain a ttyN device, only ones containing ttySN devices. ttyN devices are your virtual consoles.

Use kermit to test the setup. For example, say your modem was on ttyS3, and it could handle 2400 bps. You would do the following:

linux# kermit
C-Kermit 5A(188), 23 Nov 92, POSIX
Type ? or HELP for help
C-Kermit>set line /dev/cua3
C-Kermit>set speed 2400
/dev/cua3, 2400 bps
C-Kermit>c
Connecting to /dev/cua3, speed 2400.
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.
AT
OK
<ctrl>-\-C
(Back at linux)
C-Kermit>quit
linux#

If your modem responds to AT commands, you can assume your modem is working correctly on the Linux side. Try dialing another modem. If you don't like kermit, try one of the more advanced comm programs. Check out section Noteworthy communications programs about comm programs if you need some pointers.

6.3 Dial out modem configuration

For dial out use only, you can configure your modem however you want.

I like to see result codes, so I set Q0 - result codes are reported. To set this on my modem, I would have to preceed the register name with an AT command. Using kermit or some comm program, connect to your modem and do the following:

ATQ0

If your modem says OK back to you, then the register is set. Do this for each register you want to set.

I also like to see what I'm typing, so I set E1 - command echo on. If your modem has data compression capabilities, you probably want to enable them. You may want to enable RTS/CTS handshaking. Note that you will also have to enable the hardware handshaking on the serial port itself, too. This is best done on startup (say in rc.local or rc.serial) by saying:

stty crtscts < /dev/cua3

Make sure you put in the correct serial port for your setup. Consult your modem manual for more help, and a full listing of options. If your modem supports a stored profile, be sure to write the configuration to the modem.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter