RUNNING NETSCAPE, TELNET, FTP, LYNX Last edit: April 12, 1997 [New ppp, pppkill. Added modem notes.] To run netscape, a connection to an internet service must be made. The method applies also to run Telnet, Ftp and Lynx; it depends on kermit and two shell scripts "ppp" and "pppkill". Example: Connection to UofU math dept. startx Start X windows ppp "Winsock" ppp connect to UofU annex, 581-8105 netscape Industry standard net browser. The "ppp" can be issued before or after X is started. If ppp and netscape are not listed in a menu, then launch them from an xterm window. The same applies to telnet, ftp, lynx (all can run at the same time). When netscape, lynx, telnet, ftp are no longer being used, return the phone line to normal by the command pppkill After this is done, power down the modem. WARNING: Some kermit versions may make the connection impossible. Send email if you get into trouble, gustafso@math.utah.edu. See also kermit command "set exit warning off" which appears below in kermit script "~/.mykermrc". =============================TECH NOTES================================= The mechanics of the shell scripts "ppp" and "pppkill" are as follows. Interest in this sequence of events is seldom, but needed if the remote ppp host changes. For first-time setup, files "/bin/ppp", "/bin/pppkill", "/bin/pppaddress", "~/.mykermrc", "~/.kermrc-ppp" are created. The first three are executable shell scripts, made so with "chmod +x /bin/ppp", "chmod +x "/bin/pppkill" and "chmod +x /bin/pppaddress". The commands "ppp1" and "ppp2" are defined in kermit's setup file, /root/.mykermrc. Here's what we are trying to automate: pppkill Kill off last running pppd, if any kermit Start up kermit ppp1 Login to annex, issue "ppp" to annex prompt ppp2 Redirect pppd /dev/modem 38400 defaultroute exit Exit from kermit, leave pppd running pppaddress Print address of connection (0.0.0.0 on error) The "redirect" command loads the program pppd into memory with certain command line arguments. This daemon (pppd) establishes the matching ppp software that communicates with annex using internet protocol. Picture the setup as a dumbell, where the bar is the phone line and the bells are the ppp daemons running on the remote and local hosts. Kermit itself can be used while pppd is loaded, provided kermit is started with IP setup, instead of modem line setup. See the kermit documentation for details on how to do this. A reason to use kermit instead of telnet is for the customization features of kermit that are lacking in telnet (color, key maps, etc). This advice applies to 1996 kermits, not older ones. If you have an old one, then upgrade! File /bin/ppp #! /bin/sh # File /bin/ppp, used to setup ppp between a # remote host and the local linux host. # Kill old ppp connections pppkill kermit -C "ppp1,ppp2,exit" >/dev/null & echo "pppaddress prints the DISPLAY address (all zeros means NONE)." echo "Making ppp connection on /dev/modem. Listen for dial sounds." File /bin/pppkill #! /bin/sh # File /bin/pppkill, used to kill the ppp daemon "pppd" echo -n "Killing pppd connections." foo=`ps ax | grep "kermit"` case "$foo" in *kermit\ -C\ ppp1,ppp2,exit*) fpid=`echo $foo | cut -d ' ' -f 1` kill -9 $fpid echo -n " Killed pppd kermit pid=$fpid.";; esac foo=`ps ax | grep "pppd"` case "$foo" in *\(pppd\)*) fpid=`echo $foo | cut -d ' ' -f 1` kill -9 $fpid echo -n " Killed inactive pppd pid=$fpid.";; *pppd\ /dev/modem*) fpid=`echo $foo | cut -d ' ' -f 1` kill -9 $fpid echo -n " Killed active pppd pid=$fpid.";; *) echo -n " No active pppd found.";; esac File /bin/pppaddress #! /bin/sh # File /bin/pppaddress # Echo machine internet address TMP=`ifconfig ppp0 |grep addr: |cut --delimiter=' ' -f 12 |cut -c 6-` echo $TMP echo setenv DISPLAY $TMP:0 echo "export DISPLAY; DISPLAY=$TMP:0" File /root/.mykermrc set exit warning off set line /dev/modem def ppp1 take /root/.kermrc-ppp def ppp2 redirect pppd /dev/modem crtscts mru 296 mtu 296 defaultroute 38400 echo ppp1 --- PPP connect annex.math.utah.edu, 581-8105 echo ppp2 --- Redirect pppd /dev/modem defaultroute 38400 File /root/.kermrc-ppp # Modem init string is required. # simple: output atz\13 # complex: output AT&F1E1Q0V1&C1&D2S0=0+ms=11,,14400,28800\13 # Then: input 10 OK # /etc/rc.d/rc.local should contain "setserial /dev/modem spd_vhi" # for modern modem of speed 28800bps or greater. # set speed 38400 output atdt5818105\13 input 30 CONNECT input 30 sername output myusername\13 <== Change this to yours! input 30 assword output mypassword\13 <== Change this to yours! input 30 hangup input 30 annex output ppp\13 return ==========================MODEM TECH NOTES============================== LINUX SERIAL SETUP. All modems, internal or external, require a serial port setup from command file /etc/rc.d/rc.local (linux only). The usual command is setserial /dev/modem spd_vhi It causes the serial port to respond with setting 3*38400 = 115200 when it receives 38400 speed settings. Typical symptoms of errors in the speed setting are dropping the modem just after startup, dropping characters and dropping of the modem inside kermit. Under linux, do not using the numbers 57600, 115200 anywhere within kermit scripts or setups that try to set the serial port. It's not handled that way. You have to set the multiplier using "setserial" in order to get the effect of numbers like 57600 or 115200. Likewise, don't mix and match, use 38400 everwhere, or 19200 everywhere. It's a classic mistake to use 14400 or 28800 anywhere on a linux system. BAUD RATE and BPS. The "baud rate" means 2400 on modern modems, whereas "bps" means the effective bits per second transmission rate, usually given as 14400bps, 28800bps or 33.6Kbps. The "bps" setting refers to compression rates and it is handled by the modem. The baud rate is a limitation of the phone line and it has nothing much to do with the modem you bought or the capabilities of your serial port hardware. In particular, "I have a 28800 baud modem" is a nonsense statement which probably means "I have a 28800bps modem". It is true that older serial ports of the 8250 or 16450 variety can give trouble with newer modems having bps rates of 28800 or higher. See the linux serial HOWTO for more info on this subject. FACTORY STRING. It is possible to locate the init string from the DOS file modem.ini distributed with CISCO systems CONNECT software for windows 3.x/95. A typical entry looks like this: [US Robotics Sportster 28.8 (V.42bis)] Init=AT&F1E1Q0V1&C1&D2S0=0 AnswerInit1=AT&F1E1Q0V1&C1&D2S0=1 ComBPS=115200 probe=ATI3 response=Sportster 28,800/Fax|Sportster 28800/Fax FlowControl=Hardware In unix, only "Init=" and "AnswerInit=" are useful, the second being used only in case you have set up the unix machine for outside dialup (an unlikely event for linux). The string after "Init=" is the string to output in the kermit script. On some modems it is necessary to limit speed matching negotiations to the range 14400 - 28800 (elimination of 33.6). This depends on the remote site. The mechanism for making your own modem obey this request is to add characters onto the Init string, like this: S37=17 or +ms=11,,14400,28800 The modem manual generally tells you which syntax will work. The 'S' and "+ms=" commands are documented in the 'AT' commands. The 'ATS37=17' command is accepted by most modems, but not all modems react to this command, even if it is silently accepted. The syntax 'at+ms=' is common to Infotel modems. This syntax sets the 'S' register automatically, so you shouldn't mix and match the commands. The complete syntax for testing the effects are as follows: ats37? Query setting of register 37 at+ms=? Query possible speed settings at+ms=11,,14400,28800 Set speed limits ats37=17 Set register content CUSTOM INIT STRING. In theory, output atz\13 input 10 OK output at+ms=11,,14400,28800\13 input 10 OK would fix up a modem that has problems hanging on to a connection, or one that makes strange cycling sounds during connection. The trouble is that modems use their own syntax for limiting the connect speed, even though the command may be accepted. You have to read the manual to find out how it works, or else experiment with the modem, and query what it does. For example, if you set register 37 with "ATS37=17", then execute "ATS37?" to see if it worked. A value of "000" means it defaulted and "19" does nothing. On modems that support the "at+ms=" syntax, use "at+ms=?" to find out the possible settings. These problems are unique to 28800/33600 modems. A 14400 or 28800 will generally work with just "atz"! ========================================================================