			MODEM TESTING
			 
This text is complemented by the Post-Install at http://linmodems.technion.ac.il
Please so consult it if the following does not suffice.

The wvdial package provides for an automated hardware+driver test.
This utility searches through ports with syntax: /dev/ttyS*  (i.e. S0, S1, SL0 etc.)
and also follows a symbolic link:
	/dev/modem --> /dev/ModemPort
If your modem port name does not satisfy these requirements already,
do a console login as:
	su - root
Make the symbolic links as:	
	ln -sf /dev/ModemPort /dev/modem
	ln -sf /dev/ModemPort /dev/ttyS15
wherein /dev/ttyS15 is reserved for experimental usage.
 Should there be problems with wvdial version 1.54.1-1 , drop back to 1.54.0-1 

For recent RedHat and Fedora releases, wvdialconf is used by the Internet Wizard.
Within the pop-up menus find the Wizard. Its actions will write a configuration file:
	/etc/wvdial.conf
For other Linux distros, open a console and login with
	su - root
If necessary load the modem drivers:
	sudo modprobe DriverNames
Then run the test:
	wvdialconf /etc/wvdial.conf
Checks /dev/modem and ports /dev/ttyS*, a success at port /dev/ttySLT0 would be:
  ttySLT0<*1>: ATQ0 V1 E1 -- OK
  ttySLT0<*1>: ATQ0 V1 E1 Z -- OK
  ttySLT0<*1>: ATQ0 V1 E1 S0=0 -- OK
  ttySLT0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
  ttySLT0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
  ttySLT0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK 
    etc.
The /etc/wvdial.conf written looks like:
 
 [Dialer Defaults]
Modem = /dev/ttySLT0
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
; Phone = <Target Phone Number>
; Username = <Your Login Name>
; Password = <Your Password>

For systems using the SmartLink slmodem drivers,
the following line should be added to its /etc/wvdial.conf
  Carrier Check = no
So after editing in your personal information a functional file is like:
 
[Dialer Defaults]
# lines beginning with # are Comments, not read by wvdial
Modem = /dev/ttySLT0
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
## if there is problem with dial tone acquisition, add into the above line:
#    X3
#	 meaning "dial without waiting"
## for some Internet Provides, there may be problems with the new V92 mode codes.
# This can be suppresses with an:
# Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 +MS=90 
## Within Italy it is sometimes necessary to even force a slower mode
# ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 +MS=34
# This mode is also useful for PBX dialout lines.
ISDN = 0
Modem Type = Analog Modem
# edit in your IP's phone number below.
Phone = 3334445555
# Do not use - or spaceds in the Phone = line
# Introducing a pause with a , is sometimes necessary with hotel/company switchboards
# Phone = 8,3334445555 or 8,,,3334445555 for s 3 second pause
Username = Your_Login_Name
# for MSN.net, use instead
#  Username = MSN/Your_Login_Name   
Password = Your_Password
# if not using the SmartLink slmodemd, comment out with # the following line.
Carrier Check = no
[ Dialer 2nd_home ]
Phone = 7778889999

Then dialout with
$ sudo wvdial
or use the 2nd dialup number with:
$ sudo wvdial 2nd_home

 
The /etc/wvdial.conf generated by the RedHat/Fedora Internet Wizard 
has a different format, adapted to its own dialer.  This includes a line
	Stupid Mode = yes
More informative dialup feedback May be obtained if it is commented out:
#	Stupid Mode = yes 

 A dialout with wvdial will then display like:
# wvdial &
--> WvDial: Internet dialer version 1.53
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 M1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 M1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT3019178111
--> Waiting for carrier.
ATDT3019178111
CONNECT 53333 V42bis
--> Carrier detected.  Waiting for prompt.
** APX1.LNH.MD.RCN.NET Terminal Server **
Login:
--> Looks like a login prompt.
--> Sending: LoginName
LoginName
Password:
--> Looks like a password prompt.
--> Sending: (password)
    Entering PPP Session.
    IP address is 66.44.1.6
    MTU is 1006.
