PPPPPP CCCC OOOO MM MM MM MM P P C O O M M M M M M M M PPPPPP C O O M M M M M M P C O O M M M M P CCCC OOOO M M M M Pcomm Reference Manual version 1.2 written by Emmet P. Gray ...!uunet!uiucuxc!fthood!egray fthood!egray@uxc.cso.uiuc.edu Pcomm is a public domain telecommunication program for Unix that is designed to operate similar to the MSDOS program, ProComm. ProComm (TM) is copyrighted by Datastorm Technologies, Inc. This is a completely new program and contains no ProComm source code. This is not a Datastorm product. Table of Contents 1 INTRODUCTION ...............1 6 FILE FUNCTIONS .............23 1.1 Abbreviations ..........1 6.1 External protocols .....23 1.2 Requirements ...........1 6.2 Send files .............23 1.3 Support files ..........2 6.3 Receive files ..........25 6.4 Pass thru mode .........25 2 RUNNING PCOMM ..............3 6.5 Directory ..............26 2.1 Hot key ................3 6.6 Screen dump ............27 2.2 Status line ............3 6.7 Start data logging .....27 2.3 Help screen ............4 6.8 Toggle logging .........27 2.4 Exit Pcomm .............4 7 DIALING WINDOW .............29 3 SETUP SCREENS ..............5 3.1 Prompting ..............5 8 AUTO-LOGIN SCRIPTS .........31 3.2 TTY setup ..............5 8.1 Waitfor command ........31 3.3 Modem setup ............6 8.2 Matches command ........32 3.4 Terminal setup .........8 8.3 Modem_break ............32 3.5 General setup ..........9 8.4 Examples ...............32 3.6 ASCII xfer setup .......11 3.7 External protocol ......12 Appendix A - Typical Modem Configuration ...........35 4 MAJOR FUNCTIONS ............15 4.1 Dialing directory ......15 Appendix B - AT&T Unix PC 4.2 Redial .................17 7300/3b1 Dial Codes .....37 4.3 Keyboard macros ........18 4.4 Line settings ..........19 Appendix C - Using Telebit 4.5 Exit Pcomm .............20 Modems ..................39 4.6 Unix gateway ...........20 5 UTILITY FUNCTIONS ..........21 5.1 Program info ...........21 5.2 Setup screen ...........21 5.3 Change directory .......21 5.4 Clear screen ...........21 5.5 Toggle duplex ..........21 5.6 Hang up the phone ......22 5.7 Printer logging ........22 5.8 Toggle CR - CR/LF ......22 5.9 Break ..................22 Pcomm Reference Manual Page 1 1. INTRODUCTION Pcomm is a public domain, menu driven, telecommunication program designed to provide the same "ease of use" as similar programs available in MSDOS. Some of its features are: o Large dialing directory o Auto-login shell scripts o Automatic redial feature o Supports popular file transfer protocols o External file transfer program support o Data logging (log of the terminal session) o Printer logging o Screen dump o Shell escapes o Help screen o Keyboard macros o User customization o Administrative logging of phone calls o Administrative limits on long distance access Pcomm does not emulate any particular terminal. Whatever terminal you're on, is what the remote system "sees". 1.1. Abbreviations Pcomm uses the notation "^A-X" to mean control-A followed by the letter X. The dash (-) in the notation is just for clarity; it is not included in the actual command sequence. Also, there is no distinction between upper and lower case letters. The following abbreviations appear in Pcomm: carriage return key (sometimes labeled Enter) escape key space bar del key up arrow key down arrow key LF line feed character (control-J) CR carriage return character (control-M) 1.2. Requirements Pcomm will not run on terminals with a screen size of less than 80 columns by 24 lines or on terminals that lack cursor movement capabilities. For terminals without arrow keys, use the letter "U" in place of "up arrow" and the letter "N" in place of "down Page 2 Pcomm Reference Manual arrow" (the letter "D" would have been a more obvious choice, but, unfortunately, it is used elsewhere). 1.3. Support files Pcomm uses four support files, namely: pcomm.dial_dir the dialing directory pcomm.extrnl the external file transfer programs pcomm.modem the modem/TTY database pcomm.param the start-up default parameters There is a default directory (typically "/usr/local/lib/pcomm") where the "standard" support files live. Since the average user won't have write permission on these files, it's assumed that they will copy one or more of these standard files to their own directories and edit them to suit their needs. Pcomm can use the environmental variable "PCOMM" to search for these "private" support files. If used, the variable must contain the path to the directory containing the files. You can "mix and match" the use of standard and private support files. For example, the pcomm.modem file is rarely changed by the user so there would be no need to copy that file to the private directory. Pcomm also uses normal Unix shell scripts to perform the "chat" sequences necessary to automatically log a user onto a system. The following directories are searched to find the support files and the auto-login shell scripts: 1) directory given with the "-d" option 2) directory in the PCOMM environmental variable 3) the current working directory 4) the default directory (compiled into Pcomm) Pcomm Reference Manual Page 3 2. RUNNING PCOMM Pcomm has the following command line syntax. pcomm [-d directory] [-f system name] The "-d" option allows you to specify an additional path to be used when searching for the Pcomm support files. This option is often useful for "borrowing" someone else's dialing directory. The "-f" option is used to specify automatic dialing of an entry in the dialing directory. The name field in the dialing directory (described later) is checked against the string given on the command line. If a match is found, that entry is automatically dialed. The match does not consider upper and lower case differences. 2.1. Hot key Pcomm uses a "hot key" to precede each command. (The value of the hot key is a user tunable parameter, but for the purpose of this document we'll assume the hot key is defined as control-A). The hot key is used to put Pcomm in the command mode. For example, to get the help screen, you type control-A (to get to the command mode) then the number 0 (to display the help screen). When a command is completed, Pcomm returns to the terminal mode. NOTE: While in the command mode, the communication with the remote system is temporarily suspended. 2.2. Status line Whenever Pcomm is in the command mode (or is not currently connected to a remote) a status line is displayed at the bottom of the screen. A typical status line might look like this: +-----------+---------+------+-----------+----------+----------+------+------+ | ^A-0 HELP | No TTY | FDX | 1200 E71 | LOG OFF | PTR OFF | CR | CR | +-----------+---------+------+-----------+----------+----------+------+------+ The eight fields of the status line are: o help screen command (or a temporary message) o name of the TTY device in use o duplex mode (FDX = full duplex, HDX = half duplex) o current line settings o status of data logging option o status of printer logging option o incoming CR translation o outgoing CR translation Page 4 Pcomm Reference Manual 2.3. Help screen The help screen gives a brief review of all the available commands. To access the help screen type ^A and "0" (zero). The typical help screen will look like this: +------------------------------------------------------------------------------+ | | | P C O M M H E L P | | | +------------------------------------------------------------------------------+ | | | Major Functions Utility Functions File Functions | | | | Dialing Directory. ^A-D Program Info .... ^A-I Send Files .... ^A- | | Auto Redial ...... ^A-R Setup Screen .... ^A-S Receive Files . ^A-| | Keyboard Macros .. ^A-M Change Directory. ^A-B Pass Thru Mode. ^A-T | | Line Settings .... ^A-P Clear Screen .... ^A-C Directory ..... ^A-F | | Exit Pcomm ....... ^A-X Toggle Duplex ... ^A-E Screen Dump ... ^A-G | | Unix Gateway ..... ^A-4 Hang Up Phone ... ^A-H Start Data Log. ^A-1 | | Printer On/Off .. ^A-L Toggle Log .... ^A-2 | | Toggle CR-CR/LF . ^A-3 | | Break Key ....... ^A-7 | | | +-------------------------- Press any key to continue -------------------------+ 2.4. Exit Pcomm To exit Pcomm, you type ^A and "x" to access the exit window. +--- Exit ----------------------+ | | | Exit to Unix? (y/n): _ | | | +-------------------------------+ To exit, you press the letter "y" (carriage return not required). Pcomm Reference Manual Page 5 3. SETUP SCREENS Pcomm allows you to change many of the default parameters. The setup screen is accessed by typing ^A and "s". The following screen shows the sub-menu choices: ------------------------- Setup Menu ---------------------------- 1) TTY Setup 2) Modem Setup 3) Terminal Setup 4) General Setup 5) ASCII Transfer Setup 6) External Protocol Setup S) Save setup to disk ----------------------------------------------------------------- OPTION ==> _ Press to exit To select one of the sub-menu choices, you type the number (or letter) at the "OPTION ==>" prompt. To exit from a sub-menu and return to this setup menu screen, you press the escape key. Changes made affect the current Pcomm session only. To make the changes become the default, you select the "s" option. 3.1. Prompting There are several different types of prompts used in the setup screens. The prompts use the bottom two lines on the display for user input and to give more information on what is being asked. Pcomm will beep at any illegal input. The escape key will abort any prompt. The prompt types are: o Character prompt. Asks you to input a single character. o String prompt. Asks you to input a word or group of characters. o Numeric prompt. Asks you for a number. o Menu prompt. Shows a selection and allows you to choose the current selection by pressing the carriage return or change the selection by pressing the space bar. 3.2. TTY setup The TTY setup allows you to assign the serial ports that Pcomm is allowed to use, and what is attached to each port. A typical TTY setup screen might look like this: Page 6 Pcomm Reference Manual -------------------------- TTY Setup ---------------------------- TTY name Modem name Init speed 1) tty10 HAYES 0 2) tty11 HAYES 0 3) tty12 DIRECT 0 4) tty13 TELEBIT 19200 5) tty13 FAST_TELEBIT 19200 6) 0 7) 0 8) 0 9) 0 10) 0 A) Add a TTY entry D) Delete a TTY entry ----------------------------------------------------------------- OPTION ==> _ Press to return You may edit an entry by typing the entry number at the prompt. To add an entry, you type "A" at the prompt, etc. The TTY setup fields are: 1) TTY name. This is the name of the serial port that Pcomm will be allowed to use. Notice that the path component of the name, "/dev/" is not used. 2) Modem name. This a key word that is used later to link the modem database with the TTY database. The name could be any combination of letters or numbers (both upper and lower case). NOTE: All hard-wired ports (ports without modems attached) must use the word "DIRECT" for the modem name. 3) Init speed. Normally Pcomm will initialize the modem at the baud rate in the dialing directory. If the init speed is non-zero, the initialization string is always sent at the specified baud rate. The baud rate is selected from a "menu prompt". See Appendix C for more information about the use of this feature. NOTE: It is often best to put the fastest modem/TTYs at the end of the TTY database. 3.3. Modem setup The modem setup contains the commands to make the modem dial, hang up the phone, etc. A typical modem setup screen might look Pcomm Reference Manual Page 7 like this: -------------------------- Modem Setup -------------------------- 1) Modem name (1 of 4) ... HAYES 2) Modem init string ..... ATS7=45S11=70E0Q0V1X4&D2! 3) Dialing command ....... ATDT 4) Dialing cmd suffix .... ! 5) Hang up string ........ ~~+++~~ATH0! 6) Auto baud detect ...... Y 7) 300 baud connect ...... CONNECT! 8) 1200 baud connect ..... CONNECT 1200 9) 2400 baud connect ..... CONNECT 2400 10) 4800 baud connect ..... 11) 9600 baud connect ..... 12) 19200 baud connect .... 13) No connect string 1 ... BUSY 14) No connect string 2 ... VOICE 15) No connect string 3 ... NO CARRIER 16) No connect string 4 ... ----------------------------------------------------------------- OPTION ==> _ Press to return The fields of the modem setup are: 1) Modem name. This is the key word that links the modem database with the TTY database. A menu prompt is used to select the modem name (and the remaining parameters that go with it). The "(1 of 4)" field indicates there are additional modems in the database. 2) Modem initialization string. This is sent to the modem whenever the port is selected. Consult your modem manual for the codes to be used. Notice the use of the "!" character. This is the "character synonym" for the carriage return. NOTE: See section 3.5 for the complete list of character synonyms. To remove the special meaning of a character synonym, you must prepend a "\" to the character. 3) Dialing command. The first part of the command to make the modem dial. It is assumed that the phone number will immediately follow. 4) Dialing command suffix. The last part of the command to make the modem dial. Typically this will be the carriage return "character synonym". 5) Hang up string. The command to make the modem hang up the phone. The character synonym for a 1 second pause is Page 8 Pcomm Reference Manual the tilde "~" character. 6) Auto baud detect. Should Pcomm attempt to change the baud rate of the TTY to the baud rate matching the connect string? This feature requires the connect strings to be unique. 7-12) Connect strings. The return messages when the modem has connected to the remote. If different messages are returned for each baud rate at which the modem answers, then they should be specified. NOTE: Pcomm uses the connect strings to determine which baud rates the modem is capable of supporting. For example, if the 4800 baud connect string is empty, Pcomm assumes the modem can not support 4800 baud. NOTE: If two connect strings are very similar, (for example, "CONNECT" is entirely contained in "CONNECT 1200"), it is possible that the return code from the modem will match the incorrect string. To prevent this from happening, use the command synonym for the carriage return to terminate the shorter string (for example, use "CONNECT!" instead of "CONNECT"). 13-16) No connect strings. The messages returned by the modem when no connection is made. 3.4. Terminal setup The terminal setup allows you to define the hot key and the mapping of the end-of-line characters. A typical terminal setup menu will look like this: ---------------------- Terminal Setup --------------------------- 1) Hot key (decimal) ...... 1 2) ASCII version of hot ... ^A 3) Duplex ................. FULL 4) Flow control ........... XON/XOFF 5) CR translation (in) .... CR 6) CR translation (out) ... CR ----------------------------------------------------------------- OPTION ==> _ Press to return The fields in the terminal setup are: 1) Hot key. This is the decimal code for the user definable hot key. Consult an ASCII/decimal conversion chart for the decimal values of other characters. Pcomm Reference Manual Page 9 2) ASCII version of hot key. This is the printable version of the hot key used by Pcomm in the help screen and status line. 3) Duplex. A menu prompt is shown to select between FULL duplex and HALF duplex. In the half duplex mode, characters sent to the remote system are also sent to the screen. (The duplex mode can also be changed "on the fly" by the ^A-E command.) 4) Flow control. A menu prompt is shown to select between XON/XOFF flow control and NONE. Pcomm often temporarily disables flow control during file transfers. NOTE: If your terminal gets "stuck" due to a flow control problem, any ^A (hot key) sequence will resume the flow. 5-6) CR translations. The end-of-line characters for both incoming and outgoing carriage returns can be altered to suit the remote system's needs. A menu prompt provides the following choices: o CR (no translation) o CR/LF translate CR to CR/LF The incoming CR translation can also be changed "on the fly" with the ^A-3 command. 3.5. General setup The general setup allows you to define the character synonyms and the default files used by the screen dump and other features. A typical general setup screen might look like this: Page 10 Pcomm Reference Manual ------------------------- General Setup ------------------------- 1) Default log file ....... pcomm.log 2) Screen dump file ....... pcomm.dump 3) Strip high bit ........ YES 4) Pause character ........ ~ 5) CR character ........... ! 6) CTRL character ......... ^ 7) ESC character .......... | 8) Break character ........ % 9) Aborted downloads ...... KEEP 10) Connect delay (sec) .... 35 11) Redial delay (sec) ..... 5 ----------------------------------------------------------------- OPTION ==> _ Press to return The general setup fields are: 1) Default log file. The file name to be used as the default when the data logging is activated (^A-1). The log file name can be changed "on the fly" by the ^A-1 command. 2) Screen dump file. The file name to be used for the screen dump command (^A-G). 3) Strip high bit. Should Pcomm strip the eighth bit on incoming and outgoing characters? A menu prompt allows you to select YES or NO. This feature is not used during file transfers. 4-8) Character synonyms. These are symbols that Pcomm uses to represent special characters (or perform special functions) when sending commands to the modem. Synonyms are useful for entering and displaying special characters in a human readable form. The synonyms are: o Pause for 1 second o The carriage return character (control-M) o Convert the next character to control-xx o The escape character (control-[) o Send a modem break NOTE: To prevent the special meaning of one of these characters prepend a "\" to it. 9) Aborted downloads. When a download aborts (fails), should the partially completed file be kept? The menu Pcomm Reference Manual Page 11 prompt allows "KEEP" or "DELETE". 10) Connect delay. The number of seconds Pcomm will wait for the modem to return a status code. 11) Redial delay. The number of seconds to wait before Pcomm tries to call the number again. 3.6. ASCII transfer setup This setup screen allows you to select options to be used for ASCII uploads and downloads. A typical ASCII transfer setup will look like this: ---------------------- ASCII Transfer Setup --------------------- ASCII UPLOAD 1) Echo locally ........... NO 2) Expand blank lines ..... NO 3) CR delay (ms) .......... 0 4) Pace the output ........ NO 5) CR translation ......... NONE 6) LF translation ......... ADD CR ASCII DOWNLOAD 7) Transfer timeout (sec) . 5 8) CR translation ......... STRIP 9) LF translation ......... NONE ----------------------------------------------------------------- OPTION ==> _ Press to return The fields are: 1) Echo locally. This is similar to the duplex option in that it copies outgoing characters to the screen. The options are YES and NO. 2) Expand blank lines. Should a blank line (LF alone) be expanded to a space and LF? Some BBS systems use a blank line to signal the end of an ASCII upload. The options are YES and NO. 3) CR delay. The delay in milliseconds to be used when sending a CR. The menu prompt limits the choice to 0, 100, or 150. 4) Pace output. Should each character sent be delayed? Very old BBS systems may require this. The choice is YES or NO. Page 12 Pcomm Reference Manual 5) CR translation. The menu prompt provides the following choices for upload translations: o NONE (no translation) o ADD LF translate CR to CR/LF o STRIP remove the CR character 6) LF translation. Same as above except the choices are: o NONE (no translation) o ADD CR translate LF to CR/LF o STRIP remove the LF character 7) Transfer timeout. The number of seconds to be used to determine the end of an ASCII download. You can halt the transfer before the timer goes off by hitting the key. 8-9) Same as 5) and 6) above, except the translations apply to ASCII downloading. 3.7. External protocol setup This setup screen allows you to embed the name of external file transfer programs into the list of available protocols. When transferring files, the external program name will appear on the list of options along with the built-in protocols. -------------------- External Protocol Setup -------------------- UPLOAD Name Command Line Requires file list? 1) zmodem sz Y 2) N 3) N DOWNLOAD Name Command Line Requires file list? 4) zmodem rz N 5) N 6) N ----------------------------------------------------------------- OPTION ==> _ Press to return To change a line (or add a new one), enter the line number at the prompt. You will be prompted for the Name, the Command Line, and the "Requires file list?" flag. To remove an entry, enter a single space character at the Name prompt. Pcomm Reference Manual Page 13 The Command Line is the Unix command that you would normally type in to invoke the program (minus the names of the files to be transferred). The last field in the setup is used to indicate whether or not Pcomm should prompt for a list of file names to be added to the command. NOTE: Pcomm adds a single space character and the file names (if any) to the end of the command. NOTE: The program itself isn't "embedded" into Pcomm (it still gets called like any other external program), only the name and invocation information is actually incorporated into Pcomm. Page 14 Pcomm Reference Manual Pcomm Reference Manual Page 15 4. MAJOR FUNCTIONS When Pcomm is invoked without the "-f" command line option, you're placed in the terminal mode with a blank screen and a status line. However, since Pcomm hasn't yet selected a serial port to use, characters typed at the blank screen are ignored. Normally the first command you'll use is ^A-D to bring up the dialing directory menu. 4.1. Dialing directory To dial another system, you type ^A-D to access the dialing directory menu, then enter the entry number at the prompt. The entry number could be preceded by a special long distance dialing code such as "#5" in lieu of "5" alone. Long distance codes could contain access numbers such as those that MCI and Sprint require. A typical dialing directory will look like this: +---------------------------------------------------------------------------+ | | | D I A L I N G D I R E C T O R Y | | | +---------------------------------------------------------------------------+ | | | Name Number Baud P D S Dpx Script/TTY | | 1- Abbey Road 1 (512) 590-6036 2400-N-8-1 F | | 2- Tel-Med-Com 555-8686 9600-E-7-1 F | | 3- C Board 1 (619) 722-8724 2400-N-8-1 F | | 4- Crest 1 (213) 471-2518 2400-N-8-1 F Sample | | 5- Last Chance 1 (219) 762-8411 2400-E-7-1 F | | 6- Killer 1 (214) 827-1994 1200-E-7-1 F | | 7- System A (direct) 19200-N-8-1 F tty12 | | 8- 1200-E-7-1 F | | 9- 1200-E-7-1 F | | 10- 1200-E-7-1 F | | | | ==> _ R Revise M Manual Dialing Entry to Dial | | P LD Codes D Delete Entry Scroll Down | | / Page L Print Entries Exit | | | | LD Codes Active: @ # | | | +---------------------------------------------------------------------------+ The fields of the dialing directory are: Page 16 Pcomm Reference Manual Name) The name of the remote system. Number) The telephone number to the remote system. NOTE: The "(", ")", "-", and space characters are just for looks, and don't get sent to the modem. To prevent the stripping of one of these characters, prepend a "\" to it. Line settings) The communications settings to be used when dialing that entry. The range of values are: Baud Parity Data bits Stop bits ________________________________________ 300 N - none 7 1 1200 E - even 8 2 2400 O - odd 4800 9600 19200 Duplex) The duplex mode. Either "F" for full or "H" for half. Script/TTY) The name of the shell script to be used as a auto-login "chat" sequence. This field is also used to specify a particular TTY for the entry. NOTE: On all hard-wired ports, the script field is used to contain the name of the port. For example, if tty12 is a hard-wired port to "System A", then the dialing directory entry for "System A" will have "tty12" in the script field. The commands at the dialing directory prompt are: R) Revise (or add) a dialing directory entry or long distance dialing code. Prompts you to save the changes to disk. A typical revise screen would look like this: +----------------------------------------------------------+ | | | Entry to revise? _ (Entry Number, +,-,@,#) | | | +----------------------------------------------------------+ If a dialing directory entry is selected, each field of the entry is shown with its current settings. You can enter a Pcomm Reference Manual Page 17 new value, press a carriage return to skip past a field, or enter a single space character to erase a field. An at any field will abort the command. P) Print (display) the long distance dialing codes. /) Scroll the dialing directory up or down 10 lines. Use the up and down arrow keys to access this feature. M) Manual dial. Prompts you for a phone number rather than using a number already in the dialing directory. D) Delete an entry or a range of entries. Prompts you to save the changes to disk. L) Print. Send the dialing directory to the printer or a file of your choice. 1-100) Entry number. Dial the phone for that entry number. If the script field contains the name of a valid Unix shell script, that script is "played" after the connection is made to perform the auto-login "chat" sequences. See section 8 of this manual for more details on the format and use of auto-login shell scripts. NOTE: To access the port directly without dialing (perhaps to send the dial codes yourself), select an empty entry or enter a single space character at the phone number prompt of the manual dial option. Carriage return. Scroll the dialing directory down one line. 4.2. Redial The redial feature is a misnomer; it really is a queuing system that allows Pcomm to dial several numbers in a cycle until one of them answers. When you invoke the redial command with ^A-R, you're prompted for a list of dialing directory numbers. (You may also prepend a long distance code to the entry number). Page 18 Pcomm Reference Manual +--- Redial Queue ----------------------------------------------+ | | | Directory Entry Number(s): _ | | | | ( for previous numbers) | +---------------------------------------------------------------+ To redial the previous number, press a carriage return alone at the prompt. An aborts this command. 4.3. Keyboard macros Keyboard macros are used as a shortcut to send commonly used strings to the remote system with only a few keystrokes. The characters used to identify the macros are the shifted number keys. For example, if the string "ls -alRF | more!" was assigned to the "!" key (the shifted number 1 key), then when you press ^A-!, the string "ls -alRF | more" is sent to the remote (followed by a because of the "!" character synonym). To review or edit the keyboard macros, you type ^A-M. The following screen will appear: +-------------------------------------------------------+ | Keyboard Macros | | | +-------------------------------------------------------+ | | | ^A-! ls -alRF | more! | | ^A-@ | | ^A-# | | ^A-$ | | ^A-% | | ^A-^ | | ^A-& | | ^A-* | | ^A-( | | ^A-) | | | | Macro key to revise: _ | | | +--------------- Press to continue ---------------+ Pcomm Reference Manual Page 19 To edit a macro, you type the macro key character (without the leading hot key). After typing the new string information, you will be prompted to save the changes to disk. To erase an entry enter a single space character. NOTE: All of the character synonyms described in section 3.5 are available for use with the keyboard macros. 4.4. Line settings The line settings menu is invoked by ^A-P. A typical line settings menu will look like this: +------------------------------------------------+ | Line Settings | +------------------------------------------------+ | | | Current Settings: 1200,E,7,1 | | | | 1) 300,E,7,1 7) 300,N,8,1 | | 2) 1200,E,7,1 8) 1200,N,8,1 | | 3) 2400,E,7,1 9) 2400,N,8,1 | | 4) 4800,E,7,1 10) 4800,N,8,1 | | 5) 9600,E,7,1 11) 9600,N,8,1 | | 6) 19200,E,7,1 12) 19200,N,8,1 | | | | Parity Data Bits Stop Bits | | 13) Odd 14) 7 bits 16) 1 bit | | 15) 8 bits 17) 2 bits | | | | 18) Save Changes YOUR CHOICE: _ | | | +------------- Press to return ------------+ While dialing a remote, the line settings in the dialing directory entry are automatically used. Therefore the line settings menu is used to fine tune the values during a terminal session or to select the parameters for manual dialing. You can make the current setting the default by selecting the "Save Changes" option. The current line settings are also displayed in the status line. NOTE: During file transfers, certain parameters (namely the data bits and parity) will be temporarily changed. The status line will not reflect these temporary promotions. Page 20 Pcomm Reference Manual 4.5. Exit Pcomm To exit Pcomm, you type ^A-X. The phone is hung up (if a call was in progress), the print and data logging features are closed, and the TTY resources are released. NOTE: Pcomm drops the DTR (Data Terminal Ready) on the port before exiting to Unix. 4.6. Unix gateway To temporarily suspend Pcomm and spawn a Unix shell, you type ^A-4. To return to Pcomm, you exit the shell normally, typically with ^D or "exit". NOTE: The SHELL environmental variable is used to determine which program to invoke. Pcomm Reference Manual Page 21 5. UTILITY FUNCTIONS The following commands perform secondary functions. 5.1. Program information To display the opening information screen, you type ^A-I. Press any key to return to the terminal mode. 5.2. Setup screen The setup screens are described in detail in section 3 of this manual. 5.3. Change directory To change the current working directory while still inside Pcomm, you type ^A-B. A screen similar to the following will appear: +--- Change directory ------------------------------------------+ | | | Current directory: /usr/egray | | New directory: _ | | | +---------------------------------------------------------------+ Abbreviations known to the shell are acceptable; for example, the "~" character will be translated to the home directory in the csh or ksh shell. 5.4. Clear screen To clear the local screen and home the cursor, you type ^A-C. NOTE: The remote system may not "know" the screen has been cleared, and may make assumptions about the screen that are incorrect. 5.5. Toggle duplex The ^A-E command changes the duplex mode from FULL to HALF, or from HALF to FULL. The status line shows the current duplex mode. Use the Terminal Setup to make permanent changes to the duplex mode. Page 22 Pcomm Reference Manual 5.6. Hang up the phone To hang up the phone, you type ^A-H. The word "disconnecting" will briefly show in the status line. NOTE: Pcomm does not drop the DTR (Data Terminal Ready) during the hang up. 5.7. Printer logging The ^A-L command toggles the printer logging on or off. The current printer status is displayed in the status line. NOTE: Since all printing goes to the normal Unix print spool program, the characters will not print on the printer as they appear on the screen. The printing will actually begin when the printer logging is turned off and the complete print job is sent to the spool. NOTE: Due to a technical limitation of Pcomm, characters typed while in the half duplex mode will not appear in the print log. 5.8. Toggle CR - CR/LF The ^A-3 command toggles the incoming line termination characters between CR and CR/LF. The status line shows the current settings (in the next to the last field). 5.9. Break The ^A-7 command sends a modem break to the remote system. The word "break" is (very) briefly displayed on the status line. NOTE: This not the same as the break key on the keyboard (we don't want to send a break to the local system, we want to send it to the remote). Pcomm Reference Manual Page 23 6. FILE FUNCTIONS One of the most important features of a telecommunication program is the ability to transfer files. The following file transfer protocols are implemented: Protocol Packet Error Multiple name size detection files? _______________________________________________ xmodem 128 checksum/CRC no xmodem-1k 128/1024 checksum/CRC no modem7 128 checksum yes 1 ymodem 128/1024 CRC yes 2 ymodem-g 128/1024 none 3 yes ASCII none none no zmodem 4 128/1024 CRC yes (external) ? ? ? Notes: 1 CP/M style file name 2 MSDOS style file name and file size 3 Not needed! 4 zmodem is implemented as an external program NOTE: The built-in protocols that send file name information, convert the Unix style file name to fit the MSDOS name restrictions. 6.1. External protocols The external "protocol" is really a method of running an external program from Pcomm to accomplish a file transfer. The most common use of this feature would be to run Kermit or some proprietary program. Frequently used external file transfer programs (such as zmodem) can have their names embedded into the list of available protocols by using the External Protocol Setup in section 3.7. To abort an external file transfer, you hit the key. All other characters typed at the keyboard are ignored. NOTE: The external protocol feature can also be used (misused?) to pipe the output of a Unix command to the remote. 6.2. Send files To send a file to the remote, you'll first have to instruct the remote system to receive the file, then type ^A-"up arrow". The Page 24 Pcomm Reference Manual following screen will appear: +----- upload ----+ | | | 1) xmodem | | 2) xmodem-1k | | 3) modem7 | | 4) ymodem | | 5) ymodem-g | | 6) ASCII | | 7) zmodem | | E) (external) | | | | to Abort | | | | Protocol: _ | | | +-----------------+ You then select the type of protocol at the prompt, and another window similar to this will appear: +--- Send xmodem -----------------------------------------------+ | | | Enter filename: _ | | | +---------------------------------------------------------------+ Now you type in the file name or names you'd like to send. Wildcards known to the shell are acceptable. Now the file transfer actually begins. A screen similar to the following is displayed during the transfer: Pcomm Reference Manual Page 25 +-------------- uploading -------------+ | | | Protocol: xmodem | | File name: main.c | | File size: 4420 | | Error check method: CRC | | Est transfer time: 0:00:50 | | Block count: 5 | | Percent complete: 11.2% | | Bytes transferred: 640 | | Errors this block: 0 | | Total error count: 0 | | Last message: NONE | | | +-------- Press to abort --------+ As the transfer progresses, the "block count", "percent complete", and "bytes transferred" fields will be continuously updated. If errors occur the "errors this block" and "total error count" fields will be updated and the "last message" field will contain a message about the error. At the end of the transfer, Pcomm will beep and return to the terminal mode. If an error occurred and the transfer was aborted, you will be prompted to acknowledge the error by pressing a key before returning to the terminal mode. 6.3. Receive files To receive a file (or group of files) from a remote system, you'll have to first instruct the remote system, then type ^A- "down arrow". Receiving a file is basically the same as sending a file. NOTE: Some systems do not pad the end of the file with control- Z's and therefore files might grow in length when received. NOTE: Due to a technical limitation of Pcomm, characters received during an ASCII download will not reappear on the screen when you return to the terminal mode. 6.4. Pass thru mode The pass through mode is used when you have two or more machines in a communications daisy chain. The following diagram shows an example of this type of arrangement: +---------+ +----------+ +----------+ | IBM PC | | Unix | | IBM PC | | running | <---- | running | <---- | running | | ProComm | ----> | Pcomm | ----> | RBBS | +---------+ +----------+ +----------+ Page 26 Pcomm Reference Manual If a file is to be transferred from the last machine to the first machine, the middle machine must appear completely transparent. The middle machine must "forward the data" without altering it in any way. The pass through mode "expires" after a designated period of inactivity, after which the user is returned to the terminal mode. To access the pass through mode, you type ^A-T. The following screen will appear: +--- Pass Thru Mode --------------------------------------------+ | | | Enter the expiration time (5-60 sec) : _ | | | +---------------------------------------------------------------+ NOTE: While in the pass through mode, no Pcomm command to the middle machine will be honored. Therefore, the only way to exit this mode is to not type anything on the keyboard until the expiration period has elapsed. NOTE: The baud rates to and from the middle machine need not be the same, however the slowest speed determines the overall speed of the transfer (the weakest link in the chain). 6.5. Directory To obtain a listing of a directory on the local system while still running Pcomm, you type ^A-F. The following screen will appear: +--- List Directory --------------------------------------------+ | | | Current directory: /usr/egray | | File spec (wildcards allowed): _ | | | +---------------------------------------------------------------+ Abbreviations known to the shell are valid. Output is sent through a "more" like program. NOTE: Since we're really doing a popen() to the "ls" command, additional command line options are also valid. Pcomm Reference Manual Page 27 6.6. Screen dump To dump the contents of the current screen (minus any windows showing) you type ^A-G. The contents of the screen are written to the file specified in the general setup for this purpose. If the file already exists, the screen contents are appended to the file. The message "screen dump" will briefly appear in the status line. NOTE: The screen contents are subject to the available VCS (video command sequence) emulation, so an exact representation is not guaranteed. 6.7. Start data logging To start the data logging, or change the file used for data logging, you type ^A-1. The following screen will appear: +--- Start Data Logging ----------------------------------------+ | | | Default log file: pcomm.log | | New log file: _ | | | +---------------------------------------------------------------+ To keep the default file, just press a carriage return at the prompt, otherwise, enter a new file name. If the file already exits, the new data is appended to the file. The status of the logging is shown in the status line. NOTE: Due to a technical limitation of Pcomm, characters typed while in the half duplex mode will not appear in the log file. 6.8. Toggle logging To temporarily suspend data logging or to start it again without being prompted for the file name, you type ^A-2. Page 28 Pcomm Reference Manual Pcomm Reference Manual Page 29 7. DIALING WINDOW While Pcomm is dialing another system, a screen similar to the following is shown: +--------------------------------------------------------------------+ | | | D I A L I N G W I N D O W | | | +--------------------------------------------------------------------+ | | | System name: C Board | | Pass number: 1 | | Elapse time this try: 4 | | Time at start of dial: 14:53:36 | | Time at start of this try: 14:53:37 | | Connect delay time: 35 | | Redial delay time: 5 | | Script/TTY: | | Result of last try: | | | | : Recycle : Remove from queue E: Change delays | | | +----------------------- Press to abort -----------------------+ The options available during the dialing window are: SPACE) Press the space bar to stop the dialing of the current entry and go on to the next entry in the queue. If there is only one entry in the queue, that number is redialed. DEL) Press the DEL key to remove the current number from the queue. E) Press the letter "E" to change the connect delay time, or the redial delay time (the pause between dialing attempts). You will be prompted to save the changes to disk. NOTE: While the DEL and E options are being processed, the dialing is temporarily suspended. Page 30 Pcomm Reference Manual Pcomm Reference Manual Page 31 8. AUTO-LOGIN SCRIPTS Pcomm doesn't have a built-in script language, instead it uses Unix shell scripts (Bourne shell, C shell, or Korn shell) to perform the necessary "chat" sequences to log a user on to a remote system. Since shell scripts are run "outside" of Pcomm, they cannot contain Pcomm commands. For example, an auto-login script cannot dial a phone number or turn on the data logging feature. The auto-login scripts are run after the connection to the remote system has been made. You may hit the key at any time to abort an auto-login script before it has completed. All other characters typed at the keyboard are ignored. WARNING: Any file that has a "clear text" (un-encrypted) version of your password is a significant security threat. You should remove the read permission to all others. In order to assist in the creation of auto-login scripts, the following external programs have been provided. 8.1. Waitfor command The waitfor command has the following syntax: waitfor -n string where "n" is the number of seconds to wait and "string" is the string to wait for. Waitfor returns a 0 if the string was found, a 1 if it didn't find the string within the allotted time, and a -1 if there was an error. Waitfor returns immediately if the string is found. The waitfor command would typically be used in a script to indicate that the desired prompt has appeared. For example: waitfor -5 "ogin:" if [ "$?" -eq 0 ] then echo "egray" fi would wait up to 5 seconds for the string "ogin:". If the return code is 0 (the strings did appear), send the string "egray" (my user ID). Page 32 Pcomm Reference Manual NOTE: Upper and lower case letters are considered different. If you are not sure if the prompt is "Login:" or "login:", then skip the first letter in the string and use "ogin:". 8.2. Matches command The matches command has the following syntax: matches string1 string2 Matches returns a 0 if string2 is contained in string1, and returns a 1 if it does not. Unlike waitfor, the matches command does not read the TTY port. The matches command could be used to test string values such as: read junk matches $junk "login failed" if [ "$?" -eq 0 ] then exit fi 8.3. Modem_break command The modem_break command performs a modem break on the TTY. It would often be used to tell the remote system to switch to another baud rate. The modem_break program has no command line arguments. 8.4. Examples It is not my intention to teach the reader the fundamentals of Unix shell programming. There are several good books on the subject available in stores. Remember to add execute permission to the file and remove the read permission to all others. The simplest auto-login script may contain the following: Pcomm Reference Manual Page 33 # send a echo "" # wait 5 seconds for the login prompt waitfor -5 ogin: # send my user ID echo "egray" # wait 5 seconds for the password prompt waitfor -5 assword: # send my password echo "abcdefg" # return to Pcomm exit 0 A more complex script is required if the user must send a modem break to synchronize the baud rate of the remote. For example: Page 34 Pcomm Reference Manual echo "" try=0 # loop until done while true do # wait 5 seconds for the login prompt waitfor -5 ogin: # test the exit code of the waitfor command if [ "$?" -eq 0 ] then # send my user ID and exit the loop echo "egray" break fi # increment the number of attempts try=`expr $try + 1` # test to see if we should give up if [ "$try" -eq 5 ] then exit 1 fi # send a modem break and loop again modem_break echo "" done # wait 5 seconds for the password prompt waitfor -5 assword: # test the return code from waitfor if [ "$?" -eq 0 ] then # send my password echo "abcdefg" else exit 1 fi # return to Pcomm exit 0 Pcomm Reference Manual Page 35 Appendix A - Typical Modem Configuration I can't begin to describe how to configure every modem to work with Pcomm. There are, however, several guidelines that will apply to virtually any modem. 1) Pcomm doesn't care about the DCD (Data Carrier Detect) settings of the modem. 2) It would be nice (but not essential) if the loss of the DTR (Data Terminal Ready) caused the modem to hang up. 3) Pcomm doesn't care if commands are echoed back by the modem (it might save a few milliseconds if echoing was turned off). 4) Some sort of result codes are required. Numeric result codes are ok... but since they are displayed on the screen, word result codes will make more sense. 5) If the modem can return different result codes for each baud rate at which it answers, then by all means, use them. 6) Anything that is returned by the modem, but not listed in the modem setup, is ignored. 7) Systems running uugetty (the bi-directional version of getty that comes with HDB uucp) should include extra commands in the initialization string to assure that uugetty switches to its dial out mode. Normally, "AT!~AT!~" causes enough dialogue to force uugetty to release the line. For example, a 2400 baud Hayes compatible modem might be configured with the following command: AT S7=45 S11=70 E0 Q0 V1 X4 &D2 AT Hayes attention command S7=45 Wait 45 seconds for an answer S11=70 70 ms touch tone dialing E0 Don't echo commands (not essential) Q0 Turn result codes on V1 Return word result codes X4 Use as many result codes as you've got &D2 Hang up when DTR is lost (nice to have) Page 36 Pcomm Reference Manual Pcomm Reference Manual Page 37 Appendix B - AT&T Unix PC 7300/3b1 Dial Codes The dialing codes used by the OBM (On Board Modem) are not straight-forward. The modem setup, as distributed, looks like this: -------------------------- Modem Setup -------------------------- 1) Modem name (1 of 2) ... OBM 2) Modem init string ..... 3) Dialing command ....... % 4) Dialing cmd suffix .... @ 5) Hang up string ........ 6) Auto baud detect ...... N 7) 300 baud connect ...... CONNECT 8) 1200 baud connect ..... CONNECT 9) 2400 baud connect ..... 10) 4800 baud connect ..... 11) 9600 baud connect ..... 12) 19200 baud connect .... 13) No connect string 1 ... 14) No connect string 2 ... 15) No connect string 3 ... 16) No connect string 4 ... ----------------------------------------------------------------- OPTION ==> _ Press to return The relevant fields of the modem setup are: 1) Modem name. This must be "OBM". NOTE: Pcomm uses the modem name as a flag to determine which dialing method to use. The string "OBM" is a "reserved word" that Pcomm uses to switch to the AT&T Unix PC 7300/3b1 dialing method. 3) Dialing command. This should be "%" for touch tone dialing or "^" for pulse dialing. 4) Dialing cmd suffix. This must be the "@" character. 6) Auto baud detect. The OBM cannot use the auto baud detect feature. 7-8) Connect strings. Although the OBM doesn't actually return any result codes, these fake fields are required. Additional OBM dialing codes from the phone(7) manual: Page 38 Pcomm Reference Manual "~" wait for next dial tone "," pause 2 seconds ":" pause 10 seconds "&" perform a hookflash "%" begin tone dialing "^" begin pulse dialing These codes can be inserted into the phone number string, for example: 555-1234~56 dial 555-1234, wait for tone, dial 56 9,555-1234 dial 9, wait 2 seconds, dial 555-1234 %555^1234 dial 555 using tone, 1234 using pulse NOTE: The dialing codes for the OBM are not subject to character synonym translations, therefore the "%", "^", and "~" characters do NOT have to be preceded by the "\" character to remove their special meaning. Pcomm Reference Manual Page 39 Appendix C - Using Telebit Modems Telebit modems are probably representative of the newer high speed intelligent modems available today and therefore warrant a more detailed discussion. 1) Locked interface speed Telebit modems have the ability to maintain a locked interface speed with the computer without regard to the connected baud rate. For example, most people find it necessary to lock the interface speed at 19200 baud (or 9600) for normal operations. The "init speed" field of the TTY database was created to solve this problem. If this value is non-zero, Pcomm will only use this baud rate when talking to the modem. The true connected baud rate will continue to be displayed in the status line. 2) Multiple setups Users of Telebit modems may require a different "init string" or "dial string" depending on the target baud rate. For example, the init strings for 9600 and 19200 baud may contain the command "S50=255" (wait for the Telebit PEP tones) whereas the slower init strings would contain "S50=0" (automatic speed search). This problem is solved by creating an additional modem entry in the modem database. For example, you could have an entry called "TELEBIT" for baud rates in the range of 300-4800 and another entry called "FAST_TELEBIT" for baud rates in the range of 9600-19200. Pcomm uses the connect strings to determine if the modem can handle the requested baud rate. So, if the "TELEBIT" entry had connect strings for 300, 1200, 2400, and 4800 baud it would be selected only if the requested baud rate was in that range. Likewise, the FAST_TELEBIT would have connect strings only for 9600 and 19200 baud. 3) Telebit register settings The following configuration is what I personally use for my Telebit T2500's on bi-directional lines (ones with uugetty). Page 40 Pcomm Reference Manual ~&F1 restores enhanced command mode settings Q2 turns on result codes only when dialing out S0=1 answer on first ring S7=60 wait at least 60 seconds for a carrier S51=5 set interface speed to 19200 baud S52=1 hangup on loss of DTR S54=3 pass modem breaks through S58=2 full duplex RTS/CTS flow control S66=1 lock the interface speed S131=1 data carrier detect follows the carrier &W0 save in NVM A &W1 save in NVM B 4) Sample TTY database The following is the contents of the sample TTY database: TTY name Modem name Init speed 1) tty10 HAYES 0 2) tty11 HAYES 0 3) tty12 DIRECT 0 4) tty13 TELEBIT 19200 5) tty13 FAST_TELEBIT 19200 Notice that entries 4 and 5 share the same TTY. 5) Sample modem database entry for TELEBIT The third entry in the sample modem database is for the Telebit modem designated for use at slow speeds. Pcomm Reference Manual Page 41 1) Modem name (3 of 4) .... TELEBIT 2) Modem init string ...... ATZ!~~ 3) Dialing command ........ ATDT 4) Dialing cmd suffix ..... ! 5) Hang up string ......... ~~+++~~ATH0! 6) Auto baud detect ....... Y 7) 300 baud connect ....... CONNECT 300 8) 1200 baud connect ...... CONNECT 1200 9) 2400 baud connect ...... CONNECT 2400 10) 4800 baud connect ...... CONNECT 4800 11) 9600 baud connect ...... 12) 19200 baud connect ..... 13) No connect string 1 .... BUSY 14) No connect string 2 .... ERROR 15) No connect string 3 .... NO CARRIER 16) No connect string 4 .... NO DIALTONE 6) Sample modem database entry for FAST_TELEBIT The 4th entry is for the Telebit modem designated for use at higher speeds. 1) Modem name (4 of 4) .... FAST_TELEBIT 2) Modem init string ...... ATZ!~~ATS50=255! 3) Dialing command ........ ATDT 4) Dialing cmd suffix ..... ! 5) Hang up string ......... ~~+++~~ATH0! 6) Auto baud detect ....... Y 7) 300 baud connect ....... 8) 1200 baud connect ...... 9) 2400 baud connect ...... 10) 4800 baud connect ..... 11) 9600 baud connect ..... CONNECT 9600 12) 19200 baud connect .... CONNECT FAST 13) No connect string 1 ... BUSY 14) No connect string 2 ... ERROR 15) No connect string 3 ... NO CARRIER 16) No connect string 4 ... NO DIALTONE