[comp.sys.mips] uugetty - yes, it will work, and here's how

jns@fernwood.mpk.ca.US (Jerry Sweet) (03/06/91)

When I finally returned to attacking the uugetty problem, thanks to
some advice from MIPS and Telebit, I was able to get uugetty to work
on an RC3230 with a 16-port DigiBoard connected either to a Telebit
TB+ (a PEP modem) or to a Telebit T1600 (a V.32 modem).

I've been meaning to send this message off for some time now.  Yes,
the RISC/os 4.51 UUCP implementation and/or serial drivers have some
problems, but that's for a later message.  BUT! it is possible to get
a mostly sorta kinda working configuration using uugetty.  This
message tells how.

Uugetty is a program that permits bi-directional use of a modem port:
both call-in and call-out can take place on it.  Programs such as tip
that obey certain rules, and that have the appropriate ownerships +
setuid, can be used to place outbound calls when the modem isn't busy.
Inbound calls will also find it possible to get a login prompt when
the modem isn't otherwise in use.

The main problem that I was having was to get uugetty to "step aside"
for tip, to permit access to the modem.  It took a bit of
experimenting, but we finally got a working configuration.  Here's an
explanation of the configuration.  Also note: this information is
intended to supplement, not necessarily to supersede, the MIPS and
Telebit documentation.  No warranties; all risk of use of this
information devolves upon its user.

Overview:  0. DigiBoard jumpering
	   1. Cabling
	   2. Modem Programming
           3. RISC/os tty device file creation
           4. inittab and gettytab preparation

0. DigiBoard jumpering.  According to one respondent, the DigiBoard
may not be jumpered correctly.  You may have to verify the jumpering
with the documentation, or to call MIPS for assistance.  Our DigiBoard
appeared to work, so I didn't follow up on this possibility; it
appeared to have been jumpered correctly.


1. Cabling.  The DigiBoard uses a ten-pin modular connector.  The
documentation calls this connector an "RJ45".  It is LYING to you;
RJ45 is an 8-pin connector as far as the rest of the world is
concerned.  This means that you will probably have to buy the correct
cable from MIPS or directly from the manufacturer, whose address I
have included at the end of this note.

We bought the cable from MIPS, which includes lines for RTS/CTS.  The
RTS/CTS flow control, aka "hardware flow control", is not strictly
necessary for this experiment, but we like it because it isn't
XON/XOFF flow control, which can cause problems with certain editors.
The DigiBoard supports RTS/CTS, but some other MIPS-supplied serial
boards (notably the ISI CP board) do not.

An important line required by uugetty is the DCD (data carrier detect)
line.  Whatever you do, make sure that your cable has this line.


2. Modem programming.  One of the important things here is to ensure
that DCD is turned on only when a connection is actually established,
and that it's off otherwise.

For TB+ modems: The Telebit documentation for TB+ (Trailblazer Plus)
modems will LIE to you if you aren't careful about to which versions
of the modem software the manuals apply.  If you have an older ROM
revision, e.g. BA4.00, the register that controls DCD is *not* S131,
it is S53.  If your TB+ is in "conventional command mode", then &C1
will do the trick; if it's in "enhanced command mode", then you'll
have to set S53=4.

(Sorry, but I don't have the complete TB+ programming info handy here.)

For T1600 modems: Use &C1.

Here is the complete programming for the T1600 that we're using; you
should check these against the documentation to ensure that these are
appropriate for you.

T1600 - Version LA1.00  - Configuration A
 B1  E0  L2  M0  Q1  T   V0  X1  Y0
&C1 &D3 &G0 &J0 &L0 &Q0 &R3 &S0 &T4 &X0
S000:1   S001=0   S002=43  S003=13  S004=10  S005=8   S006=2   S007=40
S008=2   S009=6   S010=14  S011=70  S012=50  S018=0   S025=5   S026=1
S038=0   S041=0   S045=0   S046=0   S047=4   S048=0   S050:6   S051:4
S056=17  S057=19  S058:2   S059=0   S060=0   S061:0   S062=15  S063=0
S064:1   S068=255 S069=0   S090=0   S093=8   S094:0   S100=0   S102=0
S104=0   S105=1   S111:0   S112=1   S180:0   S181:0   S183=25  S190:0
S253=10

The settings for S180 and S190 were recommended by Cerrafin Castillo,
formerly of Telebit and Los Altos Networks.

Note that the settings E0 Q1 V0 turn off echoing and result codes, so
make the appropriate changes when dialing out.


3. RISC/os tty device file creation

You will need to create some new tty devices with magic minor numbers.
These new tty devices correspond to existing ones, but have different
behaviors.  The formula for the minor number is to add 128 to the
minor number of the corresponding existing tty's minor number.
For example:

crw--w--w-  1 root     bin       32,   0 Jan 14 22:49 /dev/ttyd0
crw--w--w-  1 root     bin       32,   1 Dec 20 19:00 /dev/ttyd1
...
crw--w--w-  1 root     bin       32,  15 Dec 20 19:00 /dev/ttyd15

The new tty devices have these attributes:

crw--w--w-  1 uucp     other     32, 128 Jan 31 00:06 /dev/ttydm0
crw--w--w-  1 uucp     other     32, 129 Jan 31 00:06 /dev/ttydm1
...
crw--w--w-  1 uucp     other     32, 143 Jan 31 00:06 /dev/ttydm15

Note that the ownerships of the NEW tty devices should be "uucp".

I posted to comp.sys.mips several days ago a shell scrip to create
these devices; if there is any demand, I'll re-post it.


4. inittab and gettytab preparation.

These files must be set up to invoke uugetty on the appropriate lines and
with the appropriate gettydefs labels.

Here is an example inittab line using uugetty for a TB+:

d0:234:respawn:/usr/lib/uucp/uugetty -r -t 60 ttydm0 tbplus.19200 none LDISC2;\
  # TB+ in/out

...and here is one for a T1600:

d8:234:respawn:/usr/lib/uucp/uugetty -r -t 60 ttydm8 v.32 none LDISC2; \
  # V.32 in/out

Note the port numbers in the uugetty command lines.  Also note that
"\" continuation lines probably aren't allowed; they're just included
here for aesthetic reasons.


The gettydefs for "v.32" and "tbplus.19200" are:

tbplus.19200# B19200 RTSCTS HUPCL # B19200 SANE RTSCTS TAB3 HUPCL #\
  \r\n\nlogin: #tbplus.19200


v.32# B9600 RTSCTS HUPCL # B9600 SANE RTSCTS TAB3 HUPCL #\r\n\nlogin: #v.32


Same notes about backslashes; they're cosmetic here; they shouldn't be
placed into the gettydefs file.


Appendix.  Information about the cable manufacturer.

      K&H Distributors
      6800 Shingle Creek Parkway
      Brooklyn Center
      MN 55430

      Phone (800)328-8515

Sorry, I don't have a part number for the K&H cable, but the MIPS part
number is 77-03052/9051.

Thanks to all who responded!