Blame Manuals/Tcpi-ug/Configurations/Dialup/modem.docbook

b76a4d
<sect1 id="configurations-ppp-device">
c4b902
b76a4d
    <title>The Modem Device</title>
b76a4d
b76a4d
    <sect2 id="configurations-ppp-device-install">
b76a4d
b76a4d
    <title>Installation</title>
ea6b40
ea6b40
    <para>
ea6b40
        Start with a minimal installation of &TC;;, bootup the
ea6b40
        operating system, and login as root user. Later, install the
ea6b40
        <quote>Dialup Networking Support</quote> group of packages
ea6b40
        available in the [base] repository of &TC;;. The
ea6b40
        installation of this group of packages is required both in
ea6b40
        server and client computers. If you don't have this group of
ea6b40
        packages installed in your computer, then you can do it as the
ea6b40
        following command describes:
ea6b40
    </para>
ea6b40
ea6b40
    <screen>yum groupinstall "Dialup Networking Support"</screen>
ea6b40
c4b902
    <para>
c4b902
        The modem device installation consists on attacthing the modem
c4b902
        hardware both to the computer and the telephone line. To
c4b902
        connect the modem to your computer, you need to connect the
c4b902
        serial or USB cable that comes from the modem hardware to the
c4b902
        appropriate input on your computer. To connect the modem to
c4b902
        the telephone line system, you need to unplug the cable that
c4b902
        connects your phone device and plug it on the modem device,
c4b902
        specifically in the port reserved for data transmission.
c4b902
        Later, using a similar cable, you could connect your phone
c4b902
        device to the modem's phone port, so you be able of realizing
c4b902
        phone calls when no data transmition take place, as well.
c4b902
    </para>
c4b902
c4b902
    <para>
c4b902
        To be on the safe side, do all the installation with the
c4b902
        computer turned off. Then, when everthing has been put in
c4b902
        place, turn it on. Once the system is up, you can verify the
c4b902
        modem hardware using either the <command>lsusb</command> or
c4b902
        <command>lspci</command> commands. For example, if you are
c4b902
        using an USB modem like that one we mentioned before, run the
c4b902
        following command:
c4b902
    </para>
c4b902
c4b902
    <screen>sudo /sbin/lsusb</screen>
c4b902
c4b902
    <para>
c4b902
        and you should get an output similar to the following:
c4b902
    </para>
c4b902
c4b902
<screen>
c4b902
Bus 003 Device 001: ID 0000:0000  
c4b902
Bus 001 Device 001: ID 0000:0000  
c4b902
Bus 001 Device 002: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader
c4b902
Bus 002 Device 001: ID 0000:0000  
c4b902
Bus 005 Device 003: ID 06e0:f104 Multi-Tech Systems, Inc.
c4b902
MT5634ZBA-USB MultiModemUSB (new firmware)
c4b902
Bus 005 Device 001: ID 0000:0000  
c4b902
Bus 005 Device 002: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse
c4b902
Bus 004 Device 001: ID 0000:0000 
c4b902
</screen>
c4b902
c4b902
    <para>
c4b902
        The relevant line here is that mentioning the existence of a
c4b902
        Multi-Tech System, Inc. MT5634ZBA-USB MultiModemUSB (new
c4b902
        firmware) device.
c4b902
    </para>
c4b902
abdd08
    <para>
abdd08
        At this point, your computer should be able of responding to
abdd08
        incoming calls but cannot realize outgoing calls, yet.  To
abdd08
        administer the way incoming calls are attended in this
b76a4d
        computer, read 
abdd08
        />. On the other hand, to realize outgoing calls from this
abdd08
        computer, you need to specify the server information you want
abdd08
        to establish connection to, as described in 
abdd08
        linkend="configurations-ppp-modem-client" />.
abdd08
    </para>
abdd08
b76a4d
    </sect2>
b76a4d
b76a4d
    <sect2 id="configurations-ppp-device-config">
b76a4d
    <title>Configuration</title>
b76a4d
b76a4d
    <para>
b76a4d
        Once the modem hardware has been installed in the computer, it
b76a4d
        is necessary to determine what device location the operating
ea6b40
        system assigned to it, so you can instruct applications like
ea6b40
        <application>chat</application> the correct device they will
ea6b40
        to talk to.  This configuration process has been greatly
ea6b40
        simplified thanks to the <command>wvdialconf</command>
ea6b40
        command, distributed with the <package>wvdial</package>
