Blame Manuals/Tcpi-ug/Configurations/Ppp/modem-config.docbook

50b270
<sect1 id="configurations-ppp-modem-config">
07124f
2690bc
    <title>Configuring Modem Device</title>
07124f
07124f
    <para>
07124f
        Once the modem hardware has been installed in the computer, it
2690bc
        is necessary to determine what device location the operating
2690bc
        system assigned to it, so applications like
2690bc
        <application>chat</application> be able to know which device
2690bc
        to talk to.  This configuration process can be realized
2690bc
        through the <command>wvdialconf</command> command, distributed
2690bc
        with the <package>wvdial</package> package.
2690bc
    </para>
2690bc
    
2690bc
    <para>
2690bc
        Another way to configure modems installed in your computer is
2690bc
        through the graphical interface provided by
2690bc
        <command>system-config-network</command> command. This
2690bc
        interface may result specially useful when you need to
2690bc
        configure your computer to establish Modem connections to
2690bc
        remote Internet Service Providers (ISPs).  The interface
2690bc
        provided by <command>system-config-network</command> command
2690bc
        uses the same configuration file that
2690bc
        <command>wvdialconf</command> command does (e.g.,
2690bc
        <filename>/etc/wvdial.conf</filename>), however, there are
2690bc
        some differences in the way these commands create
2690bc
        configuration files that we need to be aware of.
2690bc
    </para>
2690bc
2690bc
    <para>
2690bc
        This section describes how you could use the
2690bc
        <command>wvdialconf</command> and
2690bc
        <command>system-config-network</command> commands to configure
2690bc
        the modem installed in your computer, as well as possible
2690bc
        issues you might face if these two commands are arbitrarily
2690bc
        combined one another.
193865
    </para>
193865
50b270
    <sect2 id="configurations-ppp-modem-config-wvdial">
2690bc
    <title>The <command>wvdialconf</command> Command</title>
193865
193865
    <para>
2690bc
        The <command>wvdialconf</command> automatically detects the
2690bc
        location the operating system assigned to your modem, its
2690bc
        maximum baud rate, a good initialization string for it, and
2690bc
        generates/updates the <command>wvdial</command> configuration
2690bc
        file (<filename>/etc/wvdial.conf</filename>) the
2690bc
        <command>wvdial</command> command needs to work. To set the
2690bc
        modem configuration through <command>wvdialconf</command>
2690bc
        command, run the command as follows:
07124f
    </para>
07124f
07124f
    <screen>sudo /usr/bin/wvdialconf /etc/wvdial.conf</screen>
07124f
    
07124f
    <para>
193865
        This command will produce an output like the following:
07124f
    </para>
07124f
07124f
<screen>
07124f
Scanning your serial ports for a modem.
07124f
07124f
ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
07124f
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
07124f
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
07124f
Port Scan<*1>: S1   S2   S3   
07124f
WvModem<*1>: Cannot get information for serial port.
07124f
ttyACM0<*1>: ATQ0 V1 E1 -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
07124f
ttyACM0<*1>: Modem Identifier: ATI -- LT V.90 1.0 MT5634ZBA-USB
07124f
Data/Fax Modem (Dual Config) Version 5.18e
07124f
ttyACM0<*1>: Speed 4800: AT -- OK
07124f
ttyACM0<*1>: Speed 9600: AT -- OK
07124f
ttyACM0<*1>: Speed 19200: AT -- OK
07124f
ttyACM0<*1>: Speed 38400: AT -- OK
07124f
ttyACM0<*1>: Speed 57600: AT -- OK
07124f
ttyACM0<*1>: Speed 115200: AT -- OK
07124f
ttyACM0<*1>: Speed 230400: AT -- OK
07124f
ttyACM0<*1>: Speed 460800: AT -- OK
07124f
ttyACM0<*1>: Max speed is 460800; that should be safe.
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
07124f
07124f
Found an USB modem on /dev/ttyACM0.
07124f
Modem configuration written to /etc/wvdial.conf.
07124f
ttyACM0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
07124f
</screen>
07124f
07124f
    <para>
193865
        and a <command>wvdial</command> configuration file like the
193865
        following:
07124f
    </para>
07124f
07124f
<screen>
07124f
[Dialer Defaults]
07124f
Modem = /dev/ttyACM0
07124f
Baud = 460800
07124f
Init1 = ATZ
07124f
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
07124f
ISDN = 0
07124f
Modem Type = USB Modem
07124f
; Phone = <Target Phone Number>
07124f
; Username = <Your Login Name>
07124f
; Password = <Your Password>
07124f
</screen>
07124f
193865
    <note>
