How do I dial out with my modem?

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 8 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 COM4. If Linux does not detect your internal modem on COM4, you can use setserial and the modem will work fine. Internal modems on COM1 - COM3 should not have any problems.

Talking to your modem

For now, make sure that nothing is using the serial port you hooked your modem to. Check to see if there is a getty watching it, or that it has not been locked by another process. 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 tty* device, only ones containing ttyS* or cua*. tty* devices are your virtual consoles.

Use kermit to test the setup. For example, say your modem was on /dev/cua3, 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 the section about comm programs if you need some pointers.

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. 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. If your modem has data compression capabilities, you probably want to enable them. You may want to enable RTS/CTS handshaking. Consult your modem manual for more help, and a full listing of option.