[linux] serial device communication

Jesse Weigert jesse at rainydawg.org
Thu Jun 3 19:05:40 PDT 2004


Just curious, but why don't you just add a getty on that device?

Add a line similar to the following in /etc/inittab
T0:234:respawn:/sbin/mgetty -L ttyS0 19200 vt100

You should be able to use the windows terminal(or preferably Hyperterminal
Private Edition) to log in and send/receive files via zmodem.  (rz/sz commands)

I'm assuming a network connection is not possible because if it was, then
sending binary data would be much simpler and faster.

On Thu, 3 Jun 2004, michael philetus weller wrote:

> hi,
>
> I am pretty sure cat should work, I have seen several howtos that suggest
> communicating with the device linked to /dev/ttyX by saying 'cat
> </dev/ttyX'.
>
> further description of the problem:
>
> if I turn on echo, 'stty echo </dev/ttyS0' then when I send data from the
> windows terminal it is echoed to that terminal, but 'cat </dev/ttyS0'
> still hangs without printing anything.
>
> maybe the stuff I am sending is just sitting in the input buffer?
>
> I am ultimately trying to send binary data, so I am trying NOT to use
> control flow characters.
>
> any suggestions would be greatly appreciated.
>
> thanks,
>
> mike weller
>
> On Wed, 2 Jun 2004, Doug McLean wrote:
>
> > This is going to sound kind of dumb, but maybe instead of cat /dev/ttyS0,
> > maybe you should try minicom instead?  HOpefully that makes a difference.
> > :)
> >
> > Doug McLean
> > CSS Systems Administrator
> > University of Washington, Bothell
> > http://staff.washington.edu/dougmc/pgp.html
> >
> > Meanwhile, in Gotham, michael philetus weller wrote:
> >
> > > hi,
> > >
> > > I am running slackware 9 and attempting to communicate with a serial
> > > device over /dev/ttyS0. for testing I have plugged a female-female serial
> > > cable between my serial port and a windows box running a terminal program.
> > >
> > > I can write to the serial port, for example if I say:
> > >
> > >   $ echo hi > /dev/ttySO
> > >
> > > 'hi' prints out on the windows machine terminal no problem.
> > >
> > > however, I cannot seem to read from it. if I say:
> > >
> > >   $ cat /dev/ttyS0
> > >
> > > and then go and send some stuff from the windows terminal, I get nothing,
> > > the linux terminal just hangs.
> > >
> > > maybe I have my serial port setup wrong? here are the port settings from:
> > >
> > >   $ stty -a --file /dev/ttyS0
> > >
> > > speed 9600 baud; rows 0; columns 0; line = 0;
> > > intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
> > > eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
> > > lnext = ^V; flush = ^O; min = 1; time = 0;
> > > -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
> > > -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon
> > > -ixoff -iuclc -ixany -imaxbel
> > > opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0
> > > vt0
> > > ff0
> > > isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop
> > > -echoprt
> > > echoctl echoke
> > >
> > > any suggestions?
> > >
> > > thanks,
> > >
> > > mike weller
> > > philetus at u...
> > >
> >
>


More information about the Linux mailing list