--> Looks like a welcome message.
--> Starting pppd at Sat Jul 26 13:59:03 2003
--> pid of pppd: 2404
: pppd 2.4.1 started by root, uid 0
: Using interface ppp0
: Connect: ppp0 <--> /dev/tts/LT0
Jul 26 13:59:08 stodolsklap kernel: PPP BSD Compression module registered
Jul 26 13:59:08 stodolsklap kernel: PPP Deflate Compression module registered
: local  IP address 66.44.1.6
: remote IP address 208.59.89.132
: primary   DNS address 207.172.3.8

The & in "wvdial &" puts the process into the background, 
allowing further usage of the command prompt.  To stop a backgrounded process:
# fg wvdial
# Ctrl -C 

TROUBLE SHOOTING

Check for modem driver loading.
Do FIRST read INSTRUCTIONS files provided with the modem driver resource.
Some may have installed to /usr/share/doc/Modem_or_Driver_Name/
For RPM using distros, documentation files will be listed through
   rpm -q -d packageName (less the version part, sometimes)
and all directly installed files can be listed by
   rpm -q -l packageName
Depending upon your installation, the modem drivers may/may_not be autoloaded.
Login as Root in a console with:
# su - root
# lsmod
If the modem drivers are not already loaded onto the kernel, insert them with command
# sudo modprobe ModuleDriver
If there are multiple drivers such as the lt_modem.o and lt_serial.o pair,
commanding the serial like driver:
# sudo modprobe lt_serial
should autoload all modules it depends on.  Check with:
# lsmod 
This proceeds through a reading of dependency files
written to /lib/modules/2.6.27-7-generic/ during boot up through the "depmod -a" command.
In constrast
# insmod lt_serial
would only attempt loading of that single driver and will FAIL, if its dependency on
lt_modem.o has been satisfied by prior lt_modem.o insertion.
 
 Do read "man wvdial" and /usr/share/doc/vwdial  documentation
sometime browse the documentation that is written to /usr/share/doc/wvdial/
Therein are instructions for setting up alternative dialouts.

%%% This wvdialconf action if successful generates the files:
 /etc/ppp/peers/wvdial
 /etc/ppp/peers/wvdial-pipe
in addition to the /etc/wvdial.conf

Many Users prefer to use the dialout utility KPPP. This is fine.
But each User MUST run the configuration process separately.
In principle, different Users on the same Linux System could
have different Internet providers and/or use different modems.
The configuration process generates a file:  /home/UserFolder/.kde/share/config/kppprc
Therein, non-standard modem port names can be entered, such as:
      [Modem]
      Device=/dev/ttySHSF0
 for the Conexant hsfmodem port.  
 

Preparation for  dialout if other COMM modes are active.
---------------------------------------------------------------------------
Concurrent ethernet capability will compete for
the Domain Name Service (DNS) needed for browser naviagation. So as root:
# /sbin/ifconfig eth0 down
before starting a dialout!
With a Mandrake installation, it will be necessary to:
# /etc/init.d/network stop

Internet clients such as Netscape, Mozilla, Explorer etc.
should be CLOSED during your first dial out trials.
Should a URL on the Internet be specifed as the default URL/connect,
then the Client may compete with ppp for connectivity functions.
After PPP functionality has been verified, the effects of opened
or launched browsers can be checked

If you have installed the DIALD (dial on demand) package, stop it for initial tests:
# /etc/init.d/diald stop
Otherwise diald function will be initiated with modem usage,
and could compilate issues. Test diald only after ppp by itself is fine.

If your internet provider assigns DNS dynamically then add to /etc/ppp/options:
 usepeerdns

To analyze a dialout attempt, it is useful to display kernel messages with:
# tail -f /var/log/messages &
The & puts the commanded process in the "background" allowing recovery of the command prompt.

Some dialer packages (kppp etc) may automate the above steps.


Note that for some Linux distributions (Mandrake for one),
maintain modules in compressed module.gz format, if modem service was not specified
during the Linux installation. A subsequent installation of any dialer package:
  wvdial - PPP dialer with built-in intelligence.
  kppp - PPP dialer for KDE
  dtmfdial - A DTMF Tone Dialer
  gkdial - Gtk-based PPP dial-up configuration tool.
  gkdial-gnome - GNOME-based PPP dial-up configuration tool.
  masqdialer - daemon for remote control of masqueraded dialup links
  pppconfig - Debian configuration toolset with command: pppconf
