On Tue, 3 Oct 2006, Jeff Quast wrote:
> On 10/2/06, Peter Bako <[EMAIL PROTECTED]> wrote:
> > I am trying to get a CrystalFontz 632 serial display to work with an OpenBSD
> > box. Under Windows I can just connect the display to a com port, run
> > Hyperterminal and send text directly to it, so I assumed that I could just
> > send a data stream to /dev/tty00 under OpenBSD and make it work as well.
> > Unfortunately it is not turning out to be anywhere that simple.
>
> So far, neither OS does any more than the other.
>
> > If I use cu or tip and connect to /dev/tty00 and 19200 then I can send data
> > to the display, but eventually I need to be able to send data to it from a
> > shell script. Any attempt I make to send data to it (such as cat test >
> > /dev/tty00) results in an error of "sh: Cannot create /dev/tty00:
> > Interrupted system call".
> >
> > I've tried to mess with the stty command to setup the serial port (open it
> > up, set the speed, etc), but no luck, that error always comes up. Can
> > anyone point me to the right direction on this?
> >
> > Thanks,
> > Peter
>
> Peter,
>
> I would write what you need in C. I can help you along or start you
> out with ~30 lines to do the job if necessary. It is very simple if
> you are even just partly familiar with C. After 5 or so lines of
> initializing the device, its just basic file i/o operations.
>
> If you are more comfortable with python or perl, these can probobly
> handle the job as well.
>
> as for being able to use stty, then echo to it, I don't think its
> possible. Anyone?
In the ancient days, one first had to own the tty device so that
one's stty's to it would "stick". This was done with a kludge/cliche
in shell scripts like
( cat /dev/null >/dev/ttyxxx; sleep 1000000) &
then followed by stty and other stuff.
I've probably got the idiom in the "cat" wrong. It may have been
"cat </dev/ttyxxx >/dev/null".
The idea is to "own" the device by opening it and holding it open.
It's been maybe 20 years since I had to do this. It shouldn't be
necessary, but used to be, because in shell scripts, you "lost" the
device after every command, and it would be reset to default values.
If you were going to diddle with flow control, speed, and other things,
you needed to retain your settings across shell commands.
I apologize in advance if this is a System Vism or is so obsolete as to
be laughable.
Dave
--
Of a truth, few men desire freedom, the greater part
are content with just masters. -- Sallust