setserial
?How do I dial out with my modem?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.
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 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.
Use kermit
or some other simple comm program to test the setup,
before you go jumping into complex comm programs.
(For legal reasons, kermit
is not distributed with commercial
distributions. You can find the latest version of kermit
on sunsite.unc.edu:/pub/Linux/apps/comm
and mirror sites.)
For example, say your modem was on ttyS3
, and it could
handle 38400 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 38400
/dev/cua3, 38400 bps
C-Kermit>c
Connecting to /dev/cua3, speed 38400.
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 calling another modem.
If you don't like kermit
, try one of the more advanced
comm programs. Check out section
Communications programs about comm 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. Since there is no speed named 57600
or 115200 bps, 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.
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.
I like to see result codes, so I set Q0
- result codes are
reported. To set this on my modem,
I would have to precede the register name with an AT
command.
Using kermit
or some comm program, connect to your modem and
type 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.
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 (often done with AT&W
, but
varies between modem manufacturers) if not
you will have to set the registers every time you turn on, or reset
your modem.
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.M
file!
You need to do the following for each serial port you want to enable
hardware flow control on:
stty crtscts < /dev/cuaN
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.