will stimulate unpacking of ppp related modules during bootup.

The cogent ppp related modules loaded during such a CONNECT are displayed within the output from:
# lsmod
ppp_deflate             3512   1  (autoclean)
zlib_inflate           18980   0  (autoclean) [ppp_deflate]
zlib_deflate           18648   0  (autoclean) [ppp_deflate]
bsd_comp                4440   0  (autoclean)
ppp_async               7744   1  (autoclean)
ppp_generic            16380   3  (autoclean) [ppp_deflate bsd_comp ppp_async]
slhc                    5264   1  (autoclean) [ppp_generic

For ealier 2.4.nn kernels, loading of these modules may require the following lines within
  /etc/module.conf :
### automate ppp modules loading ###
alias /dev/ppp          ppp_generic
alias char-major-108    ppp_generic
alias tty-ldisc-3       ppp_async
alias tty-ldisc-14      ppp_synctty
alias ppp-compress-21   bsd_comp
alias ppp-compress-24   ppp_deflate
alias ppp-compress-26   ppp_deflate
### end ppp block ####
For more recent kernels with their modutils,
these lines are no longer needed.

For  potential causes of a NO DIALTONE failure, read the Post-install.html
at  http://linmodems.technion.ac.il/  Not setting the Country Code may be
and additional problem.

 COUNTRY CODE Issues
 ====================
 The modem which you purchase locally or abroad may not be preset
 with the proper Country Code setting.  An incorrect setting can
 hinder acquisition of dial tone.
 Inclusion of an X3 (dial without wainting) in the modem Init string
 of under wvdial, including in /etc/wvdial.conf a line
   Stupid Mode = yes

 Dialtone recognition depends on the setting of country
 and/or local phone line equipment.

 To properly get dialtone for your country phone experiment use
 AT+GCI=xx  where xx is country code in hexidecimal format.
 Theoretically there could be 256 different countries but
 not all are valid. Tables in manuals are way off date,
 you have to write a small script to try all combinations
 for yourself if you can't guess by chance.

 After country select you can check textual name of the country it represents.
 For example:
   at+gci=00
   OK
   ati9
   Japan

 If you can't find exact country, choose the nearest one available.
 Nearby countries tend to have similar equipment and compatible dialtones.
 
 If a message like:
 Sep 20 09:32:42 localhost pppd[7355]: The remote system is required to authenticate itself
 is generated during an abort of a login,
 Then try adding a line to /etc/ppp/options
   no auth

8) After a successful CONNECT, the Domain Name Service (DNS) needed
 for Browser navigation can be checked with:
# ping corel.com
PING comcast.net (63.240.76.72): 56 data bytes
64 bytes from 63.240.76.72: icmp_seq=0 ttl=52 time=209.1 ms
64 bytes from 63.240.76.72: icmp_seq=1 ttl=52 time=189.9 ms
64 bytes from 63.240.76.72: icmp_seq=2 ttl=52 time=180.0 ms
64 bytes from 63.240.76.72: icmp_seq=3 ttl=52 time=179.9 ms
# Ctrl-C
     aborts ping
--- comcast.net  ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 179.9/189.7/209.1 ms

# ping 63.240.76.72
PING 63.240.76.72 (63.240.76.72): 56 data bytes
64 bytes from 63.240.76.72: icmp_seq=0 ttl=52 time=179.8 ms
64 bytes from 63.240.76.72: icmp_seq=1 ttl=52 time=190.0 ms
64 bytes from 63.240.76.72: icmp_seq=2 ttl=52 time=170.0 ms
# Ctrl-C
     aborts ping

Should there be a success with:
# ping 63.240.76.72
BUT a failure with the named address:
ping comcast.net
Then DNS has not been acquired.
Note that failure to stop ethernet service
# /sbin/ifconfig eth0 down
before starting a dialout, will commonly block DNS under ppp.

