[comp.unix.aix] modems on RT

windley@cheetah.cs.uidaho.edu (Phil Windley/20000000) (10/11/90)

I asked this in comp.sys.ibm.pc.rt a few days ago and got no response, so
I'll try here.

I'm trying to get an internal modem to work as a dial-in on an RT running
AIX 2.2.1.  The problem is that I can't find out how to send an
initialization string to it to get it to go into auto answer mode.  I've
tried just using echo to send strings to /dev/tty0 (the device for the
modem) but this seems to hang.  I've been all through the "Managing..."
manual without finding out how to do this.  They seems to assume that you
will use an external modem with switch settable properties.

Can anyone help?

--phil--
--
Phil Windley                          |  windley@cheetah.cs.uidaho.edu
Department of Computer Science        |  windley@ted.cs.uidaho.edu
University of Idaho                   |
Moscow, ID 83843                      |  Phone: (208) 885-6501

tom@vta.UUCP (Tom Wiencko) (10/13/90)

In article <WINDLEY.90Oct11083039@cheetah.cheetah.cs.uidaho.edu> windley@cheetah.cs.uidaho.edu (Phil Windley/20000000) writes:
>
>
>I'm trying to get an internal modem to work as a dial-in on an RT running
>AIX 2.2.1.  The problem is that I can't find out how to send an
>initialization string to it to get it to go into auto answer mode.  I've
> ...
>Can anyone help?

Yep.  I keep this one in my Daytimer because it comes up so frequently.

Send the following commands to your Hayes compatible modem:

	E0
	Q1
	C1
	D3

That ought to do it.  I won't explain it, there is much black magic in why
all this is necessary.

Tom

windley@cheetah.cs.uidaho.edu (Phil Windley/20000000) (10/17/90)

In article <598@vta.UUCP> tom@vta.UUCP (Tom Wiencko) writes:

   In article <WINDLEY.90Oct11083039@cheetah.cheetah.cs.uidaho.edu> 
   windley@cheetah.cs.uidaho.edu (Phil Windley/20000000) writes:
   >
   >
   >I'm trying to get an internal modem to work as a dial-in on an RT running
   >AIX 2.2.1.  The problem is that I can't find out how to send an
   >initialization string to it to get it to go into auto answer mode.  I've
   > ...
   >Can anyone help?

   Yep.  I keep this one in my Daytimer because it comes up so frequently.

   Send the following commands to your Hayes compatible modem:

	   E0
	   Q1
	   C1
	   D3

   That ought to do it.  I won't explain it, there is much black magic in why
   all this is necessary.

Either I don't understand the answer or you didn't understand the question.
You say to "send" those to the modem.  That's the problem: sending ANYTHING
to the modem.  I know how to get it into autoanswer mode, once I can send
things to it.

I have found that I can use cu to do the job, but I'd rather be able to put
something in a crontab file.  (cu doesn't seem to like to have things
redirected into it.)

--
Phil Windley                          |  windley@cheetah.cs.uidaho.edu
Department of Computer Science        |  windley@ted.cs.uidaho.edu
University of Idaho                   |
Moscow, ID 83843                      |  Phone: (208) 885-6501

robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) (10/25/90)

In article <598@vta.UUCP> tom@vta.UUCP (Tom Wiencko) writes:
>In article <WINDLEY.90Oct11083039@cheetah.cheetah.cs.uidaho.edu> windley@cheetah.cs.uidaho.edu (Phil Windley/20000000) writes:
>>
>>
>>I'm trying to get an internal modem to work as a dial-in on an RT running
>>AIX 2.2.1.  The problem is that I can't find out how to send an
>>initialization string to it to get it to go into auto answer mode.  I've
>
>Send the following commands to your Hayes compatible modem:
>
>	E0
>	Q1
>	C1
>	D3
>

Actually the E0 is not required, but setting the port to pdelay or pshare is..	Setting Q1 is also not required, but setting Q1 OR Q2 is.

	1) E0 turns off command echo.  This means that when you type in
	commands on the modem, it will not respond.  This is to prevent 
	the modem from echoing back the login herald when the port sends
	it out.  Fortunately, if you use pshare, a login herald will not
	be issued until CD (carrier detect - rs232 pin 8) is raised by the
	modem.  Or, if you use "pdelay" the login herald will not be issued
	until the modem sends a character to the serial input on the RT.

	2) Q1 turns off command response from the modem.  This will work
	but it will cause problems if you need to use the modem for UUCP
	CU, or certain other facilities.  This is because these facilities
	(by default -- the configuration can be changed to work) use 
	the command response to detect call progress.  (Ie. send the command
	"AT", expect "OK" from the modem, dial the number, expect "CONNECT"
	from the modem, etc.)  Setting the modem to Q2 will cause the modem
	to only send responses to command issued from the RT side of the
	connection -- not the incoming telephone line side.  This will
	prevent the modem from saying "RING" or "CONNECTED" when the remote
	system dials in.  The reason you don't want these responses is because
	they will be stored on the serial input buffer as an attempt to login,
	causing the first login to always fail...  Not a good thing to 
	happen for reliable serial communications.

The C1 should read "&C1".  From my recollection (and from this hayes book
right here in front of me) there is no "C" software switch on the hayes
modems.  The "&C1" should set the modem to follow true carrier.  This is
very important if the tty is set to "pshare" since; when in pshare mode, 
getty will not issue a login herald until it sees carrier come up from the
modem.  If the modem is not set to "&C1" the modem will always hold carrier
high, causing getty to alwys issue a login herald (which defeats the purpose
of pshare).