ea6b40
        package.
b76a4d
    </para>
b76a4d
    
b76a4d
    <sect3 id="configurations-ppp-device-config-wvdial">
b76a4d
    <title>The <command>wvdialconf</command> Command</title>
b76a4d
b76a4d
    <para>
b76a4d
        The <command>wvdialconf</command> automatically detects the
b76a4d
        location the operating system assigned to your modem, its
b76a4d
        maximum baud rate, a good initialization string for it, and
b76a4d
        generates/updates the <command>wvdial</command> configuration
b76a4d
        file (<filename>/etc/wvdial.conf</filename>) the
b76a4d
        <command>wvdial</command> command needs to work. To set the
b76a4d
        modem configuration through <command>wvdialconf</command>
b76a4d
        command, run the command as follows:
b76a4d
    </para>
b76a4d
b76a4d
    <screen>sudo /usr/bin/wvdialconf /etc/wvdial.conf</screen>
b76a4d
    
b76a4d
    <para>
b76a4d
        This command will produce an output like the following:
b76a4d
    </para>
b76a4d
b76a4d
<screen>
b76a4d
Scanning your serial ports for a modem.
b76a4d
b76a4d
ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
b76a4d
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
b76a4d
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
b76a4d
Port Scan<*1>: S1   S2   S3   
b76a4d
WvModem<*1>: Cannot get information for serial port.
b76a4d
ttyACM0<*1>: ATQ0 V1 E1 -- OK
b76a4d
ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
b76a4d
ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
b76a4d
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
b76a4d
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
b76a4d
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
b76a4d
ttyACM0<*1>: Modem Identifier: ATI -- LT V.90 1.0 MT5634ZBA-USB
b76a4d
Data/Fax Modem (Dual Config) Version 5.18e
b76a4d
ttyACM0<*1>: Speed 4800: AT -- OK
b76a4d
ttyACM0<*1>: Speed 9600: AT -- OK
b76a4d
ttyACM0<*1>: Speed 19200: AT -- OK
b76a4d
ttyACM0<*1>: Speed 38400: AT -- OK
b76a4d
ttyACM0<*1>: Speed 57600: AT -- OK
b76a4d
ttyACM0<*1>: Speed 115200: AT -- OK
b76a4d
ttyACM0<*1>: Speed 230400: AT -- OK
b76a4d
ttyACM0<*1>: Speed 460800: AT -- OK
b76a4d
ttyACM0<*1>: Max speed is 460800; that should be safe.
b76a4d
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
b76a4d
b76a4d
Found an USB modem on /dev/ttyACM0.
b76a4d
Modem configuration written to /etc/wvdial.conf.
b76a4d
ttyACM0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
b76a4d
</screen>
b76a4d
b76a4d
    <para>
b76a4d
        and a <command>wvdial</command> configuration file like the
b76a4d
        following:
b76a4d
    </para>
b76a4d
b76a4d
<screen>
b76a4d
[Dialer Defaults]
b76a4d
Modem = /dev/ttyACM0
b76a4d
Baud = 460800
b76a4d
Init1 = ATZ
b76a4d
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
b76a4d
ISDN = 0
b76a4d
Modem Type = USB Modem
b76a4d
; Phone = <Target Phone Number>
b76a4d
; Username = <Your Login Name>
b76a4d
; Password = <Your Password>
b76a4d
</screen>
b76a4d
b76a4d
    <note>
b76a4d
    <para>
b76a4d
        It is possible to configure the same computer to act both as
b76a4d
        server (i.e., to receive incoming calls from clients) and
b76a4d
        client (i.e., to realize outgoing calls to servers). However,
b76a4d
        be aware that only one of these connections can be established
b76a4d
        at a time.
b76a4d
    </para>
b76a4d
    </note>
b76a4d
b76a4d
    </sect3>
b76a4d
b76a4d
    <sect3 id="configuration-ppp-device-config-scn">
b76a4d
    <title>The <command>system-config-network</command> Command</title>
b76a4d
b76a4d
    <para>
ea6b40
        Another way to configure modems installed in your computer is
ea6b40
        through the graphical interface provided by
ea6b40
        <command>system-config-network</command> command. This
ea6b40
        interface may result specially useful when you need to
ea6b40
        configure your computer to establish Modem connections to
ea6b40
        remote Internet Service Providers (ISPs).  The interface
ea6b40
        provided by <command>system-config-network</command> command
ea6b40
        uses the same configuration file that