To terminate the wvdial session, bring the action to the foreground (fg):
# fg wvdial
  Ctrl-C    to terminate:
wvdial
Caught signal #2!  Attempting to exit gracefully...
: secondary DNS address 207.172.3.9
: Terminating on signal 15.
: Connection terminated.
: Connect time 7.8 minutes.
--> Disconnecting at Sat Jul 26 14:06:53 2003

The Debian distribution provides a utility:
# pppconfig
for setting up a chatscript for ppp initiation.
Most dialers do use chatscripts and will produce similar records.
Below is the record of a dial out initiated by:

# pon
: pppd 2.4.1 started by marv, uid 1000
: abort on (BUSY)
: abort on (NO CARRIER)
: abort on (VOICE)
: abort on (NO DIALTONE)
: abort on (NO DIAL TONE)
: abort on (NO ANSWER)
: abort on (DELAYED)
: send (ATZ^M)
: expect (OK)
: ATZ^M^M
: OK
:  -- got it
: send (ATQ0V1E1M0S0=0W2&C1&D2+FCLASS=0^M)
: expect (OK)
: ^M
: ATQ0V1E1M0S0=0W2&C1&D2+FCLASS=0^M^M
: OK
:  -- got it
: send (ATDT3019178111^M)
: expect (CONNECT)
: ^M
: ATDT3019178111^M^M
: CONNECT
:  -- got it
: send (\d)
: Serial connection established.
: Using interface ppp0
: Connect: ppp0 <--> /dev/modem
: kernel does not support PPP filtering
Jul 26 14:08:39 stodolsklap kernel: PPP BSD Compression module registered
Jul 26 14:08:39 stodolsklap kernel: PPP Deflate Compression module registered
: local  IP address 66.44.1.195
: remote IP address 208.59.89.132
: primary   DNS address 207.172.3.8

Once your first CONNECT has been established, than in the future if should suffice
just to use your dialer of choice: wvdial , kppp  .gnomeppp or whatever.

Good surfing to you.

10) GENERAL ITEMS

 If attemped insertion of a modem driver evokes a complaint like:
         unresolved symbol do_SAK_R9a0bcb74
 then the kernel-headers using in compiling the modem drivers
 do not match those of your current kernel whose KernelVersion is displayed by:
    uname -r
 and whose kernel config file is often located at /boot/config-KernelVersion
 The section above "COMPILING DRIVERS, for Newbies" relates how to make corrections.

 There are definitely IPs whose login protocols are Linux hostile.
 If you cannot achieve a login, try another Internet Provider (IP).
 or ask for someone on discuss@linmodems.org to test your IP.

 Many driver packages provide for loading modem drivers on bootup.
 Here is a description on how to set it up, if necessary:
   http://linmodems.technion.ac.il/archive-fourth/msg00451.html

 PLEASE include the diagnostic output of the following Root command in any problem reports:
 # setserial -agv /dev/ttyS*

 For instructions on having modem drivers loaded on bootup,
   particularly the SmartLink slmodem drivers see:
   http://linmodems.technion.ac.il/archive-fourth/msg00451.html
 For automated removel of drivers after a PPP session see:
   http://linmodems.technion.ac.il/archive-fourth/msg00145.html

  For general upto date advice:
    http://linmodems.technion.ac.il/
    http://linmodems.technion.ac.il/resources.html
    available in Russian at  http://linmodems.nm.ru
 for a general PCI_ID database
    http://www.pcidatabase.com/
 the original Linux winmodems URL is:
    http://linmodems.org
 with a mailing list on Winmodems:
    discuss@linmodems.org
 whose archives can be searched at:
    http://linmodems.technion.ac.il/ (near bottom of the page)
 There is an extensive modem database at:
    http://start.at/modem/
 Locate your local Linux groups through:
    http://www.linux.org/groups/index.html
 USB modem information:  http://www.linux-usb.org/USB-guide/x332.html
 Laptop users should browse http://tuxmobil.org/modem_linux_add1.html
 For debugging ppp:
   http://www.cisco.com/warp/public/471/debug_ppp_negotiation.html

---------- end FOLLOW UP STEPS ---------------

