[linux] serial device communication

michael philetus weller philetus at u.washington.edu
Thu Jun 3 17:42:12 PDT 2004


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