07124f
    <para>
2690bc
        It is possible to configure the same computer to act both as
2690bc
        server (i.e., to receive incoming calls from clients) and
2690bc
        client (i.e., to realize outgoing calls to servers). However,
2690bc
        be aware that only one of these connections can be established
2690bc
        at a time.
07124f
    </para>
193865
    </note>
07124f
50b270
    </sect2>
07124f
50b270
    <sect2 id="configuration-ppp-modem-config-scn">
2690bc
    <title>The <command>system-config-network</command> Command</title>
193865
07124f
    <para>
193865
        The interface provided by
193865
        <command>system-config-network</command> command doesn't
2690bc
        detect the configuration intially created by
2690bc
        <command>wvdialconf</command> command. In fact, if you set a
2690bc
        new (modem) hardware configuration through it, any
2690bc
        configuration previously created by
2690bc
        <command>wvdailconf</command> command will be lost. On the
2690bc
        other hand, if you firstly generate the configuration file
2690bc
        using the interface provided by
2690bc
        <command>system-config-network</command> command and later run
2690bc
        the <command>wvdialconf</command> command over it, you will
2690bc
        end up having two similar configuration settings under
2690bc
        different definitions stored in the same configuration file.
193865
    </para>
2690bc
2690bc
    <note>
193865
    <para>
2690bc
        The <command>wvdial</command> command doesn't understand the
2690bc
        configuration file produced by
2690bc
        <command>system-config-network</command> command, even both
2690bc
        <command>wvdialconf</command> and
2690bc
        <command>system-config-network</command> commands use the same
2690bc
        configuration syntax to create the configuration file.
193865
    </para>
2690bc
    </note>
07124f
07124f
    <para>
193865
        Inside the <filename>/etc/wvdial.conf</filename> configuration
193865
        file, the interface provided by
193865
        <command>system-config-network</command> identifies default
2690bc
        modem configurations through the [Modem0] line,
193865
        while the <command>wvdialconf</command> command does the same
2690bc
        through the [Dialer Defaults] line. Something
193865
        interesting about the configuration file created by
193865
        <command>system-config-network</command> is that it is
193865
        possible to create several ISP configurations that reuse
193865
        default settings in the [Modem0] section. For
193865
        example, consider the following example:
07124f
    </para>
07124f
07124f
<screen>
193865
[Modem0]
193865
Modem = /dev/ttyACM0
193865
Baud = 460800
193865
SetVolume = 2
193865
Dial Command = ATDT
193865
Init1 = ATZ
193865
Init3 = ATM1L2
193865
FlowControl = CRTSCTS
193865
[Dialer Vispa_Internet]
193865
Username = signup
193865
Password = rebel
193865
Phone = 08453080125
193865
Stupid Mode = 1
193865
Init1 = ATZ
193865
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
193865
Inherits = Modem0
07124f
</screen>
193865
2690bc
    <caution>
2690bc
    <para>
2690bc
        The interface provided by
2690bc
        <command>system-config-network</command> command doesn't
2690bc
        provide modem detection (as <command>wvdialconf</command>
2690bc
        command would do) and uses the <filename>/dev/modem</filename>
2690bc
        as default location. This location doesn't exists by default,
2690bc
        so whatever configuration you set from it will not work. To
2690bc
        solve this issue, chose one of the following workarounds: 
2690bc
    </para>
2690bc
    <itemizedlist>
2690bc
    <listitem>
2690bc
    <para>
2690bc
        Replace the <filename>/dev/modem</filename> location by that
2690bc
        one <command>wvdialconf</command> found when the interface
2690bc
        provided by <command>system-config-network</command> ask you
2690bc
        to enter the modem device.
2690bc
    </para>
2690bc
    </listitem>
2690bc
    <listitem>
2690bc
    <para>
2690bc
        Create <filename>/dev/modem</filename> location as a symbolic
2690bc
        link to that location found by <command>wvdialconf</command>
2690bc
        command. For example:
2690bc
        <screen>sudo /bin/ln -s /dev/ttyACM0 /dev/modem</screen>
2690bc
    </para>
2690bc
    </listitem>
2690bc
    </itemizedlist>
2690bc
    </caution>
2690bc
07124f
    </sect2>
07124f
07124f
</sect1>