[comp.unix.questions] Capturing data off of a serial port on a 386i

kenarora@mipos2.intel.com (Judge K Arora) (11/27/90)

  I'm not a frequent reader of this newgroups, so pardon me if this has
been asked before.....

  I'm trying to capture data that's coming off a serial port from another
computer (PC) onto my 386i (Sun OS 4.0.2).  I'd like to capture in from a 
program running on the console.  I've configured /etc/ttytab (and /etc/ttys
for back compatibility) to reflect the existence of the /dev/ttya, but
it does not have getty running, and its status is off. First, are these
the correct settings, and secondly, what is the open call (and further
ioctl's, if necessary) needed to do this (I believe canonical mode will
do)?

  Alternately, but not quite as good a solution for the problem, if I
were to configure /dev/ttya as a "Unix" terminal (i.e. run getty on it)
is there a better way of capturing data that is sent from the PC to the sun, 
keeping in mind that (at startup, at least) some commands need to go the other
way?

  Any replies by e-mail would be greatly appreciated.

Thanks,
Ken Arora


kenarora@mipos2.intel.com
kenarora@portia.stanford.edu (in case the 1st addr. bounces)

kenarora@mipos2.intel.com (Judge K Arora) (12/05/90)

In article <1092@inews.intel.com> I (Judge K Arora) write:

>  I'm trying to capture data that's coming off a serial port from another
>computer (PC) onto my 386i (Sun OS 4.0.2).  I'd like to capture in from a 
>program running on the console.  I've configured /etc/ttytab (and /etc/ttys
...
>the correct settings, and secondly, what is the open call (and further
>ioctl's, if necessary) needed to do this (I believe canonical mode will
>do)?

  Yes, I know I'm supposed to open /dev/ttya, and I also know about the
termios data structures (using ioctls for TCGETS, TCSETS).  The problem
is that (at least at 9600 baud, w/o RTS/CTS handshaking, because the PC
doesn't support it) I keep dropping characters every so often (about
every 7000-8000 characters), and get some garbled data instead (usually
mostly ascii 02 (control-B)).  I've also tried doing this from the
shell (cat < /dev/ttya > foo), and encountered the same problem.  I've
tried setting the IXOFF protocol in the termios data structure, and
that doesn't seem to help.  I'm still using canonical mode, but the
few experiments I've tried with non-canonical mode don't seem to work
any better.

   Has anyone else tried doing this?  on a 386i?  Is 9600 baud too
fast?  Should I change a specific flag in the termios struct?  Will
non-canonical mode help?  The answers to these and other exciting 
questions are eagarly awaited (next week, same 'nix-time, same 'nix-group)

Thanks again,
Ken Arora
 
kenarora@mipos2.intel.com
kenarora@portia.stanford.edu (in case the 1st addr. bounces)