[comp.os.cpm] MEX Batch mode solved

jdb@NCSC.ARPA (Brown) (04/21/87)

Well, it looks like I wasn't the only one having trouble with batch mode in 
MEX.  Thanks to Steve Grandi at noao.arpa for the solution.

As he (and others) said, MEX uses the XMODEM-BATCH protocol, not the
YMODEM-BATCH protocol. (here I'm only talking about the public domain
version of MEX, version 1.14, I hear the commercial version supports both)
XMODEM-BATCH is a kludgy implementation of a batch protocol, but it works.
YMODEM-BATCH is a more 'elegant' implementation which allows passing of 
much more info about the file and is not restricted to the CP/M notion
of what a file name should look like.  For documentation on the two
protocols, look under pd:<misc.protocols> at simtel20. There is 
documentation on XMODEM-BATCH and a more generic description of both
xmodem and ymodem (don't remember the exact names noe, but they are obvious
if you can get a directory listing).

Steve also provided a copy of his 'xmodem' program which supports x/ymodem
batch protocols, 1K/128 packets, and CRC/checksum in any combination.  As 
it turned out, I had to modify the batch send code to work with my C128.
The time required to create the new file was longer than xmodem wanted
to wait around for the NAK/C following the file name transfer (5 seconds),
so xmodem was giving up before MEX (on a C128) got back to the transfer.

So, the answer is, if you need to talk batch using MEX to UNIX running 
4.2/4.3BSD, Steve's xmodem will do the job.  If you are using a C128,
the file send.c which is part of his package, needs to be modified to
wait longer for the C/NAK following the name transfer.

If anyone has any questions about what is needed, let me know.

david brown
jdb@ncsc.arpa

WANCHO@SIMTEL20.ARPA (04/22/87)

At one time, I wrote out a description of the MODEM7 protocol as then
implemented by the TOPS-20 version, called MODEM.  Although TMODEM has
replaced MODEM with many changes, the description of the protocol with
respect to the timeout values used remain essentially the same.  The
major difference is that a multiplier of four is used instead of three
for determining the timeout value for a data packet.  TMODEM and MODEM
before it sends the data packet as a string in a single system call
rather than sending each character in the data packet with separate
system calls and associated timeouts.

These timeout values were empirically determined over many transfers
under a variety of line conditions and delays and significantly
contribute to the robustness of the protocol.  Unfortunately, these
values were incorporated into MODEM7 late in its life while undergoing
a power struggle, and probably never made it into many of the current
versions claiming to be "xmodem" compatible.  In fact, many of the
so-called versions of "xmodem" in the pc world are based on a very old
description of the protocol that doesn't even include CRC mode, much
less the MODEM7 "batch" mode.  Fortunately, both MEX 1.14 and all
subsequent versions of the commercial versions of MEX, MEX-PLUS and
MEX-PC, do use these improved timeout values.  I cannot speak for YAM
and YMODEM, but I suspect they use similar values.

So, those of you wishing to "improve" the timeout values should
consider checking out the values given in PD:<MISC.TOPS-20>MODEM7.DOC.

BTW, I must agree that the YMODEM batch method of passing filename and
other information is definitely superior to the MODEM7 method.  TMODEM
may incorporate that option someday as well...

--Frank