[comp.unix.wizards] Talking to a modem

sullivan@aqdata.uucp (Michael T. Sullivan) (01/05/90)

A question from a company that doesn't have a source license so we can't
find out from that.

We need a program that will allow a user to talk to a modem through Unix,
much the same way as one would via "cu -l ttyxx" (don't ask me why we can't
just use cu, I don't know).  Sending to the modem is easy, it's the reading
that seems to be the problem.  The program just isn't reading what the
modem is sending back.  How exactly does a process go about reading from
a character device?  Any help would be mucho appreciated.
-- 
Michael Sullivan          uunet!jarthur.uucp!aqdata!sullivan
aQdata, Inc.
San Dimas, CA

john@hopf. (John Franks) (01/05/90)

Here's a shell script which does what you want.  You will have
to modify BAUD and DEV.  It ignores parity issues which you
may have to deal with.

#!/bin/sh
BAUD="1200"
DEV="/dev/cua0"
cat -u <$DEV &
trap "kill $!; stty echo -cbreak; exit 1" 2
stty -echo $BAUD raw hup  >$DEV
stty -echo cbreak
cat -u | tr '\012' '\015' >$DEV
John Franks 	Dept of Math. Northwestern University
		john@math.nwu.edu

johnson@ncrons.StPaul.NCR.COM (Wayne D. Johnson) (01/06/90)

In article <1990Jan4.233902.29658@aqdata.uucp> sullivan@aqdata.uucp (Michael T. Sullivan) writes:
>We need a program that will allow a user to talk to a modem through Unix,
>much the same way as one would via "cu -l ttyxx" (don't ask me why we can't
>just use cu, I don't know).  

Try Kermit from Columbia Univ.  Its totaly free and available in source.

>Sending to the modem is easy, it's the reading
>that seems to be the problem.  The program just isn't reading what the
>modem is sending back.  How exactly does a process go about reading from
>a character device?  Any help would be mucho appreciated.

I've not had much to do with UNIX and modems, however you might want to check
that your modem is delivering all the RS232 signals properly.  Some machines
will ignore characters if there is no DSR or RCD signal.  If I understand it
right, you can set CLOCAL on some machines to ignore these signals and receive
the data anyway.  Beware, using CLOCAL can prevent the computer from recognising
that the caller has hung up (signaled by a drop of DSR).

If you want more information on where to get Kermit or RS232 on UNIX, drop a 
note.
-- 
Wayne Johnson         |  Is a baby's life worth more than the right to 
NCR Comten, Inc.      |  make a choice?  Babies are people too.
Roseville MN 55113    +-----------------------------------------------------
(Voice) 612-638-7665   (E-MAIL) W.Johnson@StPaul.NCR.COM