The D3 should read "&D3".  The "D" software switch on the hayes modem is to 
alert the modem to "Dial".  The "&D" switch is to tell the modem how to 
handle DTR signals from the DTE device (the RT).  The "&D3" tells the modem
to hangup, and reset to stored operating parameters when DTR from the 
DTE device is dropped.  NOTE: this will dump any settings made to the modem
that you may have made without actually saving them to the default profile.
Another method to accomplish similar results is to set "&D2" instead.  This
will tell the modem to "hang up and return to command mode" when DTR is 
dropped by the DTE device.   This method will not reset the modem.   The 
reason this setting is significant, is that it will determine the modem's 
ability to hangup when the call is terminated by the RT.  The RT line
discipline currently will drop DTR for at least 10 milli-seconds after a
logout (or SIGKILL/SIGHUP/etc. on the process running on the tty) is received.
The response of the modem should be to drop carrier, to signal a loss of the
DTE device, and dropping CD should cause the modem to hangup.  This is very
important to modem communication because a connection will not hangup if 	the modem asserts DTR unless the remote site drops carrier.  (In other words,
if you logout on the RT, the connection will stay up until you physically 
disconnect the line from the remote site.)

Other important settings are:

	&K - sets flow control... NOTE: UUCP cannot use XON/XOFF flow
	control.  This is because UUCP transmits a packet, and then
	waits for a response (with a checksum of the received packet).
	The checksum value in the response packet can contain the valid
	XON/XOFF characters, and willbe stripped out by the modem, or the
	serial port drivers if used.  However, the RT cannot do RTS/CTS
	so you must set "&K0" if you want to use the RT - modem setup
	for UUCP.

		&K0 -- no flow control
		&K4 -- XON/XOFF flow control (can be used for "non-uucp"
					      connections.)

	Anything else won't work (reliably).

	S000 - set the number of rings before answering the call.  If you
	want the modem to autoanswer, set this to a number > 1.  Otherwise,
	0.  Be careful, large numbers will affect the timeout values for 
	incoming modems (ie. if the number of rings is set to "10" then,
	incoming calls will have to wait for 10-11 rings (about 45 seconds)
	before the remote modem will answer, add to that several seconds for
	negotiating carrier, and there is a good likelyhood that the default
	timeout on the remote modem for establishing carrier will be 
	exceeded, causing the remote modem to say "NO CARRIER" and hang-up.)

	The rest can be found in you modem book.



+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     cs.utexas.edu!ibmchs!auschs!sabre.austin.ibm.com!robin             |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)823-4526                       |
+-----------------------------------------------------------------------------+

robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) (10/25/90)

In article <WINDLEY.90Oct16170649@cheetah.cheetah.cs.uidaho.edu> windley@cheetah.cs.uidaho.edu (Phil Windley/20000000) writes:
>Either I don't understand the answer or you didn't understand the question.
>You say to "send" those to the modem.  That's the problem: sending ANYTHING
>to the modem.  I know how to get it into autoanswer mode, once I can send
>things to it.


Have you tried:

	cat <<! > /dev/ttynnn # Where nnn == the tty number
	AT&D3 E1 Q2 &C1
	!
???  This should work if the port in "delayed" or "shared" (if it is enabled
the port will be locked in /etc/locks, and these settings will not work 
correctly.)


+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     cs.utexas.edu!ibmchs!auschs!sabre.austin.ibm.com!robin             |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)823-4526                       |
+-----------------------------------------------------------------------------+

robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) (10/25/90)

In article <WINDLEY.90Oct11083039@cheetah.cheetah.cs.uidaho.edu> windley@cheetah.cs.uidaho.edu (Phil Windley/20000000) writes:
>I'm trying to get an internal modem to work as a dial-in on an RT running
>AIX 2.2.1.  The problem is that I can't find out how to send an
>initialization string to it to get it to go into auto answer mode.  I've
>tried just using echo to send strings to /dev/tty0 (the device for the
>modem) but this seems to hang.  I've been all through the "Managing..."
>manual without finding out how to do this.  They seems to assume that you
>will use an external modem with switch settable properties.

There are several ways to accomplish this. 

	1) Set up the uucp Devices file "/usr/adm/uucp/Devices"
	with an entry for the tty in question.  The entry should look
	like:
	ACU ttynnn - <speed> hayes \D
	      ^		^
	      |		|
	      |		-- The speed you will use to talk to the modem
	      |		   (This can be "Any" as well.)
	      |
	      |
	      --- The tty that the modem is attached to.

	Then issue the command:
	cu -l ttynnn -s <speed>

	This will attach you to the modem, so you can issue commands directly
	to the modem.  Type "AT" and then hit [ENTER], the modem should 
	respond "OK".  At this point you should be able to issue whatever
	modem commands you like.

	2) Use ATE to connect to the tty.  In the ATE main menu screen select
	"ALTER" and get to the "ALTER menu".  Here set the Device to the 
	correct tty, the Rate to the correct baud rate, Bits-Per-Chracter, 
	Parity, Stop bits, etc.  After completing the Alterations, press enter
	once more to return to the main menu.  Then type "c ttynnn".  This
	will "Connect" you to ttynnn.  Go ahead and issue the AT commands
	you desire.

	3) Type: 
		cat <<! > /dev/lttynnn
		AT<command>
		AT<command>
		etc.
		!

There are actually several more, but one of the above should work for you.



+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     cs.utexas.edu!ibmchs!auschs!sabre.austin.ibm.com!robin             |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)823-4526                       |
+-----------------------------------------------------------------------------+