[linux] serial device communication

michael philetus weller philetus at u.washington.edu
Fri Jun 4 15:19:28 PDT 2004


hi,

I figured out what was wrong, when I probed the serial port:

  $ setserial /dev/ttyS0 -v autoconfig

I got a message that the serial port was being used by another device.

I restarted the computer and then the probe came back with:

  > /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

like it was supposed to, and now I can read from and write to the port.

thanks for the suggestions.

mike

On Fri, 4 Jun 2004, michael philetus weller wrote:

> I am not trying to login to the computer, I am trying to send and receive
> binary data from a device plugged into the serial port.
>
> getty -> get a tty -> login to the computer and start a terminal
>
> I also don't need a modem protocol, I am just trying to send bytes
> straight up.
>
> a network connection is not possible because the device I have plugged in
> to the serial port has no networking capablities.
>
> thanks,
>
> mike weller
>
> On Thu, 3 Jun 2004, Jesse Weigert wrote:
>
> > 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