AIX Newsletter ì œ 154 í˜¸
Shared by: t8929128
AIX Newsletter 제 154 호 한국 IBM 팩스 : (02) 781-6515 서울시 영등포구 여의도동 25-11 AIX Newsletter 담당 전화 : (82-2) 781-6961 한진빌딩 15층 우편번호 : 150-010 수신 : RS/6000 담당자 발행내역 제 목 Howto Setup Hayes Compatible Modem on RISC System/6000 담 당 최 진 호 전 화 (82-2) 781-6961 발행날짜 1998년 6월 1일 쪽수 9 HOW TO. Howto Setup Hayes Compatible Modem on RISC System/6000 About This Document The following document provides an overview of how to set up an Asynchronous Modem on a RS/6000. This is applicable to OSLEVEL 3.2.5 or higher. An Overview of Setting Up an Asynchronous Modem The following actions are required: Physically attach the modem Create a tty device on the port Adjust the Devices file on the system Program the modem Test the modem Physically Attaching The Modem Attach a direct (modem) cable between the modem and any open serial port on the RS/6000. Common Options Native serial port on back of RS/6000 8 port adapter attachment 16 port adapter attachment 64 port adapter attachment 128 port adapter RAN Note: Although a modem can be attached to a 16 port adapter it is not recommended. The 16 port adapter had RTS looped back to CTS at the connector (physical RTS and CTS lines DO NOT run between the RS/6000 and the modem as they do in the other options). This renders RTS (hardware) flow control impossible resulting in possible data loss, communication errors, or no connection ability at all. All options require a DIRECT cable but each adapter has different pin-outs and requires a different connector on that direct cable (most modems are db-25 connected but there are some variations on the market). Create A tty On The Chosen Port Special notes: Set flow control to RTS/CTS (HARDWARE): NOT Xon/Xoff (software)flow control. If using 8 wire cable off of a RAN port, set "ALTERNATE RJ-45 to ENABLE". Take note of the baud rate speed, i.e. 9600, it will be needed later. Take note of the tty that 'SMIT' assigns the port, i.e. 'ttyl', it will be needed later. Verify that "ENABLE LOGIN" is set to disable so a getty will NOT be started on the port. Adjusting The Devices File Log in as root. Edit '/etc/uucp/Devices' file using 'vi' or any other file editor. This file has many commented out lines. Append a new line to the bottom of the file. Note: There CANNOT be any spaces or characters before the word "Direct". DO NOT hit "enter", add lines or spaces after "baud direct" when typing the command in the following step. Type the following command: Direct ttyx - baud direct (Where "x" is put the tty number assigned to the port by 'SMIT' and REPLACE "baud" with the speed or the tty you noted when 'SMIT' created the tty. Such as Direct tty1 - 9600 direct) You are now ready to save this file. Programming The Modem Programming a modems register makes it respond accordingly to various conditions. Most modern modems are 'Hayes compatible' so they will accept 'AT' commands to program their registers. To program a modem, type the following on the command line: cu -ml ttyx (x is the number of the modem tty) (Response should be "CONNECTED") at (Response read "OK") at&f (Response should read "OK") at&c1 (Response should read "OK") at&d2 (Response should read "OK") ats0=1 (Response should read "OK") atq2 (Response should read "OK") at&w (Response should read "OK") ~[tilde].[period[ (represents <tilde><period>) After hitting "enter" on the last command, the system will close the connection to the modem and give you a command line prompt. You are ready to test. Testing The Modem Test the modem for dial out operation, type the following at the command line: cu -ml ttyx (x is your tty number) (Response should read "CONNECTED") at (Response should read "OK") In the following command, replace the 0's with whatever phone number you use to dial into another system. Put NO spaces or dashes '-' in the phone number. You may use a ',' for a pause: i.e. 9,11234567890. When you hit "enter" after the phone number, the cursor will go back under the 'a' of 'atdt', and you will not get "OK" from your modem. atdt0000000000 In about 30 sec to 1 min something like the following will appear on your screen: CONNECTED AT 9600 This will scroll up and you will see the login prompt from the called system on your screen. Login in as normal and carry out whatever operation you need to do. Test a modem for dial in operation, type the following at the command line: penable ttyx (x is your tty number) This will start a 'getty' (login prompt) running on the modem tty. Now call the phone number of the line attached to the modem on the RS/6000 and you will get the login herald on your calling computer's screen. Finally, set the tty 'LOGIN ENABLE' to your desired setting (enable, disable, share, delay) permanently, via 'smit'. For help with the "Add/Change/Show a TTY" function see appendix A. The following chart lists the possible setting and their meaning. ENABLE /etc/getty (login herald) running on tty DISABLE no getty running on tty SHARE /etc/getty associated with tty but not run on port until CD goes high (Normally a result of a modem dialup connection occurring) DELAY same condition as SHARE except the herald is not seen on the tty terminal until the "ENTER" key is pressed Problem Determination Cannot 'CU' Out To The Modem The following is a list of responses the RS/6000 may give other than 'CONNECTED' when you enter "cu -ml tty1" on the command line. Note: We will use 'tty1' and a 'baud' of 9600 for our examples in this text. Type the following from the command line: cu -ml tty1 (Response should read "CONNECTED") The message "CONNECTION CLOSED -m flag not valid" may occur on OS levels below 3.2.5. The -m flag tells the RS/6000 to ignore missing CD and open the port. Lower OS levels do not have the '-m flag' option so we will need to use the Dialers file to send the modem the set up string of 'at' commands. Open /etc/uucp/Dialers in "vi" or any other file editor. Go to the bottom of the file and enter this line on a new line by itself: set^^=,-,^^^"" at&c1&d2q1s0=1&w "" (the "^" represent spaces) Save the file. Open /etc/uucp/Devices in "vi" or any other file editor. Rather than a 'Direct' line entry for the tty, enter the following on its own line: ACU tty1 - 9600 set Comment out all other tty entries by putting a pound sign at the front of each line. Save the file. Run the following command: cu -d 123 This will produce 'on-line' debugging and you can see the steps of the cu command on the screen. The command will find the line 'ACU tty1 - 9600 set' in the Devices file. Then it will go to the Dialers file and find the 'set' chat script we entered. You will see on the screen a series of 'expect', 'gotit', 'send them' lines. It then sends the 'at' string to the modem and then hangs because the script was not programmed to dial the bogus phone number 123. In the 'cu' session to get back to the command prompt, type the following command: ~[tilde].[period] The modem has now been programmed. Edit /etc/uucp/Devices file and restore to original condition by typing the following command: cu -ml tty1 The 'cu' command response should be "NO DEVICES AVAILABLE". This means the /etc/uucp/Devices file either does not contain the line, "Direct tty1 - 9600 direct" or the line is there, but it has a typo in it. The line must be exactly as follows: Direct tty1 - 9600 direct ^ ^ ^ ^ (the "^" represent spaces) If the line appears correct, there may be some non-printable typos in it. Delete the line and then add it again as previously outlined by typing: cu -ml tty1 The response will be "CANNOT ACCESS DEVICE" or "DEVICE LOCKED". This means some other process has control of the tty. To find out what the process is, type from the command line: ps -ef | grep tty1 If the process is a 'getty', run 'pdisable tty1'. If it is some other process, run 'kill -9 <process id>'. Note: Some processes must NOT be stopped with the '-9' option (i.e. slattach), take the appropriate steps to kill the process and free the port. In the case of "slattach" for example you would first run: ifconfig sl(x) detach kill # (# is process id of slattach) If no process is returned except the grep itself, the port is 'hung' and must be cleared. To clear a port, run: cu -ml tty1 The response from the RS/6000 should be "cu not found" This indicates a missing uucp file set. Run the following command: lslpp -h *uucp* If the system responds and the uucp fileset is not found on the system. Install the file set. For a 3.2 system install 'bosext1.uucp.obj'. For a 4.1 system install 'bos.net.uucp'. After the installation othe fileset, return to normal mode to set up procedure. Modem to Modem Communication Failure Common Dial In Problems RS/6000 gives a herald but asks for R\I\N\G's password. (or says you have logged in with all uppercase) This indicates the modem attached to the RS/6000 has result codes turned on and is sending 'RING' to the system when someone dials in. To 'fix' the above: 'cu' to the modem and send command 'atq2'. If modem will not accept 'q2' send 'atq1'. (After sending 'atq1' the modem will not respond with "OK" because you have turned all result codes off. The code 'atq0' will turn them back on). If the modem accepts 'atq2' but still asks for 'RINGs' then send the password 'atq1'. If caller gets connected but does not see a herald run, type the following command: ps -ef | grep ttyx If a getty is not running, type the following command: penable ttyx then dial in again. If you penable the getty and it dies or you see a console message of "INIT RESPAWNING TO RAPIDLY", the carrier detect (CD) is high on the port. To verify this run the following command: /usr/lbin/tty/stty-cxma ttyx | pg The output is a snapshot of the line conditions of the tty, (+) is high and (-) is a low. If you see CD+ and no one is dialed into the modem, THIS INDICATES A PROBLEM. Carrier detect should only go high when another modem calls the RS/6000's. Either the modem is sending the CD or the RS/6000 is altering the port itself. The quickest way to check where the problem lies is to turn the modem off, and run the following command again: /usr/lbin/tty/stty-cxma ttyx | pg If you see 'CD-' the modem is the problem. It must either be reprogrammed or it is not functioning properly and should be replaced. Try 'at&c1' or check the modem's manual for the proper command to have CD follow the line signal. IF however, you still see 'CD+' with the modem off, the RS/6000 is the cause. Check the following: Unplug the cable to see if DTR is being looped back to CD on the port. Note: If you are using a 8 wire cable off a 128port adapter RAN unit there is an error in the original cable diagram, see Appendix C, "Modem Cable Pin Outs" for correct pin to pin connections. Run: stty -a < /dev/ttyx | pg Look for the output 'clocal' (NOT '-clocal'). If you see it listed go into 'smit' and do a "change/show" on the tty. On the final screen you will see two lines called "STTY runtime attributes" and "STTY login attributes". On both of the lines scan the list of attributes in the  box to the left. Find and delete the 'clocal' attribute found in either of the lines. Run the following command to make the change take effect: rmdev -l tty Note: If the system says the device is busy, run the following command: pdisable ttyx then repeat the following command: rmdev -l tty Type 'mkdev -l ttyx' If you do not find 'clocal' listed, check the tty settings in 'smit' for either "Force Carrier" or "Ignore Carrier" being "ENABLED". If the tty is set to "SHARE" or "DELAY" mode (for dial out and in operation) you run 'cu -ml tty1' and if it says "cannot access device" this indicates a 'getty' is running on the port when it should not be there. 'Getty' is only run on a "SHARE/DELAY" tty when someone dials into the modem (and CD goes HIGH) The problem is the same as in step 2 above. The port is seeing CD high when no one is dialed in. Trouble shoot the same way as step 2. Note: When the 'getty' is running, it should not be associated with the tty until another modem dials in and CD goes high. A common question on modems is "I have a 14.4 or a 28.8 speed modem but there is no option in 'smit' for a tty speed to match this?" A 14.4 or 28.8 modem tty may be set to 19,200 or 38,400. Both types of modems can operate at faster speeds. Set the 'baud' in 'smit', and in the "Devices" file. Then set the modem by running the following command: at to set the 'baud' as stated in the modems manual or on the RS/6000, from the command line run: cu -s(baud) -ml ttyx For example if you run 'cu -s19200 -ml tty1' this will open the tty1 port at a speed of 19200. When you see 'CONNECTED' type on the command line: at The response from the modem should read "OK". You have now communicated with the modem at the 19200 baud speed and the modem now matches the port speed. Note: Most modems run with v.32 compression. This can give up to a 4 to 1 compression. A 14,400 bits/secmodem compressing 4 bits to 1 bit results in 14,400 times 4 which is 57600 bits/sec. You can set a tty to run at 38400 and program the modem for the same speed because it could run faster than 38,400 bits/sec. Common Dial Out Problems The most common dial out problem is getting connected and then getting garbage characters or nothing after the connect to the other modem. The number one cause of this problem is a 'baud' rate mismatch between the modem and the tty it is attached to. Three baud rates MUST match. The rate set in 'smit' for the tty The rate in the Devices file line The rate of the modem itself. Look at the 'tty baud via smit', then run the following command: cu -s(baud) -ml ttyx (i.e. cu -s9600 -ml tty1) This will open the port at the baud rate of the '-s' flag on the command line. You should see the response "CONNECTED". From the command line type: at (You should get the response "OK") You have now set the modem to the '-s' flag speed. If you get an error on this command run, 'cu -ml tty1'. When you get "CONNECTED", set the baud rate with the proper 'at' command for your particular modem. Note: If you 'cu' to modem and get "CONNECTED" but the cursor does not respond to key strokes or you do not get an "OK" then enter the following: (You will not be able to see what you typed): ate1 "enter" atq0 "enter"; These two commands should turn the echo and answer codes back on in the modem. If you still do not get screen activity, it could be due to one of the following reasons: The modem is off or bad. The cable is the wrong type or bad. For example if you can see the TD light on the modem flicker when you are typing but you cannot see anything on your screen; this would indicate a bad modem or cable in the RD line because you can talk to the modem but it cannot send a signal back to the RS/6000. You have 'cu' to the wrong tty. You may also have bad hardware in the setup (modem, cable, etc.). CHECK YOUR HARDWARE, especially a new setup that has never worked prior to this attempt.