ea6b40
        <command>wvdialconf</command> command does (e.g.,
ea6b40
        <filename>/etc/wvdial.conf</filename>), however, there are
ea6b40
        some differences in the way these commands create
ea6b40
        configuration files that we need to be aware of.
ea6b40
    </para>
ea6b40
ea6b40
    <para>
b76a4d
        The interface provided by
b76a4d
        <command>system-config-network</command> command doesn't
b76a4d
        detect the configuration intially created by
b76a4d
        <command>wvdialconf</command> command. In fact, if you set a
b76a4d
        new (modem) hardware configuration through it, any
b76a4d
        configuration previously created by
b76a4d
        <command>wvdailconf</command> command will be lost. On the
b76a4d
        other hand, if you firstly generate the configuration file
b76a4d
        using the interface provided by
b76a4d
        <command>system-config-network</command> command and later run
b76a4d
        the <command>wvdialconf</command> command over it, you will
b76a4d
        end up having two similar configuration settings under
b76a4d
        different definitions stored in the same configuration file.
b76a4d
    </para>
b76a4d
b76a4d
    <note>
b76a4d
    <para>
b76a4d
        The <command>wvdial</command> command doesn't understand the
b76a4d
        configuration file produced by
b76a4d
        <command>system-config-network</command> command, even both
b76a4d
        <command>wvdialconf</command> and
b76a4d
        <command>system-config-network</command> commands use the same
b76a4d
        configuration syntax to create the configuration file.
b76a4d
    </para>
b76a4d
    </note>
b76a4d
b76a4d
    <para>
b76a4d
        Inside the <filename>/etc/wvdial.conf</filename> configuration
b76a4d
        file, the interface provided by
b76a4d
        <command>system-config-network</command> identifies default
b76a4d
        modem configurations through the [Modem0] line,
b76a4d
        while the <command>wvdialconf</command> command does the same
b76a4d
        through the [Dialer Defaults] line. Something
b76a4d
        interesting about the configuration file created by
b76a4d
        <command>system-config-network</command> is that it is
b76a4d
        possible to create several ISP configurations that reuse
b76a4d
        default settings in the [Modem0] section. For
b76a4d
        example, consider the following example:
b76a4d
    </para>
b76a4d
b76a4d
<screen>
b76a4d
[Modem0]
b76a4d
Modem = /dev/ttyACM0
b76a4d
Baud = 460800
b76a4d
SetVolume = 2
b76a4d
Dial Command = ATDT
b76a4d
Init1 = ATZ
b76a4d
Init3 = ATM1L2
b76a4d
FlowControl = CRTSCTS
b76a4d
[Dialer Vispa_Internet]
b76a4d
Username = signup
b76a4d
Password = rebel
b76a4d
Phone = 08453080125
b76a4d
Stupid Mode = 1
b76a4d
Init1 = ATZ
b76a4d
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
b76a4d
Inherits = Modem0
b76a4d
</screen>
b76a4d
b76a4d
    <caution>
b76a4d
    <para>
b76a4d
        The interface provided by
b76a4d
        <command>system-config-network</command> command doesn't
b76a4d
        provide modem detection (as <command>wvdialconf</command>
b76a4d
        command would do) and uses the <filename>/dev/modem</filename>
b76a4d
        as default location. This location doesn't exists by default,
b76a4d
        so whatever configuration you set from it will not work. To
b76a4d
        solve this issue, chose one of the following workarounds: 
b76a4d
    </para>
b76a4d
    <itemizedlist>
b76a4d
    <listitem>
b76a4d
    <para>
b76a4d
        Replace the <filename>/dev/modem</filename> location by that
b76a4d
        one <command>wvdialconf</command> found when the interface
b76a4d
        provided by <command>system-config-network</command> ask you
b76a4d
        to enter the modem device.
b76a4d
    </para>
b76a4d
    </listitem>
b76a4d
    <listitem>
b76a4d
    <para>
b76a4d
        Create <filename>/dev/modem</filename> location as a symbolic
b76a4d
        link to that location found by <command>wvdialconf</command>
b76a4d
        command. For example:
b76a4d
        <screen>sudo /bin/ln -s /dev/ttyACM0 /dev/modem</screen>
b76a4d
    </para>
b76a4d
    </listitem>
b76a4d
    </itemizedlist>
b76a4d
    </caution>
b76a4d
b76a4d
    </sect3>
b76a4d
b76a4d
    </sect2>
b76a4d
c4b902
</sect1>