[comp.unix.aux] Setting serial ports to 19.2 KB

donn@radar.UUCP (Donn S. Fishbein) (06/10/89)

Does anyone know how to set the serial ports to 19200 baud?
The man page for stty mentions 19200 as equal to "exta",
but neither "stty exta </dev/tty0"
		  nor "stty 19200 </dev/tty0"
seem to do anything. "stty -a </dev/tty0" reports that the
port is still set to the previous setting, and indeed it
is when tested.

I called the A/UX Hotline about this question (under A/UX 1.0),
but they could not answer the question. The problem seems to
have persisted in A/UX 1.1. It seems a shame to only utilize
half the potential bandwith of my Trailblazer + 

Followup to previous question: no one has responded to my query
about a version of "dim" that works under 1.1. Anyone know the
answer?
-- 
Donn S. Fishbein        ..killer!radar!donn

ted@hpwrce.HP.COM ( Ted Johnson) (06/12/89)

>Does anyone know how to set the serial ports to 19200 baud?
>The man page for stty mentions 19200 as equal to "exta",
>but neither "stty exta </dev/tty0"
>		  nor "stty 19200 </dev/tty0"
>seem to do anything. "stty -a </dev/tty0" reports that the
>port is still set to the previous setting, and indeed it
>is when tested.

I haven't worked with A/UX, but other flavor of unix require
you to first do a nohup sleep on the port, i.e.,

/bin/nohup /bin/sleep  99999999  < /dev/tty0 &
stty 19200 < /dev/tty0

The nohup sleep keeps the port open, so that it remembers its
port settings.

The value used for sleep is usually something which is >> the
amount of time you expect will pass before the machine is 
rebooted.

-Ted

paul@taniwha.UUCP (Paul Campbell) (06/12/89)

In article <273@radar.UUCP> donn@radar.UUCP (Donn S. Fishbein) writes:
>Does anyone know how to set the serial ports to 19200 baud?
>The man page for stty mentions 19200 as equal to "exta",
>but neither "stty exta </dev/tty0"
>		  nor "stty 19200 </dev/tty0"
>seem to do anything. "stty -a </dev/tty0" reports that the
>port is still set to the previous setting, and indeed it
>is when tested.
>
>I called the A/UX Hotline about this question (under A/UX 1.0),
>but they could not answer the question. The problem seems to
>have persisted in A/UX 1.1. It seems a shame to only utilize
>half the potential bandwith of my Trailblazer + 

The problem is that if you close a serial port (like you do when
stty finishes) the serial port resets itself to its default
settings (a generic Unix problem). To use UUCP at 19200 (as I do
on my Telebit) put an entry for the line in /usr/lib/uucp/L-devices
(at 19200) and an entry for the remote site also at 19200. Unfortunately
cu doesn't seem to understand a speed of 19200 and it chokes so you
can't do your own callouts at this speed (something Apple should fix in
a future release ....) [although you probably could do a cu then a stty
after cu had started - something like

	(sleep 30;stty 19200 </dev/ttyc0)& cu -lttyc0



	Paul

-- 
Paul Campbell
Taniwha Systems Design			UUCP:		..!mtxinu!taniwha!paul 
Oakland CA				AppleLink:	D3213
Achtung! Ve are from ze Interface Police! Ve vant to look und feel!

dwb@archer.apple.com (David W. Berry) (06/13/89)

In article <273@radar.UUCP> donn@radar.UUCP (Donn S. Fishbein) writes:
>Does anyone know how to set the serial ports to 19200 baud?
	If you have a dial in line (or for that matter a direct connect
line) that you want to run at 19200, you'll have to edit /etc/gettydefs
to add a at_19200 or mo_19200, line and link it into the autobaud sequence.
You can then change /etc/inittab to set the default for the line to the
added entry.

	If you want it for uucp, you should be able to set the speed
in the L.sys and L-devices files to 19200 and have it work as expected.
If you want it for cu or tip you're out of luck since they don't understand
anything more than 9600.  Kermit also doesn't understand 19200 or 38400
(also possible) but since we ship the source for them that can be remedied.

	Unfortunately, the experiment you tried is rather fruitless because
the tty gets set back to it's default state whenever it's not open.  You
change the parameters, the command completes, the tty gets closed and reset
to defaults, you execute another command to find out it's state.  What you
were trying to accomplish can be done by:

	( stty 19200 ; sleep 3600 ) < /dev/tty0 &

This forces the tty to be kept open, and thus the stty changes will "stick"